Skip to content

IOError: [Errno -9996] Invalid input device (no default output device) #1201

@titusece

Description

@titusece

In which file did you encounter the issue?

~python-docs-samples-master/speech/cloud-client/transcribe_streaming_mic.py

Did you change the file? If so, how?

Nope, I didn't change anything.

Describe the issue

Want to convert speech to text using the transcribe_streaming_mic.py python script. (I am able to run this script on one of my i.MX6 ARM board and able to convert to text successfully and used the same USB sound card)
Getting the following errors while running the MIC streaming issue.

source /env/bin/activate
export GOOGLE_APPLICATION_CREDENTIALS=/TESTxyz.json
python ~python-docs-samples-master/speech/cloud-client/transcribe_streaming_mic.py 
(env) root@apalis-imx6:/python-docs-samples/speech/cloud-client#
(env) root@apalis-imx6:/python-docs-samples/speech/cloud-client# python transcribe_streaming_mic.py
Traceback (most recent call last):
  File "transcribe_streaming_mic.py", line 193, in <module>
    main()
  File "transcribe_streaming_mic.py", line 181, in main
    with MicrophoneStream(RATE, CHUNK) as stream:
  File "transcribe_streaming_mic.py", line 67, in __enter__
    stream_callback=self._fill_buffer,
  File "/env/lib/python2.7/site-packages/pyaudio.py", line 750, in open
    stream = Stream(self, *args, **kwargs)
  File "/env/lib/python2.7/site-packages/pyaudio.py", line 441, in __init__
    self._stream = pa.open(**arguments)
IOError: [Errno -9996] Invalid input device (no default output device)
(env) root@apalis-imx6:/python-docs-samples/speech/cloud-client# 
(env) root@apalis-imx6:/python-docs-samples/speech/cloud-client#

And able to run other examples.

(env) root@root:/python-docs-samples-master/speech/cloud-client#
(env) root@root:/python-docs-samples-master/speech/cloud-client# python transcribe_streaming.py resources/audio.raw
Finished: True
Stability: 0.0
Confidence: 0.987628996372
Transcript: how old is the Brooklyn Bridge
(env) root@root:/python-docs-samples-master/speech/cloud-client#
(env) root@root:/python-docs-samples-master/speech/cloud-client#

BTW, I have connected USB sound card into my host.

(env) root@root:/python-docs-samples-master/speech/cloud-client# arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: U0x46d0x81b [USB Device 0x46d:0x81b], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
(env) root@root:/python-docs-samples-master/speech/cloud-client#
(env) root@root:/python-docs-samples-master/speech/cloud-client#

Can you please help to solve this issue ?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions