audio - Reading soundcard output with python -
audio - Reading soundcard output with python -
i have succesfully utilized pyaudio read , record microphone data. same soundcard output. (i.e. playing wavfile , open stream pyaudio , read frame frame soundcard output).
for reading mic opened pyaudio stream following
stream = pyaud.open( format = pyaudio.paint16, channels = 1, rate = 22050, input_device_index = 0, input = true)
when alter input_device_index 1 next error
ioerror: [errno invalid number of channels] -9998
below system_info macbook soundcard
default devices: ================ default input device : 0 defaultsamplerate: 44100.0 defaultlowoutputlatency: 0.01 defaultlowinputlatency: 0.00199546485261 maxinputchannels: 2 structversion: 2 hostapi: 0 (core audio) index: 0 defaulthighoutputlatency: 0.1 maxoutputchannels: 0 name: built-in microph defaulthighinputlatency: 0.0121541950113 -------------------------------- default output device: 1 defaultsamplerate: 44100.0 defaultlowoutputlatency: 0.00655328798186 defaultlowinputlatency: 0.01 maxinputchannels: 0 structversion: 2 hostapi: 0 (core audio) index: 1 defaulthighoutputlatency: 0.0167120181406 maxoutputchannels: 2 name: built-in output defaulthighinputlatency: 0.1 --------------------------------
any help much appreciated!!
p.
some soundcards have 'capture' channels, output of soundcard. may or may not work correctly (there seems have been pressure level music industry eliminate ports).
the next linux... eg. on system, have standard, on-board alc887 sound port. in /proc/asound/card0, find port pcm2c, has next info:
card: 0 device: 2 subdevice: 0 stream: capture id: alc887-vd alt analog name: alc887-vd alt analog subname: subdevice #0 class: 0 subclass: 0 subdevices_count: 1 subdevices_avail: 1
these capture devices should show in sound mixer.
python audio stream pyaudio soundcard
Comments
Post a Comment