aha
aha

Reputation: 4624

wav file generated from NumPy not audible

I have a NumPy array that represents audio data (dtype is np.int16, me saying "one, two"):

audio data

Sampling rate is 100Hz. I saved this array into a wav file. However, the wav file is not audible from iTunes, VLC or Audacity. It's just silence. How I saved the array:

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

Is the sampling rate or amplitude too low? I normalized to -32767 to 32767 but still no sound. How the file looks in Audacity:

enter image description here

Upvotes: 0

Views: 897

Answers (1)

some
some

Reputation: 49592

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).

Upvotes: 2

Related Questions