Ich habe jetzt mal etwas ausprobiert, und erhalte den naechsten Fehler:
Code: Alles auswählen
>>> import pyaudio
>>> p = pyaudio.PyAudio()
>>> p.get_device_count()
11
>>> p.get_default_input_device_info()
{'index': 0, 'defaultHighOutputLatency': 1.524449868310114e-314, 'maxOutputChannels': 0, 'name': '/dev/dsp', 'defaultHighInputLatency': 0.046439909297052155, 'defaultLowOutputLatency': -2.3308199784611311e-39, 'defaultLowInputLatency': 0.011609977324263039, 'maxInputChannels': 16, 'defaultSampleRate': 44100.0, 'structVersion': 2, 'hostApi': 0}
>>> stream = p.open(format=pyaudio.paInt16, channels=2, rate=44100, frames_per_buffer=1024, input=True, output=True, output_device_index=0, input_device_index=0)
Expression 'ValidateParameters( outputParameters, outputDeviceInfo, StreamMode_Out )' failed in 'src/hostapi/oss/pa_unix_oss.c', line: 1211
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/var/lib/python-support/python2.5/pyaudio.py", line 714, in open
stream = Stream(self, *args, **kwargs)
File "/var/lib/python-support/python2.5/pyaudio.py", line 396, in __init__
self._stream = pa.open(**arguments)
IOError: [Errno Invalid number of channels] -9998
]
Irgendwie verstehe ich hier nicht so richtig, warum das nicht funktioniert...
[size=117]Fuer Alle, die in Python einsteigen wollen, kann ich das Buch [url=http://abop-german.berlios.de/]A Byte of Python[/url] nur waermstens empfehlen![/size]