Respekaer launch file not working

I am trying to get some speech to text output from the respeaker package that comes within the catking ws that is installed via hello-robot shell file. But I am getting the following error when I talk to the microphone:

hello-robot@stretch-re2-2014:>catkin_ws$ roslaunch respeaker_ros respeaker.launch 
... logging to /home/hello-robot/.ros/log/613e11f4-6f69-11ee-932d-c915c5b5e8ce/roslaunch-stretch-re2-2014-29129.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server


 * /rosdistro: noetic
 * /rosversion: 1.15.15
 * /speech_to_text/language: $(arg language)
 * /speech_to_text/self_cancellation: $(arg self_cancel...
 * /speech_to_text/tts_tolerance: 0.5

    respeaker_node (respeaker_ros/
    sound_play (sound_play/
    speech_to_text (respeaker_ros/
    static_transformer (tf/static_transform_publisher)

auto-starting new master
process[master]: started with pid [29144]

setting /run_id to 613e11f4-6f69-11ee-932d-c915c5b5e8ce
process[rosout-1]: started with pid [29161]
started core service [/rosout]
process[static_transformer-2]: started with pid [29164]
process[respeaker_node-3]: started with pid [29169]
process[sound_play-4]: started with pid [29170]
process[speech_to_text-5]: started with pid [29176]
/opt/ros/noetic/lib/sound_play/ PyGIDeprecationWarning: Since version 3.11, calling threads_init is no longer needed. See:
/opt/ros/noetic/lib/sound_play/ PyGIDeprecationWarning: GObject.MainLoop is deprecated; use GLib.MainLoop instead
  self.g_loop = threading.Thread(target=GObject.MainLoop().run)
[INFO] [1697820890.651790]: Initializing Respeaker device (takes 10 seconds)
[INFO] [1697820901.090814]: Respeaker device initialized (Version: 16)
[WARN] [1697820901.506349]: Failed to find respeaker device by name. Using default input
[WARN] [1697820901.507423]: 32 channel is found for respeaker
[WARN] [1697820901.508421]: You may have to update firmware.
[INFO] [1697820901.509473]: Using channels range(0, 32)
[INFO] [1697820905.573201]: Speech detected for 3.944 seconds
[ERROR] [1697820905.603939]: bad callback: <bound method SpeechToText.audio_cb of <__main__.SpeechToText object at 0x7f071190e130>>
Traceback (most recent call last):
  File "/opt/ros/noetic/lib/python3/dist-packages/rospy/", line 750, in _invoke_callback
  File "/home/hello-robot/catkin_ws_tony/src/respeaker_ros/scripts/", line 73, in audio_cb
    result, confidence = self.recognizer.recognize_google(
TypeError: recognize_google() got an unexpected keyword argument 'with_confidence'

I also tried to run the command and it seems to work. However, the launch file command that is mentioned in the resepaker tutorial on the hello robot documentation isn’t in the respeaker folder anymore. That’s why I am running a different one.

From looking at the respeaker_ros github repo, it uses the SpeechRecogntion package. recognize_google() is defined here in that package’s github repo. It looks like with_confidence is included as an argument on the github repo, so maybe your SpeechRecognition package is out of date? Alternatively, you could patch the respeaker_ros script to not include that argument.


Hey @lamsey ,

Thanks, I patched the issue by removing the with_confidence argument. However, I recall setting up an other robot to work with this package as well and it could return confidence values. Not sure what’s the problem since the package is up to date. I’ll have to check my other robot and see what’s the difference. Anyways, it is working right now, thanks for the help!

1 Like