New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build error in esp32/audio.c : "sample rate too low" #1287
Comments
Under ESP-IDF 5.x, the minimum sample rate on the original ESP32 is now 20000. Here's the relevant defines from
This example uses 8000 in its manifest. This was fine with IDF v4. If you change the sample rate to 20000, does it work for you? N.B. For other members of the ESP32 family, the minimum sample rate appears to be 611 so this is only an issue on the original ESP32. |
Actually, the two devices you cite use PDM, not the ADC, for audio input. So, the check for the sample rate being in bounds for the ADC is unnecessary. Try replacing this.... moddable/modules/pins/audioin/esp32/audioin.c Lines 65 to 69 in ddde79a
....with this... #if MODDEF_AUDIOIN_I2S_ADC
#if MODDEF_AUDIOIN_SAMPLERATE < SOC_ADC_SAMPLE_FREQ_THRES_LOW
#warning "SOC reqires higher audioin sample rate. automatically increasing."
#undef MODDEF_AUDIOIN_SAMPLERATE
#define MODDEF_AUDIOIN_SAMPLERATE SOC_ADC_SAMPLE_FREQ_THRES_LOW
#elif MODDEF_AUDIOIN_SAMPLERATE > SOC_ADC_SAMPLE_FREQ_THRES_HIGH
#warning "SOC requires lower audioin sample rate. automatically decreasing."
#undef MODDEF_AUDIOIN_SAMPLERATE
#define MODDEF_AUDIOIN_SAMPLERATE SOC_ADC_SAMPLE_FREQ_THRES_HIGH
#endif
#endif This does two things:
|
Thanks for confirming. |
Cool. Thank you. I'll commit the change. It seems like an improvement. |
Commit now available. Closing. |
Build environment: macOS,
Moddable SDK version: 4.3.8(ESP-IDF v5.1.2 )
Target device: M5StackCore2, M5Stick-c
Steps to Reproduce
Build app
examples/pins/audioin/wavserver
using this build command:mcconfig -d -m -p esp32/m5stick_c ssid="MY_SSID" password="MY_PASS"
The text was updated successfully, but these errors were encountered: