import sounddevice as sd
from scipy.io.wavfile import write

fs = 44100  # Sample rate
seconds = 7 # Duration of recording

myrecording = sd.rec(int(seconds * fs), samplerate=fs, channels=2)
sd.wait()  # Wait until recording is finished
write('aksh.wav', fs, myrecording)  # Save as WAV file

021e2ad048afbbeda441547b50012ef8b21c3da1
<mask token>

<mask token>
sd.wait()
write('aksh.wav', fs, myrecording)

<mask token>
fs = 44100
seconds = 7
myrecording = sd.rec(int(seconds * fs), samplerate=fs, channels=2)
sd.wait()
write('aksh.wav', fs, myrecording)

import sounddevice as sd
from scipy.io.wavfile import write
fs = 44100
seconds = 7
myrecording = sd.rec(int(seconds * fs), samplerate=fs, channels=2)
sd.wait()
write('aksh.wav', fs, myrecording)

import sounddevice as sd
from scipy.io.wavfile import write

fs = 44100  # Sample rate
seconds = 7 # Duration of recording

myrecording = sd.rec(int(seconds * fs), samplerate=fs, channels=2)
sd.wait()  # Wait until recording is finished
write('aksh.wav', fs, myrecording)  # Save as WAV file
