Playing .wav file through Bonsai distorts its spectral content to lower frequencies #2369
Replies: 1 comment 4 replies
-
|
Hi @m-lockwood I don't have much experience with audio applications, but I was able to reproduce this issue with another set of 48kHz and higher frequency sound files from https://www.audiocheck.net/ and I think this might be the problem you are having https://www.audiocheck.net/audiotests_aliasing.php. The sounds played fine in the browser but not in Bonsai. Unfortunately I do not know how to solve it, but I did notice that when I converted your file to 44.1kHz they played fine in Bonsai (I wasn't able to accurately measure the spectral response beyond 20kHz though as that is what my iPhone microphone is capped at). Since it is within the Nyquist frequency for your white noise, if you try regenerating your file in Matlab with that sampling frequency, will that work for you in the meantime? I will raise an issue separately on the Bonsai core repo for further investigation (or to see if someone knows what is going on or how to resolve it). I only tested with these nodes: In In |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm trying to play an audio .wav file of white noise filtered between 16-22kHz (generated using MATLAB's audiowrite function). The sampling frequency I specified in MATLAB is 48kHz, which matches the sampling rate of the sound card in the PC from which I am playing the sound. When I play the sound through windows media player the spectral content is as 16-22kHz expected, however when I play the sound through Bonsai using the following test code, the sound is distorted to lower frequencies:

I initially tried setting the sampling rate of the audio reader and audio playback nodes to 48kHz, and the buffer length to 10, and the sound was audibly distorted to lower frequencies. Since then I've tried playing with the parameters: Changing the buffer length made no difference unless I set it to 0 (then no sound comes out). Changing the sampling frequencies of the audio reader and audio playback nodes didn't make any difference unless I decrease them below 40kHz, then they are audibly lower as you would expect.
Does anyone know what could be causing this issue?
I will attach the test workflow and the audio file which I'm trying to play here in case it's helpful:
Test sound.zip
Beta Was this translation helpful? Give feedback.
All reactions