Closed DanielTizon closed 5 years ago
The samplerate is the number of samples captured per second, so calculating the length in seconds of a mono (1 channel) buffer can be done like this: var bufferLengthInSeconds = 1 / (sampleRate / bufferSize);
Thanks @edimuj
So if I am using a sampleRate=audioinput.SAMPLERATE.CD_AUDIO_44100Hz, and I use bufferSize=44100, then events with raw audio will be fired every second?
Yes, theoretically but the actual buffersize of each buffer can sadly vary during execution and it is not possible to set it to whatever you want depending on the device the app executes on (I've have had some problems above 16384 on some devices), so I would rather queue up buffers and then consume them until you get 44100 samples for one second or 88200 for two seconds etc.
Since there haven't been any activity for a while, I'm closing down this issue.
Hi, I would like to know if it is possible to get raw signal every two seconds. I am a bit confusing about how is it related with bufferSize option, and how I could to get a raw signal that represents two seconds of audio.