diff --git a/src/amy.c b/src/amy.c index 9c5f6bb..f9ef426 100644 --- a/src/amy.c +++ b/src/amy.c @@ -1764,7 +1764,7 @@ int16_t * amy_fill_buffer() { // TODO -- the esp stuff here could sit outside of AMY // For some reason, have to drop a bit to stop hard wrapping on esp? -#if defined(ESP_PLATFORM) || defined(__IMXRT1062__) + #if defined(ESP_PLATFORM) || defined(__IMXRT1062__) || defined(AMY_ISSUE_425) uintval >>= 1; #endif if (positive) { diff --git a/src/amy.h b/src/amy.h index 232d75d..02cc0d5 100644 --- a/src/amy.h +++ b/src/amy.h @@ -43,6 +43,7 @@ extern const uint16_t pcm_samples; // Set block size and SR. We try for 256/44100, but some platforms don't let us: +#ifndef AMY_BLOCK_SIZE #ifdef AMY_DAISY #define AMY_BLOCK_SIZE 128 #define BLOCK_SIZE_BITS 7 // log2 of BLOCK_SIZE @@ -50,7 +51,9 @@ extern const uint16_t pcm_samples; #define AMY_BLOCK_SIZE 256 #define BLOCK_SIZE_BITS 8 // log2 of BLOCK_SIZE #endif +#endif +#ifndef AMY_SAMPLE_RATE #ifdef AMY_DAISY #define AMY_SAMPLE_RATE 48000 #elif defined __EMSCRIPTEN__ @@ -58,8 +61,11 @@ extern const uint16_t pcm_samples; #else #define AMY_SAMPLE_RATE 44100 #endif +#endif +#ifndef PCM_AMY_SAMPLE_RATE #define PCM_AMY_SAMPLE_RATE 22050 +#endif // Transfer types. #define AMY_TRANSFER_TYPE_NONE 0