QuasiBird still runs jittery at 22050 hz 16 bit stereo.
Mono is fine, and lower sample rates are fine too.
At max volume, so no volume scaling, the frame rate is quite high
but it still jitters. The question is why...
- does the buffer underrun?
- or does it spend too much time reading from SD card?
- or is the CPU busy?
Solutions:
- offload it to a different core
- do the I2S playback asynchronous
I guess it doesn't make sense tweaking this, as audio plays fine up to 48khz stereo
if no game is being played, just normal GUI updates.
This works for init:
AudioManager(i2s_pins=i2s_pins, adc_mic_pin=1)
And then this for recording:
AudioManager.record_wav_adc(file_path="/recording.wav",duration_ms=5000,sample_rate=16000,on_complete=lambda msg: print(f"Finished: {msg}"))
Currently, the file is a bit too small and there are interruptions,
probably from the timer stopping and starting to tweak it.
I guess this should be done in C rather than pure MicroPython.