sound library test
This commit is contained in:
9
src/record_sound.py
Normal file
9
src/record_sound.py
Normal file
@@ -0,0 +1,9 @@
|
||||
import sounddevice as sd
|
||||
from scipy.io.wavfile import write
|
||||
|
||||
fs = 44100 # Sample rate
|
||||
seconds = 3 # Duration of recording
|
||||
|
||||
myrecording = sd.rec(int(seconds * fs), samplerate=fs, channels=2)
|
||||
sd.wait() # Wait until recording is finished
|
||||
write('output.wav', fs, myrecording) # Save as WAV file
|
||||
Reference in New Issue
Block a user