I have a signal in Python, and I want to hear it. This is possible?.
The data is in the format numpy.ndarray
.
In Matlab one can use the command sound(data,f)
.
I have a signal in Python, and I want to hear it. This is possible?.
The data is in the format numpy.ndarray
.
In Matlab one can use the command sound(data,f)
.
Yep! You can use scipy.io.wavfile library
import numpy as np
from scipy.io.wavfile import write
noise = np.random.uniform(-1,1,100000)
write('noise.wav', len(noise), noise)
You can use the module soundfile:
import soundfile as sf
sf.write(filename.wav, data, samplerate)
For further information read the documentation.