Record Audio From Computer Speaker on [ Not from the microphone

Free Python Code - Aug 20 '23 - - Dev Community

step 1

install sounddevice pip install sounddevice

step 2

Go to sound device setting and Enable Stereo Mix

Image description

step 3


import sounddevice as sd
from scipy.io import wavfile

sd.default.device[0] = 0

def record():
    duration = 10
    frames = 44100
    rec = sd.rec((frames * frames), samplerate = frames, blocking=True, channels=1)
    wavfile.write('test.wav', frames, rec)


record()


Enter fullscreen mode Exit fullscreen mode

Now we're done 🤗

Don't forget to like and follow 🙂

Support me on PayPal 🤗
https://www.paypal.com/paypalme/amr396

Source: https://www.tutorialexample.com/python-record-audio-from-computer-speaker-on-win-10-python-tutorial/

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .