From 9fd29fa16fe3c98fa9f067a1f7c48626703b94b2 Mon Sep 17 00:00:00 2001 From: James Gartrell Date: Thu, 12 Feb 2026 09:58:42 -0800 Subject: [PATCH 1/2] Expose define to address shorepine/amy#425 for other platforms --- src/amy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) { From a209c428b146684c29a5afaa4c321b00ee324409 Mon Sep 17 00:00:00 2001 From: James Gartrell Date: Thu, 12 Feb 2026 21:42:23 -0800 Subject: [PATCH 2/2] Add ability to re-define AMY_SAMPLE_RATE, shorepine/amy#551 --- src/amy.h | 6 ++++++ 1 file changed, 6 insertions(+) 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