respeaker / respeaker_python_library

To build voice enabled objects/applications with Python and ReSpeaker
Apache License 2.0
149 stars 74 forks source link

To select default device when respeaker device is not available. #12

Closed baali closed 7 years ago

baali commented 7 years ago

When using independently the if condition:

if name.lower().find(b'respeaker') >= 0 and dev['maxInputChannels'] > 0:

Never satisfies and device_index doesn't get set. Later logic continues to create a stream object using None as device index, instead setting it to default device returned from pyaudio_instance.get_default_input_device_info() to handle things correctly.

xiongyihui commented 7 years ago

Merged, thanks!