Running pushtotalk without mic
I am trying to get the googlesamples-asisstant-pushtotalk project working but without using a mic. I just want to be able to type to it, not use a mic anyway.
I did everything I needed to except for the mic part and am getting this error:
INFO:root:Connecting to embeddedassistant.googleapis.com Traceback (most recent call last): File "/home/pi/env/bin/googlesamples-assistant-pushtotalk", line 10, in
sys.exit(main()) File "/home/pi/env/lib/python3.5/site-packages/click/core.py", line 722, in call return self.main(*args, **kwargs) File "/home/pi/env/lib/python3.5/site-packages/click/core.py", line 697, in main rv = self.invoke(ctx) File "/home/pi/env/lib/python3.5/site-packages/click/core.py", line 895, in invoke return ctx.invoke(self.callback, **ctx.params) File "/home/pi/env/lib/python3.5/site-packages/click/core.py", line 535, in invoke return callback(*args, **kwargs) File "/home/pi/env/lib/python3.5/site-packages/googlesamples/assistant/grpc/pushtotalk.py", line 351, in main flush_size=audio_flush_size File "/home/pi/env/lib/python3.5/site-packages/googlesamples/assistant/grpc/audio_helpers.py", line 190, in init blocksize=int(block_size/2), # blocksize is in number of frames. File "/home/pi/env/lib/python3.5/site-packages/sounddevice.py", line 1264, in init **_remove_self(locals())) File "/home/pi/env/lib/python3.5/site-packages/sounddevice.py", line 681, in init samplerate) File "/home/pi/env/lib/python3.5/site-packages/sounddevice.py", line 2490, in _get_stream_parameters info = query_devices(device) File "/home/pi/env/lib/python3.5/site-packages/sounddevice.py", line 488, in query_devices raise PortAudioError('Error querying device {0}'.format(device)) sounddevice.PortAudioError: Error querying device -1
Does anyone have any experience making the code run without using the mic?
If you don't want to use the mic, you can use the textinput.py sample.
Hi @Fleker , Is there any way to send text input and get a voice response from Google Assistant when connected to Raspberry Pi. I have speakers connected to Raspberry Pi but do not have the mic. I need to send the text input as we give in textinput.py and get a voice response from Google Assistant instead of the text output. Thanks.
Check textinput.py for how to use text input.
Hi @Fleker , Thanks for your response. textinput.py is working fine for both text input and text output from Google Assistant. But when I try to use features of both textinput.py and pushtotalk.py for sending text input and getting voice response from Google Assistant, I'm unable to do that. I can see this error : "Getting error: sounddevice.PortAudioError: Error querying device -1 ". (Even oushtotalk.py is getting the same error.) I think this is because I do not have a mic connected to the raspberry pi. Is it mandatory to have the mic connected to raspberry pi, even if I use text input and get voice output? I have speakers connected to the raspberry pi, but I do not have a mic connected to the raspberry pi. I am trying to send text input and trying to get a voice response. Thanks.
You may need to take a look at both textinput for getting the input, and pushtotalk for processing the output audio response that you get.