Hello,
I am looking to record a short duration of sound and analyze the recorded queue for a particular frequency tone, and when it peaks in my recording. I am triggering the recording at the same time a tone is played from another teensy, and by processing the recorded queue I hope to determine the time elapsed based on which packet crosses the threshold.
From documentation I can see that about 53 packets in the queue give ~150ms of audio. So can conclude each 128 16bit packet is about ~3ms.
If I were to change AUDIO_BLOCK_SAMPLES to say 64, and also change the audio sampling rate to say 176khz, how would that affect the queue object and how many seconds of data each packet would contain. I'd like to estimate this if possible. The smaller the discretization the better for my use.
Also I think for copying over the queue contents to a buffer, the size of each packet would change if the Audio_block_samples are changed. Can someone confirm if my deduction is correct?
thanks!
-Akshay
I am looking to record a short duration of sound and analyze the recorded queue for a particular frequency tone, and when it peaks in my recording. I am triggering the recording at the same time a tone is played from another teensy, and by processing the recorded queue I hope to determine the time elapsed based on which packet crosses the threshold.
From documentation I can see that about 53 packets in the queue give ~150ms of audio. So can conclude each 128 16bit packet is about ~3ms.
If I were to change AUDIO_BLOCK_SAMPLES to say 64, and also change the audio sampling rate to say 176khz, how would that affect the queue object and how many seconds of data each packet would contain. I'd like to estimate this if possible. The smaller the discretization the better for my use.
Also I think for copying over the queue contents to a buffer, the size of each packet would change if the Audio_block_samples are changed. Can someone confirm if my deduction is correct?
Code:
memcpy(buffer_1+i*256, queue_r.readBuffer(),256);
thanks!
-Akshay