0
votes

I have a numpy array that represents audio data(dtype is np.int16). Here is a plot of the audio data(me saying "one, two"): audio data

the sampling rate is 100HZ. I saved this array into a wav file. However, the wav file is not audible from other music players(iTunes, vlc, Audacity etc). It's just complete silence.

Here is how I saved the array:

scipy.io.wavfile.write('output.wav',100,waveform) # 'waveform' is the numpy array

I am wondering what could the cause be ?

  • sampling rate too low?
  • amplitude not enough ? i tried to normalize to -32767 to 32767, but still no sound

Any help is appreciated

PS:

This is how the file looks in Audacity(I'm not very familiar with this software): enter image description here

1
100hz? That'd mean your Nyquist frequency is 50hz. Unless you're Barry White or James Earl Jones, you voice probably doesn't down far enough for that.Marc B
100Hz? Tooooo low. You only get 0-50Hz audio from that. Increase it to 8000Hz to get "phone quality" and 22100Hz for speech, and 44100 for "cd quality".some
thanks! right now the data stream is coming from Arduino. I am having a few issues increasing the sampling rate. I'll try to fix it and see if I can get an audible result.aha

1 Answers

2
votes

With a sampling frequency of 100Hz the highest audible frequency you get is 50Hz.

The range of human hearing is from about 20 to about 20000Hz.

For "telephone quality" you need 8000Hz and for "cd quality" you need 44100Hz (that is the standard sampling frequency for consumer audio).