soundmeter
soundmeter copied to clipboard
python---IOError: No Default Input Device Available
~# python -m speech_recognition
ALSA lib pcm_dsnoop.c:638:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1099:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_dsnoop.c:638:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1099:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm_dmix.c:1099:(snd_pcm_dmix_open) unable to open slave
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"main", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/local/lib/python2.7/dist-packages/speech_recognition/main.py", line 4, in
what to do ?anyone can fix this
You can try to find your input device index, and set input_device_index
in the config. See #7 for more details
You can try to find your input device index, and set
input_device_index
in the config. See #7 for more details
the input_device_index wont work because there are no input devices
hi programmers I have also the same issue in my google colab, -This is the full error-??
OSError Traceback (most recent call last)
2 frames /usr/local/lib/python3.6/dist-packages/pyaudio.py in get_default_input_device_info(self) 947 """ 948 --> 949 device_index = pa.get_default_input_device() 950 return self.get_device_info_by_index(device_index) 951
OSError: No Default Input Device Available
how can I solve this error in colab
((----- :( I think I need to set input device and give permission to access it !
Can any one please help me!!
Hi I am facing the same issue. Did it work ? If so please post a solution
Hi @savitha91, please tell me are you running your program in or you system or if you are running your program in online environment such as Google Collab or in kaggle kernal etc.
Hi @savitha91, please tell me are you running your program in or you system or if you are running your program in online environment such as Google Collab or in kaggle kernal etc.
hi, i'm using google collab and how can i access my microphone using speech recognition from collab
hi programmers I have also the same issue in my google colab,
-This is the full error-?? OSError Traceback (most recent call last) in () ----> 1 from speech_recognition import main
2 frames /usr/local/lib/python3.6/dist-packages/pyaudio.py in get_default_input_device_info(self) 947 """ 948 --> 949 device_index = pa.get_default_input_device() 950 return self.get_device_info_by_index(device_index) 951
OSError: No Default Input Device Available
how can I solve this error in colab
((----- :( I think I need to set input device and give permission to access it !
Can any one please help me!!
even i have the same problem can anybody fix this
I found this piece of code exclusive to use local microphone via colab. Although I can't seem to extract the audio file without saving for my speech to text requirement.
`#in colab
!pip install ffmpeg-python import ffmpeg from IPython.display import HTML, Audio from google.colab.output import eval_js from base64 import b64decode import numpy as np from scipy.io.wavfile import read as wav_read import io
AUDIO_HTML = """
"""
def get_audio(): display(HTML(AUDIO_HTML)) data = eval_js("data") binary = b64decode(data.split(',')[1])
process = (ffmpeg .input('pipe:0') .output('pipe:1', format='wav') .run_async(pipe_stdin=True, pipe_stdout=True, pipe_stderr=True, quiet=True, overwrite_output=True) ) output, err = process.communicate(input=binary)
riff_chunk_size = len(output) - 8
Break up the chunk size into four bytes, held in b.
q = riff_chunk_size b = [] for i in range(4): q, r = divmod(q, 256) b.append(r)
Replace bytes 4:8 in proc.stdout with the actual size of the RIFF chunk.
riff = output[:4] + bytes(b) + output[8:]
sr, audio = wav_read(io.BytesIO(riff))
return audio, sr, riff
audio, sr, riff = get_audio()`