ArmDeveloperEcosystem / microphone-library-for-pico

Capture audio from a microphone on your Raspberry Pi Pico or any RP2040 based board. 🎤
Apache License 2.0
232 stars 47 forks source link

when is on_usb_microphone_tx_ready() called? #25

Closed petercwallis closed 8 months ago

petercwallis commented 1 year ago

In /examples/usb_microphone/main.c there is a sample_buffer of 256 int16_t that I assume gets passed to the usb tx process with the above call. I was expecting it to get called when the other end of the usb serial connection ran out of data - so about 16000/256 times a second? I have tried using a for loop to fill the sample buffer with rubbish on each call but the usb microphone locks. That is, arecord -d 3 test.wav does not terminate until the usb something or other times out. Can anyone tell me what I am missing here?

stale[bot] commented 10 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

sandeepmistry commented 10 months ago

Hi @petercwallis,

I have not tried with arecord, would you be able to try with Audacity: https://www.hackster.io/sandeep-mistry/create-a-usb-microphone-with-the-raspberry-pi-pico-cc9bd5#toc-recording-audio-data-8

If that works aplay might need some additional parameters for set up the correct sample rate and bits.

stale[bot] commented 8 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.