You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for sharing this great package! I am currently trying to read data from the microphone every x seconds using the code below, where I just try to print out the length of the buffer obtained from the microphone:
When I try to run the above file, it prints out 16384 for the length of the buffer every 1 second. This seems about right, since audio sampled every second at 8000 samples per second with a sampling format of 16 (2 bytes) will be about 16,000 bytes. So far so good.
However, when I try to set the interval at the beginning of the code to, say, 5, I still get the same buffer length of 16384 printed out. This shouldn't be right. According to the NodeJS documentation on read(), read() should read everything that's in the readable stream. But this is not happening in this case.
Let me know if I'm missing something, or if this is a possible bug. I also looked at the resulting audio file when I parse and save the results of the buffer to a WAV file, and I only get 1 second worth of audio for every call to read() even if I make that call to read() every 5 seconds.
Thanks in advance for your help!
The text was updated successfully, but these errors were encountered:
Thanks for sharing this great package! I am currently trying to read data from the microphone every x seconds using the code below, where I just try to print out the length of the buffer obtained from the microphone:
When I try to run the above file, it prints out
16384
for the length of the buffer every 1 second. This seems about right, since audio sampled every second at 8000 samples per second with a sampling format of 16 (2 bytes) will be about 16,000 bytes. So far so good.However, when I try to set the interval at the beginning of the code to, say, 5, I still get the same buffer length of
16384
printed out. This shouldn't be right. According to the NodeJS documentation on read(),read()
should read everything that's in the readable stream. But this is not happening in this case.Let me know if I'm missing something, or if this is a possible bug. I also looked at the resulting audio file when I parse and save the results of the buffer to a WAV file, and I only get 1 second worth of audio for every call to
read()
even if I make that call toread()
every 5 seconds.Thanks in advance for your help!
The text was updated successfully, but these errors were encountered: