|
ros_speech_recognition package from jsk_3rdparty repovoicevox chaplus_ros emotion_analyzer gdrive_ros google_chat_ros influxdb_store jsk_power_switching_tools respeaker_ros ros_speech_recognition rospatlite sesame_ros switchbot_ros |
ROS Distro
|
Package Summary
| Version | 3.0.1 |
| License | BSD-3-Clause |
| Build type | CATKIN |
| Use | RECOMMENDED |
Repository Summary
| Description | |
| Checkout URI | https://github.com/jsk-ros-pkg/jsk_3rdparty.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2026-11-13 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Yuki Furuta
Authors
- Yuki Furuta
ros_speech_recognition
A ROS package for speech-to-text services.
This package uses Python package SpeechRecognition as a backend.
Tutorials
Normal tutorial
- Install this package and SpeechReconition
sudo apt install ros-${ROS_DISTRO}-ros-speech-recognition
- Launch speech recognition node
roslaunch ros_speech_recognition speech_recognition.launch
- Echo
/speech_to_text
rostopic echo /speech_to_text
# you can get the recognition result
Parrotry tutorial
Parrotry mean オウム返し in Japanese
# english
roslaunch ros_speech_recognition parrotry.launch
# japanese
roslaunch ros_speech_recognition parrotry.launch language:=ja-JP
ROS2
The same nodes run on ROS2 (built with colcon; SpeechRecognition and vosk
are installed into a venv of this package with uv at build time).
The dynamic reconfigure parameters (see Parameters) are ROS2
parameters, e.g. ros2 param set /speech_recognition language ja-JP.
The vosk models are downloaded into the installed share directory by
colcon build (with jsk_data, as on ROS1).
ros2 launch ros_speech_recognition speech_recognition.launch.xml
ros2 topic echo /speech_to_text
# parrotry (julius and aques_talk are not available, use engine:=... and sound_play)
ros2 launch ros_speech_recognition parrotry.launch.xml
Streaming recognition with Google Cloud (GoogleCloudStream)
In addition to the request/response GoogleCloud engine, a streaming engine
GoogleCloudStream is available. It uses the bidirectional gRPC
StreamingRecognize API and publishes interim hypotheses on
~voice_interim_topic while the user is still speaking, then publishes the
finalised utterance on ~voice_topic as usual.
roslaunch ros_speech_recognition speech_recognition.launch \
engine:=GoogleCloudStream \
language:=ja-JP \
google_cloud_credentials_json:=/path/to/credentials.json
Notes:
- Endpointing combines Google’s own
is_finalflag with a stability timer controlled by~google_cloud_endpoint_stable_s(default: 1.0 s). - The gRPC session has a 305 s server-side limit; the recognizer reconnects lazily on the next audio chunk, so long-running nodes are safe.
- When
~self_cancellationis enabled, the streaming session is torn down while a~tts_action_namesaction is active and reopened automatically afterwards to avoid recognising the robot’s own voice.
Example:
The following is an example of speech recognition using GoogleCloudStream.
Interim: shows intermediate recognition results, while Result: shows the final recognition result after the speaker finishes speaking.
```bash [INFO] [1792069200.711352]: Interim: こんにちは。 [INFO] [1792069201.701424]: Result: こんにちは。 [INFO] [1792069218.021376]: Interim: 今日? [INFO] [1792069218.196229]: Interim: 今日は! [INFO] [1792069218.621582]: Interim: 今日はいい? [INFO] [1792069218.710931]: Interim: 今日はいい天気。 [INFO] [1792069219.011066]: Interim: 今日はいい天気です。 [INFO] [1792069219.221464]: Interim: 今日はいい天気ですね。 [INFO] [1792069219.911446]: Interim: 今日はいい天気ですね。外 [INFO] [1792069220.090884]: Interim: 今日はいい天気ですね。外で。 [INFO] [1792069220.211304]: Interim: 今日はいい天気ですね。外で遊び。 [INFO] [1792069220.510955]: Interim: 今日はいい天気ですね。外で遊びませ。 [INFO] [1792069220.595351]: Interim: 今日はいい天気ですね。外で遊びません。 [INFO] [1792069220.814139]: Interim: 今日はいい天気ですね。外で遊びませんか?
File truncated at 100 lines see the full file
Changelog for package ros_speech_recognition
3.0.1 (2026-11-10)
- Merge pull request #583 from k-okada/rosdistro-55247-review rosdistro#55247 review: rename power_switching_tools_ros to jsk_power_switching_tools, fix licenses
- use SPDX license identifiers (BSD-3-Clause, Apache-2.0) in package.xml BSD -> BSD-3-Clause and Apache / "Apache License, Version 2.0" -> Apache-2.0 in all packages (ros/rosdistro#55247 review). The LICENSE files of all of them are BSD 3-Clause and Apache 2.0 respectively. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
- Contributors: Kei Okada
3.0.0 (2026-11-06)
-
Merge pull request #581 from k-okada/ros2-buildfarm-ros-environment Fix ROS2 buildfarm binary jobs: ros_environment, bundled flac, numpy wheel
-
[ros_speech_recognition, respeaker_ros] remove flac binaries bundled with SpeechRecognition from the uv venv The 32bit flac-linux-x86 fails dh_shlibdeps of the buildfarm binary job. SpeechRecognition uses the flac in PATH first, which is an exec_depend. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
[voicevox, chaplus_ros, emotion_analyzer, gdrive_ros, google_chat_ros, influxdb_store, power_switching_tools_ros, respeaker_ros, ros_speech_recognition, rospatlite, sesame_ros, switchbot_ros] depend on ros_environment for ROS2 buildfarm The buildfarm builds each package with only its own build dependencies, so without ros_environment $ROS_VERSION is empty and CMakeLists.txt takes the ROS1 branch (same as jsk_common#1835). voicevox also guesses ROS_VERSION from AMENT_PREFIX_PATH when it is unset. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
Merge pull request #580 from k-okada/ros2-google-cloud-stream [ros_speech_recognition] add GoogleCloudStream engine (ROS1/ROS2, rebase of #572)
-
[ros_speech_recognition] use google-cloud-speech for GoogleCloud engine The GoogleCloud engine used google-api-python-client and oauth2client, which are not declared as dependencies. When they are installed in the venv, oauth2client imports the system pyOpenSSL, which does not work with the cryptography installed by google-auth (AttributeError: module 'lib' has no attribute 'GEN_EMAIL'). Send the request with google-cloud-speech, already a dependency of the GoogleCloudStream engine. The config is still built as the REST JSON dict, so user_config (e.g. diarizationConfig) works as before, and show_all returns the same JSON dict. google-api-python-client is kept for python < 3.7, where google-cloud-speech is not available. Also send preferred_phrases as speechContexts (speechContext is not a field of RecognitionConfig), and remove a debug print.
-
[ros_speech_recognition] report GoogleCloudStream stream errors instead of ignoring them Errors of the gRPC stream were swallowed by [except Exception: pass]{.title-ref}, so an invalid credential or a disabled API looked like nothing was recognized.
- errors that reconnecting cannot fix (Unauthenticated, PermissionDenied, InvalidArgument, NotFound) are logged once with logerr and stop the streaming loop, instead of reconnecting on every audio chunk
- other errors (305s session limit, network) are logged with logwarn and the stream reconnects as before
- streams closed by stop_stream() (e.g. self cancellation) are not logged
-
[ros_speech_recognition] import numpy only for GoogleCloudStream engine python3 venv on kinetic/melodic can not see python-numpy (python2), and the engine is not available there anyway. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
[ros_speech_recognition] add google-cloud-speech and numpy dependencies google-cloud-speech requires python >= 3.7, so skip it on kinetic/melodic python3 venv with a pip environment marker, and add it to pyproject.toml/uv.lock for ROS2. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
[ros_speech_recognition] support GoogleCloudStream engine on both ROS1 and ROS2 use ros_compat instead of rospy, import GoogleCloudStreamingRecognizer only when the engine is selected (google-cloud-speech is not available on python2), add GoogleCloudStream to cfg/ros2 and utf-8 coding header. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
add speech_recognition samples using GoogleCloudStream for README.md (#13)
-
[ros_speech_recognition] log interim transcripts for GoogleCloudStream
-
[ros_speech_recognition] add GoogleCloudStream engine for streaming recognition Wrap google-cloud-speech v1 StreamingRecognize so the node can emit interim transcripts on ~voice_interim_topic while still publishing the finalised utterance on ~voice_topic.
File truncated at 100 lines see the full file
Package Dependencies
System Dependencies
Dependant Packages
Launch files
- launch/parrotry.launch
-
- use_google [default: true]
- language [default: en-US]
- confidence_threshold [default: 0.8]
- launch/speech_recognition.launch
-
- launch_sound_play [default: true] — Launch sound_play node to speak
- launch_audio_capture [default: true] — Launch audio_capture node to publish audio topic from microphone
- audio_topic [default: /audio] — Name of audio topic captured from microphone
- voice_topic [default: /speech_to_text] — Name of text topic of recognized speech
- n_channel [default: 1] — Number of channels of audio topic and microphone. '$ pactl list short sinks' to check your hardware
- depth [default: 16] — Bit depth of audio topic and microphone. '$ pactl list short sinks' to check your hardware
- sample_rate [default: 16000] — Frame rate of audio topic and microphone. '$ pactl list short sinks' to check your hardware
- device [default: ] — Card and device number of microphone (e.g. hw:0,0). you can check card number and device number by '$ arecord -l', then uses hw:[card number],[device number]
- engine [default: Google] — Speech to text engine. TTS engine, Google, GoogleCloud, Sphinx, Wit, Bing Houndify, IBM
- language [default: en-US] — Speech to text language. For Japanese, set ja-JP.
- continuous [default: true] — If false, /speech_recognition service is published. If true, /speech_to_text topic is published.
- auto_start [default: true] — Whether speech_recognition starts automatically or not. This parameter works when continuous is true
- energy_threshold [default: 300.0] — Minimum audio energy to consider for recording speech. Raise it if noise is taken for speech, lower it if quiet speech is missed
- dynamic_energy_threshold [default: true] — Raise energy_threshold automatically to follow the background noise. Set false to keep energy_threshold fixed, e.g. when the noise lifts it above normal speech
- self_cancellation [default: true] — Do not recognize the audio when robot is speaking or not.
- tts_tolerance [default: 1.0] — Tolerance second for recognizing whether robot is speaking or not
- tts_action_names [default: ['sound_play']] — tts action name. these servers outputs are ignored by sound_recognition
- launch/parrotry.launch.xml
- ROS2 version of parrotry.launch (based on Michi-Tsubaki's ROS2 port of this package). julius_ros and aques_talk (use_google:=false and ja-JP in parrotry.launch) have no ROS2 port, so the speech engine is given by engine and the voice comes from sound_play.
-
- engine [default: Google]
- language [default: en-US]
- confidence_threshold [default: 0.8]
- tts_action_name [default: sound_play]
- launch/speech_recognition.launch.xml
- ROS2 version of speech_recognition.launch (based on Michi-Tsubaki's ROS2 port of this package)
-
- launch_sound_play [default: true]
- launch_audio_capture [default: true]
- audio_topic [default: /audio]
- voice_topic [default: /speech_to_text]
- n_channel [default: 1]
- depth [default: 16]
- sample_rate [default: 16000]
- device [default: ]
- engine [default: Google]
- language [default: en-US]
- continuous [default: true]
- auto_start [default: true]
- energy_threshold [default: 300.0]
- dynamic_energy_threshold [default: true]
- self_cancellation [default: true]
- tts_tolerance [default: 1.0]
- tts_action_names [default: ['sound_play']]
Messages
Services
Plugins
Recent questions tagged ros_speech_recognition at Robotics Stack Exchange
|
ros_speech_recognition package from jsk_3rdparty repovoicevox chaplus_ros emotion_analyzer gdrive_ros google_chat_ros influxdb_store jsk_power_switching_tools respeaker_ros ros_speech_recognition rospatlite sesame_ros switchbot_ros |
ROS Distro
|
Package Summary
| Version | 3.0.1 |
| License | BSD-3-Clause |
| Build type | CATKIN |
| Use | RECOMMENDED |
Repository Summary
| Description | |
| Checkout URI | https://github.com/jsk-ros-pkg/jsk_3rdparty.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2026-11-13 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Yuki Furuta
Authors
- Yuki Furuta
ros_speech_recognition
A ROS package for speech-to-text services.
This package uses Python package SpeechRecognition as a backend.
Tutorials
Normal tutorial
- Install this package and SpeechReconition
sudo apt install ros-${ROS_DISTRO}-ros-speech-recognition
- Launch speech recognition node
roslaunch ros_speech_recognition speech_recognition.launch
- Echo
/speech_to_text
rostopic echo /speech_to_text
# you can get the recognition result
Parrotry tutorial
Parrotry mean オウム返し in Japanese
# english
roslaunch ros_speech_recognition parrotry.launch
# japanese
roslaunch ros_speech_recognition parrotry.launch language:=ja-JP
ROS2
The same nodes run on ROS2 (built with colcon; SpeechRecognition and vosk
are installed into a venv of this package with uv at build time).
The dynamic reconfigure parameters (see Parameters) are ROS2
parameters, e.g. ros2 param set /speech_recognition language ja-JP.
The vosk models are downloaded into the installed share directory by
colcon build (with jsk_data, as on ROS1).
ros2 launch ros_speech_recognition speech_recognition.launch.xml
ros2 topic echo /speech_to_text
# parrotry (julius and aques_talk are not available, use engine:=... and sound_play)
ros2 launch ros_speech_recognition parrotry.launch.xml
Streaming recognition with Google Cloud (GoogleCloudStream)
In addition to the request/response GoogleCloud engine, a streaming engine
GoogleCloudStream is available. It uses the bidirectional gRPC
StreamingRecognize API and publishes interim hypotheses on
~voice_interim_topic while the user is still speaking, then publishes the
finalised utterance on ~voice_topic as usual.
roslaunch ros_speech_recognition speech_recognition.launch \
engine:=GoogleCloudStream \
language:=ja-JP \
google_cloud_credentials_json:=/path/to/credentials.json
Notes:
- Endpointing combines Google’s own
is_finalflag with a stability timer controlled by~google_cloud_endpoint_stable_s(default: 1.0 s). - The gRPC session has a 305 s server-side limit; the recognizer reconnects lazily on the next audio chunk, so long-running nodes are safe.
- When
~self_cancellationis enabled, the streaming session is torn down while a~tts_action_namesaction is active and reopened automatically afterwards to avoid recognising the robot’s own voice.
Example:
The following is an example of speech recognition using GoogleCloudStream.
Interim: shows intermediate recognition results, while Result: shows the final recognition result after the speaker finishes speaking.
```bash [INFO] [1792069200.711352]: Interim: こんにちは。 [INFO] [1792069201.701424]: Result: こんにちは。 [INFO] [1792069218.021376]: Interim: 今日? [INFO] [1792069218.196229]: Interim: 今日は! [INFO] [1792069218.621582]: Interim: 今日はいい? [INFO] [1792069218.710931]: Interim: 今日はいい天気。 [INFO] [1792069219.011066]: Interim: 今日はいい天気です。 [INFO] [1792069219.221464]: Interim: 今日はいい天気ですね。 [INFO] [1792069219.911446]: Interim: 今日はいい天気ですね。外 [INFO] [1792069220.090884]: Interim: 今日はいい天気ですね。外で。 [INFO] [1792069220.211304]: Interim: 今日はいい天気ですね。外で遊び。 [INFO] [1792069220.510955]: Interim: 今日はいい天気ですね。外で遊びませ。 [INFO] [1792069220.595351]: Interim: 今日はいい天気ですね。外で遊びません。 [INFO] [1792069220.814139]: Interim: 今日はいい天気ですね。外で遊びませんか?
File truncated at 100 lines see the full file
Changelog for package ros_speech_recognition
3.0.1 (2026-11-10)
- Merge pull request #583 from k-okada/rosdistro-55247-review rosdistro#55247 review: rename power_switching_tools_ros to jsk_power_switching_tools, fix licenses
- use SPDX license identifiers (BSD-3-Clause, Apache-2.0) in package.xml BSD -> BSD-3-Clause and Apache / "Apache License, Version 2.0" -> Apache-2.0 in all packages (ros/rosdistro#55247 review). The LICENSE files of all of them are BSD 3-Clause and Apache 2.0 respectively. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
- Contributors: Kei Okada
3.0.0 (2026-11-06)
-
Merge pull request #581 from k-okada/ros2-buildfarm-ros-environment Fix ROS2 buildfarm binary jobs: ros_environment, bundled flac, numpy wheel
-
[ros_speech_recognition, respeaker_ros] remove flac binaries bundled with SpeechRecognition from the uv venv The 32bit flac-linux-x86 fails dh_shlibdeps of the buildfarm binary job. SpeechRecognition uses the flac in PATH first, which is an exec_depend. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
[voicevox, chaplus_ros, emotion_analyzer, gdrive_ros, google_chat_ros, influxdb_store, power_switching_tools_ros, respeaker_ros, ros_speech_recognition, rospatlite, sesame_ros, switchbot_ros] depend on ros_environment for ROS2 buildfarm The buildfarm builds each package with only its own build dependencies, so without ros_environment $ROS_VERSION is empty and CMakeLists.txt takes the ROS1 branch (same as jsk_common#1835). voicevox also guesses ROS_VERSION from AMENT_PREFIX_PATH when it is unset. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
Merge pull request #580 from k-okada/ros2-google-cloud-stream [ros_speech_recognition] add GoogleCloudStream engine (ROS1/ROS2, rebase of #572)
-
[ros_speech_recognition] use google-cloud-speech for GoogleCloud engine The GoogleCloud engine used google-api-python-client and oauth2client, which are not declared as dependencies. When they are installed in the venv, oauth2client imports the system pyOpenSSL, which does not work with the cryptography installed by google-auth (AttributeError: module 'lib' has no attribute 'GEN_EMAIL'). Send the request with google-cloud-speech, already a dependency of the GoogleCloudStream engine. The config is still built as the REST JSON dict, so user_config (e.g. diarizationConfig) works as before, and show_all returns the same JSON dict. google-api-python-client is kept for python < 3.7, where google-cloud-speech is not available. Also send preferred_phrases as speechContexts (speechContext is not a field of RecognitionConfig), and remove a debug print.
-
[ros_speech_recognition] report GoogleCloudStream stream errors instead of ignoring them Errors of the gRPC stream were swallowed by [except Exception: pass]{.title-ref}, so an invalid credential or a disabled API looked like nothing was recognized.
- errors that reconnecting cannot fix (Unauthenticated, PermissionDenied, InvalidArgument, NotFound) are logged once with logerr and stop the streaming loop, instead of reconnecting on every audio chunk
- other errors (305s session limit, network) are logged with logwarn and the stream reconnects as before
- streams closed by stop_stream() (e.g. self cancellation) are not logged
-
[ros_speech_recognition] import numpy only for GoogleCloudStream engine python3 venv on kinetic/melodic can not see python-numpy (python2), and the engine is not available there anyway. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
[ros_speech_recognition] add google-cloud-speech and numpy dependencies google-cloud-speech requires python >= 3.7, so skip it on kinetic/melodic python3 venv with a pip environment marker, and add it to pyproject.toml/uv.lock for ROS2. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
[ros_speech_recognition] support GoogleCloudStream engine on both ROS1 and ROS2 use ros_compat instead of rospy, import GoogleCloudStreamingRecognizer only when the engine is selected (google-cloud-speech is not available on python2), add GoogleCloudStream to cfg/ros2 and utf-8 coding header. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
add speech_recognition samples using GoogleCloudStream for README.md (#13)
-
[ros_speech_recognition] log interim transcripts for GoogleCloudStream
-
[ros_speech_recognition] add GoogleCloudStream engine for streaming recognition Wrap google-cloud-speech v1 StreamingRecognize so the node can emit interim transcripts on ~voice_interim_topic while still publishing the finalised utterance on ~voice_topic.
File truncated at 100 lines see the full file
Package Dependencies
System Dependencies
Dependant Packages
Launch files
- launch/parrotry.launch
-
- use_google [default: true]
- language [default: en-US]
- confidence_threshold [default: 0.8]
- launch/speech_recognition.launch
-
- launch_sound_play [default: true] — Launch sound_play node to speak
- launch_audio_capture [default: true] — Launch audio_capture node to publish audio topic from microphone
- audio_topic [default: /audio] — Name of audio topic captured from microphone
- voice_topic [default: /speech_to_text] — Name of text topic of recognized speech
- n_channel [default: 1] — Number of channels of audio topic and microphone. '$ pactl list short sinks' to check your hardware
- depth [default: 16] — Bit depth of audio topic and microphone. '$ pactl list short sinks' to check your hardware
- sample_rate [default: 16000] — Frame rate of audio topic and microphone. '$ pactl list short sinks' to check your hardware
- device [default: ] — Card and device number of microphone (e.g. hw:0,0). you can check card number and device number by '$ arecord -l', then uses hw:[card number],[device number]
- engine [default: Google] — Speech to text engine. TTS engine, Google, GoogleCloud, Sphinx, Wit, Bing Houndify, IBM
- language [default: en-US] — Speech to text language. For Japanese, set ja-JP.
- continuous [default: true] — If false, /speech_recognition service is published. If true, /speech_to_text topic is published.
- auto_start [default: true] — Whether speech_recognition starts automatically or not. This parameter works when continuous is true
- energy_threshold [default: 300.0] — Minimum audio energy to consider for recording speech. Raise it if noise is taken for speech, lower it if quiet speech is missed
- dynamic_energy_threshold [default: true] — Raise energy_threshold automatically to follow the background noise. Set false to keep energy_threshold fixed, e.g. when the noise lifts it above normal speech
- self_cancellation [default: true] — Do not recognize the audio when robot is speaking or not.
- tts_tolerance [default: 1.0] — Tolerance second for recognizing whether robot is speaking or not
- tts_action_names [default: ['sound_play']] — tts action name. these servers outputs are ignored by sound_recognition
- launch/parrotry.launch.xml
- ROS2 version of parrotry.launch (based on Michi-Tsubaki's ROS2 port of this package). julius_ros and aques_talk (use_google:=false and ja-JP in parrotry.launch) have no ROS2 port, so the speech engine is given by engine and the voice comes from sound_play.
-
- engine [default: Google]
- language [default: en-US]
- confidence_threshold [default: 0.8]
- tts_action_name [default: sound_play]
- launch/speech_recognition.launch.xml
- ROS2 version of speech_recognition.launch (based on Michi-Tsubaki's ROS2 port of this package)
-
- launch_sound_play [default: true]
- launch_audio_capture [default: true]
- audio_topic [default: /audio]
- voice_topic [default: /speech_to_text]
- n_channel [default: 1]
- depth [default: 16]
- sample_rate [default: 16000]
- device [default: ]
- engine [default: Google]
- language [default: en-US]
- continuous [default: true]
- auto_start [default: true]
- energy_threshold [default: 300.0]
- dynamic_energy_threshold [default: true]
- self_cancellation [default: true]
- tts_tolerance [default: 1.0]
- tts_action_names [default: ['sound_play']]
Messages
Services
Plugins
Recent questions tagged ros_speech_recognition at Robotics Stack Exchange
|
ros_speech_recognition package from jsk_3rdparty repovoicevox chaplus_ros emotion_analyzer gdrive_ros google_chat_ros influxdb_store jsk_power_switching_tools respeaker_ros ros_speech_recognition rospatlite sesame_ros switchbot_ros |
ROS Distro
|
Package Summary
| Version | 3.0.1 |
| License | BSD-3-Clause |
| Build type | CATKIN |
| Use | RECOMMENDED |
Repository Summary
| Description | |
| Checkout URI | https://github.com/jsk-ros-pkg/jsk_3rdparty.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2026-11-13 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Yuki Furuta
Authors
- Yuki Furuta
ros_speech_recognition
A ROS package for speech-to-text services.
This package uses Python package SpeechRecognition as a backend.
Tutorials
Normal tutorial
- Install this package and SpeechReconition
sudo apt install ros-${ROS_DISTRO}-ros-speech-recognition
- Launch speech recognition node
roslaunch ros_speech_recognition speech_recognition.launch
- Echo
/speech_to_text
rostopic echo /speech_to_text
# you can get the recognition result
Parrotry tutorial
Parrotry mean オウム返し in Japanese
# english
roslaunch ros_speech_recognition parrotry.launch
# japanese
roslaunch ros_speech_recognition parrotry.launch language:=ja-JP
ROS2
The same nodes run on ROS2 (built with colcon; SpeechRecognition and vosk
are installed into a venv of this package with uv at build time).
The dynamic reconfigure parameters (see Parameters) are ROS2
parameters, e.g. ros2 param set /speech_recognition language ja-JP.
The vosk models are downloaded into the installed share directory by
colcon build (with jsk_data, as on ROS1).
ros2 launch ros_speech_recognition speech_recognition.launch.xml
ros2 topic echo /speech_to_text
# parrotry (julius and aques_talk are not available, use engine:=... and sound_play)
ros2 launch ros_speech_recognition parrotry.launch.xml
Streaming recognition with Google Cloud (GoogleCloudStream)
In addition to the request/response GoogleCloud engine, a streaming engine
GoogleCloudStream is available. It uses the bidirectional gRPC
StreamingRecognize API and publishes interim hypotheses on
~voice_interim_topic while the user is still speaking, then publishes the
finalised utterance on ~voice_topic as usual.
roslaunch ros_speech_recognition speech_recognition.launch \
engine:=GoogleCloudStream \
language:=ja-JP \
google_cloud_credentials_json:=/path/to/credentials.json
Notes:
- Endpointing combines Google’s own
is_finalflag with a stability timer controlled by~google_cloud_endpoint_stable_s(default: 1.0 s). - The gRPC session has a 305 s server-side limit; the recognizer reconnects lazily on the next audio chunk, so long-running nodes are safe.
- When
~self_cancellationis enabled, the streaming session is torn down while a~tts_action_namesaction is active and reopened automatically afterwards to avoid recognising the robot’s own voice.
Example:
The following is an example of speech recognition using GoogleCloudStream.
Interim: shows intermediate recognition results, while Result: shows the final recognition result after the speaker finishes speaking.
```bash [INFO] [1792069200.711352]: Interim: こんにちは。 [INFO] [1792069201.701424]: Result: こんにちは。 [INFO] [1792069218.021376]: Interim: 今日? [INFO] [1792069218.196229]: Interim: 今日は! [INFO] [1792069218.621582]: Interim: 今日はいい? [INFO] [1792069218.710931]: Interim: 今日はいい天気。 [INFO] [1792069219.011066]: Interim: 今日はいい天気です。 [INFO] [1792069219.221464]: Interim: 今日はいい天気ですね。 [INFO] [1792069219.911446]: Interim: 今日はいい天気ですね。外 [INFO] [1792069220.090884]: Interim: 今日はいい天気ですね。外で。 [INFO] [1792069220.211304]: Interim: 今日はいい天気ですね。外で遊び。 [INFO] [1792069220.510955]: Interim: 今日はいい天気ですね。外で遊びませ。 [INFO] [1792069220.595351]: Interim: 今日はいい天気ですね。外で遊びません。 [INFO] [1792069220.814139]: Interim: 今日はいい天気ですね。外で遊びませんか?
File truncated at 100 lines see the full file
Changelog for package ros_speech_recognition
3.0.1 (2026-11-10)
- Merge pull request #583 from k-okada/rosdistro-55247-review rosdistro#55247 review: rename power_switching_tools_ros to jsk_power_switching_tools, fix licenses
- use SPDX license identifiers (BSD-3-Clause, Apache-2.0) in package.xml BSD -> BSD-3-Clause and Apache / "Apache License, Version 2.0" -> Apache-2.0 in all packages (ros/rosdistro#55247 review). The LICENSE files of all of them are BSD 3-Clause and Apache 2.0 respectively. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
- Contributors: Kei Okada
3.0.0 (2026-11-06)
-
Merge pull request #581 from k-okada/ros2-buildfarm-ros-environment Fix ROS2 buildfarm binary jobs: ros_environment, bundled flac, numpy wheel
-
[ros_speech_recognition, respeaker_ros] remove flac binaries bundled with SpeechRecognition from the uv venv The 32bit flac-linux-x86 fails dh_shlibdeps of the buildfarm binary job. SpeechRecognition uses the flac in PATH first, which is an exec_depend. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
[voicevox, chaplus_ros, emotion_analyzer, gdrive_ros, google_chat_ros, influxdb_store, power_switching_tools_ros, respeaker_ros, ros_speech_recognition, rospatlite, sesame_ros, switchbot_ros] depend on ros_environment for ROS2 buildfarm The buildfarm builds each package with only its own build dependencies, so without ros_environment $ROS_VERSION is empty and CMakeLists.txt takes the ROS1 branch (same as jsk_common#1835). voicevox also guesses ROS_VERSION from AMENT_PREFIX_PATH when it is unset. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
Merge pull request #580 from k-okada/ros2-google-cloud-stream [ros_speech_recognition] add GoogleCloudStream engine (ROS1/ROS2, rebase of #572)
-
[ros_speech_recognition] use google-cloud-speech for GoogleCloud engine The GoogleCloud engine used google-api-python-client and oauth2client, which are not declared as dependencies. When they are installed in the venv, oauth2client imports the system pyOpenSSL, which does not work with the cryptography installed by google-auth (AttributeError: module 'lib' has no attribute 'GEN_EMAIL'). Send the request with google-cloud-speech, already a dependency of the GoogleCloudStream engine. The config is still built as the REST JSON dict, so user_config (e.g. diarizationConfig) works as before, and show_all returns the same JSON dict. google-api-python-client is kept for python < 3.7, where google-cloud-speech is not available. Also send preferred_phrases as speechContexts (speechContext is not a field of RecognitionConfig), and remove a debug print.
-
[ros_speech_recognition] report GoogleCloudStream stream errors instead of ignoring them Errors of the gRPC stream were swallowed by [except Exception: pass]{.title-ref}, so an invalid credential or a disabled API looked like nothing was recognized.
- errors that reconnecting cannot fix (Unauthenticated, PermissionDenied, InvalidArgument, NotFound) are logged once with logerr and stop the streaming loop, instead of reconnecting on every audio chunk
- other errors (305s session limit, network) are logged with logwarn and the stream reconnects as before
- streams closed by stop_stream() (e.g. self cancellation) are not logged
-
[ros_speech_recognition] import numpy only for GoogleCloudStream engine python3 venv on kinetic/melodic can not see python-numpy (python2), and the engine is not available there anyway. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
[ros_speech_recognition] add google-cloud-speech and numpy dependencies google-cloud-speech requires python >= 3.7, so skip it on kinetic/melodic python3 venv with a pip environment marker, and add it to pyproject.toml/uv.lock for ROS2. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
[ros_speech_recognition] support GoogleCloudStream engine on both ROS1 and ROS2 use ros_compat instead of rospy, import GoogleCloudStreamingRecognizer only when the engine is selected (google-cloud-speech is not available on python2), add GoogleCloudStream to cfg/ros2 and utf-8 coding header. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
add speech_recognition samples using GoogleCloudStream for README.md (#13)
-
[ros_speech_recognition] log interim transcripts for GoogleCloudStream
-
[ros_speech_recognition] add GoogleCloudStream engine for streaming recognition Wrap google-cloud-speech v1 StreamingRecognize so the node can emit interim transcripts on ~voice_interim_topic while still publishing the finalised utterance on ~voice_topic.
File truncated at 100 lines see the full file
Package Dependencies
System Dependencies
Dependant Packages
Launch files
- launch/parrotry.launch
-
- use_google [default: true]
- language [default: en-US]
- confidence_threshold [default: 0.8]
- launch/speech_recognition.launch
-
- launch_sound_play [default: true] — Launch sound_play node to speak
- launch_audio_capture [default: true] — Launch audio_capture node to publish audio topic from microphone
- audio_topic [default: /audio] — Name of audio topic captured from microphone
- voice_topic [default: /speech_to_text] — Name of text topic of recognized speech
- n_channel [default: 1] — Number of channels of audio topic and microphone. '$ pactl list short sinks' to check your hardware
- depth [default: 16] — Bit depth of audio topic and microphone. '$ pactl list short sinks' to check your hardware
- sample_rate [default: 16000] — Frame rate of audio topic and microphone. '$ pactl list short sinks' to check your hardware
- device [default: ] — Card and device number of microphone (e.g. hw:0,0). you can check card number and device number by '$ arecord -l', then uses hw:[card number],[device number]
- engine [default: Google] — Speech to text engine. TTS engine, Google, GoogleCloud, Sphinx, Wit, Bing Houndify, IBM
- language [default: en-US] — Speech to text language. For Japanese, set ja-JP.
- continuous [default: true] — If false, /speech_recognition service is published. If true, /speech_to_text topic is published.
- auto_start [default: true] — Whether speech_recognition starts automatically or not. This parameter works when continuous is true
- energy_threshold [default: 300.0] — Minimum audio energy to consider for recording speech. Raise it if noise is taken for speech, lower it if quiet speech is missed
- dynamic_energy_threshold [default: true] — Raise energy_threshold automatically to follow the background noise. Set false to keep energy_threshold fixed, e.g. when the noise lifts it above normal speech
- self_cancellation [default: true] — Do not recognize the audio when robot is speaking or not.
- tts_tolerance [default: 1.0] — Tolerance second for recognizing whether robot is speaking or not
- tts_action_names [default: ['sound_play']] — tts action name. these servers outputs are ignored by sound_recognition
- launch/parrotry.launch.xml
- ROS2 version of parrotry.launch (based on Michi-Tsubaki's ROS2 port of this package). julius_ros and aques_talk (use_google:=false and ja-JP in parrotry.launch) have no ROS2 port, so the speech engine is given by engine and the voice comes from sound_play.
-
- engine [default: Google]
- language [default: en-US]
- confidence_threshold [default: 0.8]
- tts_action_name [default: sound_play]
- launch/speech_recognition.launch.xml
- ROS2 version of speech_recognition.launch (based on Michi-Tsubaki's ROS2 port of this package)
-
- launch_sound_play [default: true]
- launch_audio_capture [default: true]
- audio_topic [default: /audio]
- voice_topic [default: /speech_to_text]
- n_channel [default: 1]
- depth [default: 16]
- sample_rate [default: 16000]
- device [default: ]
- engine [default: Google]
- language [default: en-US]
- continuous [default: true]
- auto_start [default: true]
- energy_threshold [default: 300.0]
- dynamic_energy_threshold [default: true]
- self_cancellation [default: true]
- tts_tolerance [default: 1.0]
- tts_action_names [default: ['sound_play']]
Messages
Services
Plugins
Recent questions tagged ros_speech_recognition at Robotics Stack Exchange
|
ros_speech_recognition package from jsk_3rdparty repovoicevox chaplus_ros emotion_analyzer gdrive_ros google_chat_ros influxdb_store jsk_power_switching_tools respeaker_ros ros_speech_recognition rospatlite sesame_ros switchbot_ros |
ROS Distro
|
Package Summary
| Version | 3.0.1 |
| License | BSD-3-Clause |
| Build type | CATKIN |
| Use | RECOMMENDED |
Repository Summary
| Description | |
| Checkout URI | https://github.com/jsk-ros-pkg/jsk_3rdparty.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2026-11-13 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Yuki Furuta
Authors
- Yuki Furuta
ros_speech_recognition
A ROS package for speech-to-text services.
This package uses Python package SpeechRecognition as a backend.
Tutorials
Normal tutorial
- Install this package and SpeechReconition
sudo apt install ros-${ROS_DISTRO}-ros-speech-recognition
- Launch speech recognition node
roslaunch ros_speech_recognition speech_recognition.launch
- Echo
/speech_to_text
rostopic echo /speech_to_text
# you can get the recognition result
Parrotry tutorial
Parrotry mean オウム返し in Japanese
# english
roslaunch ros_speech_recognition parrotry.launch
# japanese
roslaunch ros_speech_recognition parrotry.launch language:=ja-JP
ROS2
The same nodes run on ROS2 (built with colcon; SpeechRecognition and vosk
are installed into a venv of this package with uv at build time).
The dynamic reconfigure parameters (see Parameters) are ROS2
parameters, e.g. ros2 param set /speech_recognition language ja-JP.
The vosk models are downloaded into the installed share directory by
colcon build (with jsk_data, as on ROS1).
ros2 launch ros_speech_recognition speech_recognition.launch.xml
ros2 topic echo /speech_to_text
# parrotry (julius and aques_talk are not available, use engine:=... and sound_play)
ros2 launch ros_speech_recognition parrotry.launch.xml
Streaming recognition with Google Cloud (GoogleCloudStream)
In addition to the request/response GoogleCloud engine, a streaming engine
GoogleCloudStream is available. It uses the bidirectional gRPC
StreamingRecognize API and publishes interim hypotheses on
~voice_interim_topic while the user is still speaking, then publishes the
finalised utterance on ~voice_topic as usual.
roslaunch ros_speech_recognition speech_recognition.launch \
engine:=GoogleCloudStream \
language:=ja-JP \
google_cloud_credentials_json:=/path/to/credentials.json
Notes:
- Endpointing combines Google’s own
is_finalflag with a stability timer controlled by~google_cloud_endpoint_stable_s(default: 1.0 s). - The gRPC session has a 305 s server-side limit; the recognizer reconnects lazily on the next audio chunk, so long-running nodes are safe.
- When
~self_cancellationis enabled, the streaming session is torn down while a~tts_action_namesaction is active and reopened automatically afterwards to avoid recognising the robot’s own voice.
Example:
The following is an example of speech recognition using GoogleCloudStream.
Interim: shows intermediate recognition results, while Result: shows the final recognition result after the speaker finishes speaking.
```bash [INFO] [1792069200.711352]: Interim: こんにちは。 [INFO] [1792069201.701424]: Result: こんにちは。 [INFO] [1792069218.021376]: Interim: 今日? [INFO] [1792069218.196229]: Interim: 今日は! [INFO] [1792069218.621582]: Interim: 今日はいい? [INFO] [1792069218.710931]: Interim: 今日はいい天気。 [INFO] [1792069219.011066]: Interim: 今日はいい天気です。 [INFO] [1792069219.221464]: Interim: 今日はいい天気ですね。 [INFO] [1792069219.911446]: Interim: 今日はいい天気ですね。外 [INFO] [1792069220.090884]: Interim: 今日はいい天気ですね。外で。 [INFO] [1792069220.211304]: Interim: 今日はいい天気ですね。外で遊び。 [INFO] [1792069220.510955]: Interim: 今日はいい天気ですね。外で遊びませ。 [INFO] [1792069220.595351]: Interim: 今日はいい天気ですね。外で遊びません。 [INFO] [1792069220.814139]: Interim: 今日はいい天気ですね。外で遊びませんか?
File truncated at 100 lines see the full file
Changelog for package ros_speech_recognition
3.0.1 (2026-11-10)
- Merge pull request #583 from k-okada/rosdistro-55247-review rosdistro#55247 review: rename power_switching_tools_ros to jsk_power_switching_tools, fix licenses
- use SPDX license identifiers (BSD-3-Clause, Apache-2.0) in package.xml BSD -> BSD-3-Clause and Apache / "Apache License, Version 2.0" -> Apache-2.0 in all packages (ros/rosdistro#55247 review). The LICENSE files of all of them are BSD 3-Clause and Apache 2.0 respectively. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
- Contributors: Kei Okada
3.0.0 (2026-11-06)
-
Merge pull request #581 from k-okada/ros2-buildfarm-ros-environment Fix ROS2 buildfarm binary jobs: ros_environment, bundled flac, numpy wheel
-
[ros_speech_recognition, respeaker_ros] remove flac binaries bundled with SpeechRecognition from the uv venv The 32bit flac-linux-x86 fails dh_shlibdeps of the buildfarm binary job. SpeechRecognition uses the flac in PATH first, which is an exec_depend. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
[voicevox, chaplus_ros, emotion_analyzer, gdrive_ros, google_chat_ros, influxdb_store, power_switching_tools_ros, respeaker_ros, ros_speech_recognition, rospatlite, sesame_ros, switchbot_ros] depend on ros_environment for ROS2 buildfarm The buildfarm builds each package with only its own build dependencies, so without ros_environment $ROS_VERSION is empty and CMakeLists.txt takes the ROS1 branch (same as jsk_common#1835). voicevox also guesses ROS_VERSION from AMENT_PREFIX_PATH when it is unset. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
Merge pull request #580 from k-okada/ros2-google-cloud-stream [ros_speech_recognition] add GoogleCloudStream engine (ROS1/ROS2, rebase of #572)
-
[ros_speech_recognition] use google-cloud-speech for GoogleCloud engine The GoogleCloud engine used google-api-python-client and oauth2client, which are not declared as dependencies. When they are installed in the venv, oauth2client imports the system pyOpenSSL, which does not work with the cryptography installed by google-auth (AttributeError: module 'lib' has no attribute 'GEN_EMAIL'). Send the request with google-cloud-speech, already a dependency of the GoogleCloudStream engine. The config is still built as the REST JSON dict, so user_config (e.g. diarizationConfig) works as before, and show_all returns the same JSON dict. google-api-python-client is kept for python < 3.7, where google-cloud-speech is not available. Also send preferred_phrases as speechContexts (speechContext is not a field of RecognitionConfig), and remove a debug print.
-
[ros_speech_recognition] report GoogleCloudStream stream errors instead of ignoring them Errors of the gRPC stream were swallowed by [except Exception: pass]{.title-ref}, so an invalid credential or a disabled API looked like nothing was recognized.
- errors that reconnecting cannot fix (Unauthenticated, PermissionDenied, InvalidArgument, NotFound) are logged once with logerr and stop the streaming loop, instead of reconnecting on every audio chunk
- other errors (305s session limit, network) are logged with logwarn and the stream reconnects as before
- streams closed by stop_stream() (e.g. self cancellation) are not logged
-
[ros_speech_recognition] import numpy only for GoogleCloudStream engine python3 venv on kinetic/melodic can not see python-numpy (python2), and the engine is not available there anyway. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
[ros_speech_recognition] add google-cloud-speech and numpy dependencies google-cloud-speech requires python >= 3.7, so skip it on kinetic/melodic python3 venv with a pip environment marker, and add it to pyproject.toml/uv.lock for ROS2. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
[ros_speech_recognition] support GoogleCloudStream engine on both ROS1 and ROS2 use ros_compat instead of rospy, import GoogleCloudStreamingRecognizer only when the engine is selected (google-cloud-speech is not available on python2), add GoogleCloudStream to cfg/ros2 and utf-8 coding header. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
add speech_recognition samples using GoogleCloudStream for README.md (#13)
-
[ros_speech_recognition] log interim transcripts for GoogleCloudStream
-
[ros_speech_recognition] add GoogleCloudStream engine for streaming recognition Wrap google-cloud-speech v1 StreamingRecognize so the node can emit interim transcripts on ~voice_interim_topic while still publishing the finalised utterance on ~voice_topic.
File truncated at 100 lines see the full file
Package Dependencies
System Dependencies
Dependant Packages
Launch files
- launch/parrotry.launch
-
- use_google [default: true]
- language [default: en-US]
- confidence_threshold [default: 0.8]
- launch/speech_recognition.launch
-
- launch_sound_play [default: true] — Launch sound_play node to speak
- launch_audio_capture [default: true] — Launch audio_capture node to publish audio topic from microphone
- audio_topic [default: /audio] — Name of audio topic captured from microphone
- voice_topic [default: /speech_to_text] — Name of text topic of recognized speech
- n_channel [default: 1] — Number of channels of audio topic and microphone. '$ pactl list short sinks' to check your hardware
- depth [default: 16] — Bit depth of audio topic and microphone. '$ pactl list short sinks' to check your hardware
- sample_rate [default: 16000] — Frame rate of audio topic and microphone. '$ pactl list short sinks' to check your hardware
- device [default: ] — Card and device number of microphone (e.g. hw:0,0). you can check card number and device number by '$ arecord -l', then uses hw:[card number],[device number]
- engine [default: Google] — Speech to text engine. TTS engine, Google, GoogleCloud, Sphinx, Wit, Bing Houndify, IBM
- language [default: en-US] — Speech to text language. For Japanese, set ja-JP.
- continuous [default: true] — If false, /speech_recognition service is published. If true, /speech_to_text topic is published.
- auto_start [default: true] — Whether speech_recognition starts automatically or not. This parameter works when continuous is true
- energy_threshold [default: 300.0] — Minimum audio energy to consider for recording speech. Raise it if noise is taken for speech, lower it if quiet speech is missed
- dynamic_energy_threshold [default: true] — Raise energy_threshold automatically to follow the background noise. Set false to keep energy_threshold fixed, e.g. when the noise lifts it above normal speech
- self_cancellation [default: true] — Do not recognize the audio when robot is speaking or not.
- tts_tolerance [default: 1.0] — Tolerance second for recognizing whether robot is speaking or not
- tts_action_names [default: ['sound_play']] — tts action name. these servers outputs are ignored by sound_recognition
- launch/parrotry.launch.xml
- ROS2 version of parrotry.launch (based on Michi-Tsubaki's ROS2 port of this package). julius_ros and aques_talk (use_google:=false and ja-JP in parrotry.launch) have no ROS2 port, so the speech engine is given by engine and the voice comes from sound_play.
-
- engine [default: Google]
- language [default: en-US]
- confidence_threshold [default: 0.8]
- tts_action_name [default: sound_play]
- launch/speech_recognition.launch.xml
- ROS2 version of speech_recognition.launch (based on Michi-Tsubaki's ROS2 port of this package)
-
- launch_sound_play [default: true]
- launch_audio_capture [default: true]
- audio_topic [default: /audio]
- voice_topic [default: /speech_to_text]
- n_channel [default: 1]
- depth [default: 16]
- sample_rate [default: 16000]
- device [default: ]
- engine [default: Google]
- language [default: en-US]
- continuous [default: true]
- auto_start [default: true]
- energy_threshold [default: 300.0]
- dynamic_energy_threshold [default: true]
- self_cancellation [default: true]
- tts_tolerance [default: 1.0]
- tts_action_names [default: ['sound_play']]
Messages
Services
Plugins
Recent questions tagged ros_speech_recognition at Robotics Stack Exchange
|
ros_speech_recognition package from jsk_3rdparty repovoicevox chaplus_ros emotion_analyzer gdrive_ros google_chat_ros influxdb_store jsk_power_switching_tools respeaker_ros ros_speech_recognition rospatlite sesame_ros switchbot_ros |
ROS Distro
|
Package Summary
| Version | 3.0.1 |
| License | BSD-3-Clause |
| Build type | CATKIN |
| Use | RECOMMENDED |
Repository Summary
| Description | |
| Checkout URI | https://github.com/jsk-ros-pkg/jsk_3rdparty.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2026-11-13 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Yuki Furuta
Authors
- Yuki Furuta
ros_speech_recognition
A ROS package for speech-to-text services.
This package uses Python package SpeechRecognition as a backend.
Tutorials
Normal tutorial
- Install this package and SpeechReconition
sudo apt install ros-${ROS_DISTRO}-ros-speech-recognition
- Launch speech recognition node
roslaunch ros_speech_recognition speech_recognition.launch
- Echo
/speech_to_text
rostopic echo /speech_to_text
# you can get the recognition result
Parrotry tutorial
Parrotry mean オウム返し in Japanese
# english
roslaunch ros_speech_recognition parrotry.launch
# japanese
roslaunch ros_speech_recognition parrotry.launch language:=ja-JP
ROS2
The same nodes run on ROS2 (built with colcon; SpeechRecognition and vosk
are installed into a venv of this package with uv at build time).
The dynamic reconfigure parameters (see Parameters) are ROS2
parameters, e.g. ros2 param set /speech_recognition language ja-JP.
The vosk models are downloaded into the installed share directory by
colcon build (with jsk_data, as on ROS1).
ros2 launch ros_speech_recognition speech_recognition.launch.xml
ros2 topic echo /speech_to_text
# parrotry (julius and aques_talk are not available, use engine:=... and sound_play)
ros2 launch ros_speech_recognition parrotry.launch.xml
Streaming recognition with Google Cloud (GoogleCloudStream)
In addition to the request/response GoogleCloud engine, a streaming engine
GoogleCloudStream is available. It uses the bidirectional gRPC
StreamingRecognize API and publishes interim hypotheses on
~voice_interim_topic while the user is still speaking, then publishes the
finalised utterance on ~voice_topic as usual.
roslaunch ros_speech_recognition speech_recognition.launch \
engine:=GoogleCloudStream \
language:=ja-JP \
google_cloud_credentials_json:=/path/to/credentials.json
Notes:
- Endpointing combines Google’s own
is_finalflag with a stability timer controlled by~google_cloud_endpoint_stable_s(default: 1.0 s). - The gRPC session has a 305 s server-side limit; the recognizer reconnects lazily on the next audio chunk, so long-running nodes are safe.
- When
~self_cancellationis enabled, the streaming session is torn down while a~tts_action_namesaction is active and reopened automatically afterwards to avoid recognising the robot’s own voice.
Example:
The following is an example of speech recognition using GoogleCloudStream.
Interim: shows intermediate recognition results, while Result: shows the final recognition result after the speaker finishes speaking.
```bash [INFO] [1792069200.711352]: Interim: こんにちは。 [INFO] [1792069201.701424]: Result: こんにちは。 [INFO] [1792069218.021376]: Interim: 今日? [INFO] [1792069218.196229]: Interim: 今日は! [INFO] [1792069218.621582]: Interim: 今日はいい? [INFO] [1792069218.710931]: Interim: 今日はいい天気。 [INFO] [1792069219.011066]: Interim: 今日はいい天気です。 [INFO] [1792069219.221464]: Interim: 今日はいい天気ですね。 [INFO] [1792069219.911446]: Interim: 今日はいい天気ですね。外 [INFO] [1792069220.090884]: Interim: 今日はいい天気ですね。外で。 [INFO] [1792069220.211304]: Interim: 今日はいい天気ですね。外で遊び。 [INFO] [1792069220.510955]: Interim: 今日はいい天気ですね。外で遊びませ。 [INFO] [1792069220.595351]: Interim: 今日はいい天気ですね。外で遊びません。 [INFO] [1792069220.814139]: Interim: 今日はいい天気ですね。外で遊びませんか?
File truncated at 100 lines see the full file
Changelog for package ros_speech_recognition
3.0.1 (2026-11-10)
- Merge pull request #583 from k-okada/rosdistro-55247-review rosdistro#55247 review: rename power_switching_tools_ros to jsk_power_switching_tools, fix licenses
- use SPDX license identifiers (BSD-3-Clause, Apache-2.0) in package.xml BSD -> BSD-3-Clause and Apache / "Apache License, Version 2.0" -> Apache-2.0 in all packages (ros/rosdistro#55247 review). The LICENSE files of all of them are BSD 3-Clause and Apache 2.0 respectively. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
- Contributors: Kei Okada
3.0.0 (2026-11-06)
-
Merge pull request #581 from k-okada/ros2-buildfarm-ros-environment Fix ROS2 buildfarm binary jobs: ros_environment, bundled flac, numpy wheel
-
[ros_speech_recognition, respeaker_ros] remove flac binaries bundled with SpeechRecognition from the uv venv The 32bit flac-linux-x86 fails dh_shlibdeps of the buildfarm binary job. SpeechRecognition uses the flac in PATH first, which is an exec_depend. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
[voicevox, chaplus_ros, emotion_analyzer, gdrive_ros, google_chat_ros, influxdb_store, power_switching_tools_ros, respeaker_ros, ros_speech_recognition, rospatlite, sesame_ros, switchbot_ros] depend on ros_environment for ROS2 buildfarm The buildfarm builds each package with only its own build dependencies, so without ros_environment $ROS_VERSION is empty and CMakeLists.txt takes the ROS1 branch (same as jsk_common#1835). voicevox also guesses ROS_VERSION from AMENT_PREFIX_PATH when it is unset. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
Merge pull request #580 from k-okada/ros2-google-cloud-stream [ros_speech_recognition] add GoogleCloudStream engine (ROS1/ROS2, rebase of #572)
-
[ros_speech_recognition] use google-cloud-speech for GoogleCloud engine The GoogleCloud engine used google-api-python-client and oauth2client, which are not declared as dependencies. When they are installed in the venv, oauth2client imports the system pyOpenSSL, which does not work with the cryptography installed by google-auth (AttributeError: module 'lib' has no attribute 'GEN_EMAIL'). Send the request with google-cloud-speech, already a dependency of the GoogleCloudStream engine. The config is still built as the REST JSON dict, so user_config (e.g. diarizationConfig) works as before, and show_all returns the same JSON dict. google-api-python-client is kept for python < 3.7, where google-cloud-speech is not available. Also send preferred_phrases as speechContexts (speechContext is not a field of RecognitionConfig), and remove a debug print.
-
[ros_speech_recognition] report GoogleCloudStream stream errors instead of ignoring them Errors of the gRPC stream were swallowed by [except Exception: pass]{.title-ref}, so an invalid credential or a disabled API looked like nothing was recognized.
- errors that reconnecting cannot fix (Unauthenticated, PermissionDenied, InvalidArgument, NotFound) are logged once with logerr and stop the streaming loop, instead of reconnecting on every audio chunk
- other errors (305s session limit, network) are logged with logwarn and the stream reconnects as before
- streams closed by stop_stream() (e.g. self cancellation) are not logged
-
[ros_speech_recognition] import numpy only for GoogleCloudStream engine python3 venv on kinetic/melodic can not see python-numpy (python2), and the engine is not available there anyway. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
[ros_speech_recognition] add google-cloud-speech and numpy dependencies google-cloud-speech requires python >= 3.7, so skip it on kinetic/melodic python3 venv with a pip environment marker, and add it to pyproject.toml/uv.lock for ROS2. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
[ros_speech_recognition] support GoogleCloudStream engine on both ROS1 and ROS2 use ros_compat instead of rospy, import GoogleCloudStreamingRecognizer only when the engine is selected (google-cloud-speech is not available on python2), add GoogleCloudStream to cfg/ros2 and utf-8 coding header. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
add speech_recognition samples using GoogleCloudStream for README.md (#13)
-
[ros_speech_recognition] log interim transcripts for GoogleCloudStream
-
[ros_speech_recognition] add GoogleCloudStream engine for streaming recognition Wrap google-cloud-speech v1 StreamingRecognize so the node can emit interim transcripts on ~voice_interim_topic while still publishing the finalised utterance on ~voice_topic.
File truncated at 100 lines see the full file
Package Dependencies
System Dependencies
Dependant Packages
Launch files
- launch/parrotry.launch
-
- use_google [default: true]
- language [default: en-US]
- confidence_threshold [default: 0.8]
- launch/speech_recognition.launch
-
- launch_sound_play [default: true] — Launch sound_play node to speak
- launch_audio_capture [default: true] — Launch audio_capture node to publish audio topic from microphone
- audio_topic [default: /audio] — Name of audio topic captured from microphone
- voice_topic [default: /speech_to_text] — Name of text topic of recognized speech
- n_channel [default: 1] — Number of channels of audio topic and microphone. '$ pactl list short sinks' to check your hardware
- depth [default: 16] — Bit depth of audio topic and microphone. '$ pactl list short sinks' to check your hardware
- sample_rate [default: 16000] — Frame rate of audio topic and microphone. '$ pactl list short sinks' to check your hardware
- device [default: ] — Card and device number of microphone (e.g. hw:0,0). you can check card number and device number by '$ arecord -l', then uses hw:[card number],[device number]
- engine [default: Google] — Speech to text engine. TTS engine, Google, GoogleCloud, Sphinx, Wit, Bing Houndify, IBM
- language [default: en-US] — Speech to text language. For Japanese, set ja-JP.
- continuous [default: true] — If false, /speech_recognition service is published. If true, /speech_to_text topic is published.
- auto_start [default: true] — Whether speech_recognition starts automatically or not. This parameter works when continuous is true
- energy_threshold [default: 300.0] — Minimum audio energy to consider for recording speech. Raise it if noise is taken for speech, lower it if quiet speech is missed
- dynamic_energy_threshold [default: true] — Raise energy_threshold automatically to follow the background noise. Set false to keep energy_threshold fixed, e.g. when the noise lifts it above normal speech
- self_cancellation [default: true] — Do not recognize the audio when robot is speaking or not.
- tts_tolerance [default: 1.0] — Tolerance second for recognizing whether robot is speaking or not
- tts_action_names [default: ['sound_play']] — tts action name. these servers outputs are ignored by sound_recognition
- launch/parrotry.launch.xml
- ROS2 version of parrotry.launch (based on Michi-Tsubaki's ROS2 port of this package). julius_ros and aques_talk (use_google:=false and ja-JP in parrotry.launch) have no ROS2 port, so the speech engine is given by engine and the voice comes from sound_play.
-
- engine [default: Google]
- language [default: en-US]
- confidence_threshold [default: 0.8]
- tts_action_name [default: sound_play]
- launch/speech_recognition.launch.xml
- ROS2 version of speech_recognition.launch (based on Michi-Tsubaki's ROS2 port of this package)
-
- launch_sound_play [default: true]
- launch_audio_capture [default: true]
- audio_topic [default: /audio]
- voice_topic [default: /speech_to_text]
- n_channel [default: 1]
- depth [default: 16]
- sample_rate [default: 16000]
- device [default: ]
- engine [default: Google]
- language [default: en-US]
- continuous [default: true]
- auto_start [default: true]
- energy_threshold [default: 300.0]
- dynamic_energy_threshold [default: true]
- self_cancellation [default: true]
- tts_tolerance [default: 1.0]
- tts_action_names [default: ['sound_play']]
Messages
Services
Plugins
Recent questions tagged ros_speech_recognition at Robotics Stack Exchange
|
ros_speech_recognition package from jsk_3rdparty repovoicevox chaplus_ros emotion_analyzer gdrive_ros google_chat_ros influxdb_store jsk_power_switching_tools respeaker_ros ros_speech_recognition rospatlite sesame_ros switchbot_ros |
ROS Distro
|
Package Summary
| Version | 3.0.1 |
| License | BSD-3-Clause |
| Build type | CATKIN |
| Use | RECOMMENDED |
Repository Summary
| Description | |
| Checkout URI | https://github.com/jsk-ros-pkg/jsk_3rdparty.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2026-11-13 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Yuki Furuta
Authors
- Yuki Furuta
ros_speech_recognition
A ROS package for speech-to-text services.
This package uses Python package SpeechRecognition as a backend.
Tutorials
Normal tutorial
- Install this package and SpeechReconition
sudo apt install ros-${ROS_DISTRO}-ros-speech-recognition
- Launch speech recognition node
roslaunch ros_speech_recognition speech_recognition.launch
- Echo
/speech_to_text
rostopic echo /speech_to_text
# you can get the recognition result
Parrotry tutorial
Parrotry mean オウム返し in Japanese
# english
roslaunch ros_speech_recognition parrotry.launch
# japanese
roslaunch ros_speech_recognition parrotry.launch language:=ja-JP
ROS2
The same nodes run on ROS2 (built with colcon; SpeechRecognition and vosk
are installed into a venv of this package with uv at build time).
The dynamic reconfigure parameters (see Parameters) are ROS2
parameters, e.g. ros2 param set /speech_recognition language ja-JP.
The vosk models are downloaded into the installed share directory by
colcon build (with jsk_data, as on ROS1).
ros2 launch ros_speech_recognition speech_recognition.launch.xml
ros2 topic echo /speech_to_text
# parrotry (julius and aques_talk are not available, use engine:=... and sound_play)
ros2 launch ros_speech_recognition parrotry.launch.xml
Streaming recognition with Google Cloud (GoogleCloudStream)
In addition to the request/response GoogleCloud engine, a streaming engine
GoogleCloudStream is available. It uses the bidirectional gRPC
StreamingRecognize API and publishes interim hypotheses on
~voice_interim_topic while the user is still speaking, then publishes the
finalised utterance on ~voice_topic as usual.
roslaunch ros_speech_recognition speech_recognition.launch \
engine:=GoogleCloudStream \
language:=ja-JP \
google_cloud_credentials_json:=/path/to/credentials.json
Notes:
- Endpointing combines Google’s own
is_finalflag with a stability timer controlled by~google_cloud_endpoint_stable_s(default: 1.0 s). - The gRPC session has a 305 s server-side limit; the recognizer reconnects lazily on the next audio chunk, so long-running nodes are safe.
- When
~self_cancellationis enabled, the streaming session is torn down while a~tts_action_namesaction is active and reopened automatically afterwards to avoid recognising the robot’s own voice.
Example:
The following is an example of speech recognition using GoogleCloudStream.
Interim: shows intermediate recognition results, while Result: shows the final recognition result after the speaker finishes speaking.
```bash [INFO] [1792069200.711352]: Interim: こんにちは。 [INFO] [1792069201.701424]: Result: こんにちは。 [INFO] [1792069218.021376]: Interim: 今日? [INFO] [1792069218.196229]: Interim: 今日は! [INFO] [1792069218.621582]: Interim: 今日はいい? [INFO] [1792069218.710931]: Interim: 今日はいい天気。 [INFO] [1792069219.011066]: Interim: 今日はいい天気です。 [INFO] [1792069219.221464]: Interim: 今日はいい天気ですね。 [INFO] [1792069219.911446]: Interim: 今日はいい天気ですね。外 [INFO] [1792069220.090884]: Interim: 今日はいい天気ですね。外で。 [INFO] [1792069220.211304]: Interim: 今日はいい天気ですね。外で遊び。 [INFO] [1792069220.510955]: Interim: 今日はいい天気ですね。外で遊びませ。 [INFO] [1792069220.595351]: Interim: 今日はいい天気ですね。外で遊びません。 [INFO] [1792069220.814139]: Interim: 今日はいい天気ですね。外で遊びませんか?
File truncated at 100 lines see the full file
Changelog for package ros_speech_recognition
3.0.1 (2026-11-10)
- Merge pull request #583 from k-okada/rosdistro-55247-review rosdistro#55247 review: rename power_switching_tools_ros to jsk_power_switching_tools, fix licenses
- use SPDX license identifiers (BSD-3-Clause, Apache-2.0) in package.xml BSD -> BSD-3-Clause and Apache / "Apache License, Version 2.0" -> Apache-2.0 in all packages (ros/rosdistro#55247 review). The LICENSE files of all of them are BSD 3-Clause and Apache 2.0 respectively. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
- Contributors: Kei Okada
3.0.0 (2026-11-06)
-
Merge pull request #581 from k-okada/ros2-buildfarm-ros-environment Fix ROS2 buildfarm binary jobs: ros_environment, bundled flac, numpy wheel
-
[ros_speech_recognition, respeaker_ros] remove flac binaries bundled with SpeechRecognition from the uv venv The 32bit flac-linux-x86 fails dh_shlibdeps of the buildfarm binary job. SpeechRecognition uses the flac in PATH first, which is an exec_depend. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
[voicevox, chaplus_ros, emotion_analyzer, gdrive_ros, google_chat_ros, influxdb_store, power_switching_tools_ros, respeaker_ros, ros_speech_recognition, rospatlite, sesame_ros, switchbot_ros] depend on ros_environment for ROS2 buildfarm The buildfarm builds each package with only its own build dependencies, so without ros_environment $ROS_VERSION is empty and CMakeLists.txt takes the ROS1 branch (same as jsk_common#1835). voicevox also guesses ROS_VERSION from AMENT_PREFIX_PATH when it is unset. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
Merge pull request #580 from k-okada/ros2-google-cloud-stream [ros_speech_recognition] add GoogleCloudStream engine (ROS1/ROS2, rebase of #572)
-
[ros_speech_recognition] use google-cloud-speech for GoogleCloud engine The GoogleCloud engine used google-api-python-client and oauth2client, which are not declared as dependencies. When they are installed in the venv, oauth2client imports the system pyOpenSSL, which does not work with the cryptography installed by google-auth (AttributeError: module 'lib' has no attribute 'GEN_EMAIL'). Send the request with google-cloud-speech, already a dependency of the GoogleCloudStream engine. The config is still built as the REST JSON dict, so user_config (e.g. diarizationConfig) works as before, and show_all returns the same JSON dict. google-api-python-client is kept for python < 3.7, where google-cloud-speech is not available. Also send preferred_phrases as speechContexts (speechContext is not a field of RecognitionConfig), and remove a debug print.
-
[ros_speech_recognition] report GoogleCloudStream stream errors instead of ignoring them Errors of the gRPC stream were swallowed by [except Exception: pass]{.title-ref}, so an invalid credential or a disabled API looked like nothing was recognized.
- errors that reconnecting cannot fix (Unauthenticated, PermissionDenied, InvalidArgument, NotFound) are logged once with logerr and stop the streaming loop, instead of reconnecting on every audio chunk
- other errors (305s session limit, network) are logged with logwarn and the stream reconnects as before
- streams closed by stop_stream() (e.g. self cancellation) are not logged
-
[ros_speech_recognition] import numpy only for GoogleCloudStream engine python3 venv on kinetic/melodic can not see python-numpy (python2), and the engine is not available there anyway. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
[ros_speech_recognition] add google-cloud-speech and numpy dependencies google-cloud-speech requires python >= 3.7, so skip it on kinetic/melodic python3 venv with a pip environment marker, and add it to pyproject.toml/uv.lock for ROS2. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
[ros_speech_recognition] support GoogleCloudStream engine on both ROS1 and ROS2 use ros_compat instead of rospy, import GoogleCloudStreamingRecognizer only when the engine is selected (google-cloud-speech is not available on python2), add GoogleCloudStream to cfg/ros2 and utf-8 coding header. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
add speech_recognition samples using GoogleCloudStream for README.md (#13)
-
[ros_speech_recognition] log interim transcripts for GoogleCloudStream
-
[ros_speech_recognition] add GoogleCloudStream engine for streaming recognition Wrap google-cloud-speech v1 StreamingRecognize so the node can emit interim transcripts on ~voice_interim_topic while still publishing the finalised utterance on ~voice_topic.
File truncated at 100 lines see the full file
Package Dependencies
System Dependencies
Dependant Packages
Launch files
- launch/parrotry.launch
-
- use_google [default: true]
- language [default: en-US]
- confidence_threshold [default: 0.8]
- launch/speech_recognition.launch
-
- launch_sound_play [default: true] — Launch sound_play node to speak
- launch_audio_capture [default: true] — Launch audio_capture node to publish audio topic from microphone
- audio_topic [default: /audio] — Name of audio topic captured from microphone
- voice_topic [default: /speech_to_text] — Name of text topic of recognized speech
- n_channel [default: 1] — Number of channels of audio topic and microphone. '$ pactl list short sinks' to check your hardware
- depth [default: 16] — Bit depth of audio topic and microphone. '$ pactl list short sinks' to check your hardware
- sample_rate [default: 16000] — Frame rate of audio topic and microphone. '$ pactl list short sinks' to check your hardware
- device [default: ] — Card and device number of microphone (e.g. hw:0,0). you can check card number and device number by '$ arecord -l', then uses hw:[card number],[device number]
- engine [default: Google] — Speech to text engine. TTS engine, Google, GoogleCloud, Sphinx, Wit, Bing Houndify, IBM
- language [default: en-US] — Speech to text language. For Japanese, set ja-JP.
- continuous [default: true] — If false, /speech_recognition service is published. If true, /speech_to_text topic is published.
- auto_start [default: true] — Whether speech_recognition starts automatically or not. This parameter works when continuous is true
- energy_threshold [default: 300.0] — Minimum audio energy to consider for recording speech. Raise it if noise is taken for speech, lower it if quiet speech is missed
- dynamic_energy_threshold [default: true] — Raise energy_threshold automatically to follow the background noise. Set false to keep energy_threshold fixed, e.g. when the noise lifts it above normal speech
- self_cancellation [default: true] — Do not recognize the audio when robot is speaking or not.
- tts_tolerance [default: 1.0] — Tolerance second for recognizing whether robot is speaking or not
- tts_action_names [default: ['sound_play']] — tts action name. these servers outputs are ignored by sound_recognition
- launch/parrotry.launch.xml
- ROS2 version of parrotry.launch (based on Michi-Tsubaki's ROS2 port of this package). julius_ros and aques_talk (use_google:=false and ja-JP in parrotry.launch) have no ROS2 port, so the speech engine is given by engine and the voice comes from sound_play.
-
- engine [default: Google]
- language [default: en-US]
- confidence_threshold [default: 0.8]
- tts_action_name [default: sound_play]
- launch/speech_recognition.launch.xml
- ROS2 version of speech_recognition.launch (based on Michi-Tsubaki's ROS2 port of this package)
-
- launch_sound_play [default: true]
- launch_audio_capture [default: true]
- audio_topic [default: /audio]
- voice_topic [default: /speech_to_text]
- n_channel [default: 1]
- depth [default: 16]
- sample_rate [default: 16000]
- device [default: ]
- engine [default: Google]
- language [default: en-US]
- continuous [default: true]
- auto_start [default: true]
- energy_threshold [default: 300.0]
- dynamic_energy_threshold [default: true]
- self_cancellation [default: true]
- tts_tolerance [default: 1.0]
- tts_action_names [default: ['sound_play']]
Messages
Services
Plugins
Recent questions tagged ros_speech_recognition at Robotics Stack Exchange
|
ros_speech_recognition package from jsk_3rdparty repovoicevox chaplus_ros emotion_analyzer gdrive_ros google_chat_ros influxdb_store jsk_power_switching_tools respeaker_ros ros_speech_recognition rospatlite sesame_ros switchbot_ros |
ROS Distro
|
Package Summary
| Version | 3.0.1 |
| License | BSD-3-Clause |
| Build type | CATKIN |
| Use | RECOMMENDED |
Repository Summary
| Description | |
| Checkout URI | https://github.com/jsk-ros-pkg/jsk_3rdparty.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2026-11-13 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Yuki Furuta
Authors
- Yuki Furuta
ros_speech_recognition
A ROS package for speech-to-text services.
This package uses Python package SpeechRecognition as a backend.
Tutorials
Normal tutorial
- Install this package and SpeechReconition
sudo apt install ros-${ROS_DISTRO}-ros-speech-recognition
- Launch speech recognition node
roslaunch ros_speech_recognition speech_recognition.launch
- Echo
/speech_to_text
rostopic echo /speech_to_text
# you can get the recognition result
Parrotry tutorial
Parrotry mean オウム返し in Japanese
# english
roslaunch ros_speech_recognition parrotry.launch
# japanese
roslaunch ros_speech_recognition parrotry.launch language:=ja-JP
ROS2
The same nodes run on ROS2 (built with colcon; SpeechRecognition and vosk
are installed into a venv of this package with uv at build time).
The dynamic reconfigure parameters (see Parameters) are ROS2
parameters, e.g. ros2 param set /speech_recognition language ja-JP.
The vosk models are downloaded into the installed share directory by
colcon build (with jsk_data, as on ROS1).
ros2 launch ros_speech_recognition speech_recognition.launch.xml
ros2 topic echo /speech_to_text
# parrotry (julius and aques_talk are not available, use engine:=... and sound_play)
ros2 launch ros_speech_recognition parrotry.launch.xml
Streaming recognition with Google Cloud (GoogleCloudStream)
In addition to the request/response GoogleCloud engine, a streaming engine
GoogleCloudStream is available. It uses the bidirectional gRPC
StreamingRecognize API and publishes interim hypotheses on
~voice_interim_topic while the user is still speaking, then publishes the
finalised utterance on ~voice_topic as usual.
roslaunch ros_speech_recognition speech_recognition.launch \
engine:=GoogleCloudStream \
language:=ja-JP \
google_cloud_credentials_json:=/path/to/credentials.json
Notes:
- Endpointing combines Google’s own
is_finalflag with a stability timer controlled by~google_cloud_endpoint_stable_s(default: 1.0 s). - The gRPC session has a 305 s server-side limit; the recognizer reconnects lazily on the next audio chunk, so long-running nodes are safe.
- When
~self_cancellationis enabled, the streaming session is torn down while a~tts_action_namesaction is active and reopened automatically afterwards to avoid recognising the robot’s own voice.
Example:
The following is an example of speech recognition using GoogleCloudStream.
Interim: shows intermediate recognition results, while Result: shows the final recognition result after the speaker finishes speaking.
```bash [INFO] [1792069200.711352]: Interim: こんにちは。 [INFO] [1792069201.701424]: Result: こんにちは。 [INFO] [1792069218.021376]: Interim: 今日? [INFO] [1792069218.196229]: Interim: 今日は! [INFO] [1792069218.621582]: Interim: 今日はいい? [INFO] [1792069218.710931]: Interim: 今日はいい天気。 [INFO] [1792069219.011066]: Interim: 今日はいい天気です。 [INFO] [1792069219.221464]: Interim: 今日はいい天気ですね。 [INFO] [1792069219.911446]: Interim: 今日はいい天気ですね。外 [INFO] [1792069220.090884]: Interim: 今日はいい天気ですね。外で。 [INFO] [1792069220.211304]: Interim: 今日はいい天気ですね。外で遊び。 [INFO] [1792069220.510955]: Interim: 今日はいい天気ですね。外で遊びませ。 [INFO] [1792069220.595351]: Interim: 今日はいい天気ですね。外で遊びません。 [INFO] [1792069220.814139]: Interim: 今日はいい天気ですね。外で遊びませんか?
File truncated at 100 lines see the full file
Changelog for package ros_speech_recognition
3.0.1 (2026-11-10)
- Merge pull request #583 from k-okada/rosdistro-55247-review rosdistro#55247 review: rename power_switching_tools_ros to jsk_power_switching_tools, fix licenses
- use SPDX license identifiers (BSD-3-Clause, Apache-2.0) in package.xml BSD -> BSD-3-Clause and Apache / "Apache License, Version 2.0" -> Apache-2.0 in all packages (ros/rosdistro#55247 review). The LICENSE files of all of them are BSD 3-Clause and Apache 2.0 respectively. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
- Contributors: Kei Okada
3.0.0 (2026-11-06)
-
Merge pull request #581 from k-okada/ros2-buildfarm-ros-environment Fix ROS2 buildfarm binary jobs: ros_environment, bundled flac, numpy wheel
-
[ros_speech_recognition, respeaker_ros] remove flac binaries bundled with SpeechRecognition from the uv venv The 32bit flac-linux-x86 fails dh_shlibdeps of the buildfarm binary job. SpeechRecognition uses the flac in PATH first, which is an exec_depend. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
[voicevox, chaplus_ros, emotion_analyzer, gdrive_ros, google_chat_ros, influxdb_store, power_switching_tools_ros, respeaker_ros, ros_speech_recognition, rospatlite, sesame_ros, switchbot_ros] depend on ros_environment for ROS2 buildfarm The buildfarm builds each package with only its own build dependencies, so without ros_environment $ROS_VERSION is empty and CMakeLists.txt takes the ROS1 branch (same as jsk_common#1835). voicevox also guesses ROS_VERSION from AMENT_PREFIX_PATH when it is unset. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
Merge pull request #580 from k-okada/ros2-google-cloud-stream [ros_speech_recognition] add GoogleCloudStream engine (ROS1/ROS2, rebase of #572)
-
[ros_speech_recognition] use google-cloud-speech for GoogleCloud engine The GoogleCloud engine used google-api-python-client and oauth2client, which are not declared as dependencies. When they are installed in the venv, oauth2client imports the system pyOpenSSL, which does not work with the cryptography installed by google-auth (AttributeError: module 'lib' has no attribute 'GEN_EMAIL'). Send the request with google-cloud-speech, already a dependency of the GoogleCloudStream engine. The config is still built as the REST JSON dict, so user_config (e.g. diarizationConfig) works as before, and show_all returns the same JSON dict. google-api-python-client is kept for python < 3.7, where google-cloud-speech is not available. Also send preferred_phrases as speechContexts (speechContext is not a field of RecognitionConfig), and remove a debug print.
-
[ros_speech_recognition] report GoogleCloudStream stream errors instead of ignoring them Errors of the gRPC stream were swallowed by [except Exception: pass]{.title-ref}, so an invalid credential or a disabled API looked like nothing was recognized.
- errors that reconnecting cannot fix (Unauthenticated, PermissionDenied, InvalidArgument, NotFound) are logged once with logerr and stop the streaming loop, instead of reconnecting on every audio chunk
- other errors (305s session limit, network) are logged with logwarn and the stream reconnects as before
- streams closed by stop_stream() (e.g. self cancellation) are not logged
-
[ros_speech_recognition] import numpy only for GoogleCloudStream engine python3 venv on kinetic/melodic can not see python-numpy (python2), and the engine is not available there anyway. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
[ros_speech_recognition] add google-cloud-speech and numpy dependencies google-cloud-speech requires python >= 3.7, so skip it on kinetic/melodic python3 venv with a pip environment marker, and add it to pyproject.toml/uv.lock for ROS2. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
[ros_speech_recognition] support GoogleCloudStream engine on both ROS1 and ROS2 use ros_compat instead of rospy, import GoogleCloudStreamingRecognizer only when the engine is selected (google-cloud-speech is not available on python2), add GoogleCloudStream to cfg/ros2 and utf-8 coding header. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
add speech_recognition samples using GoogleCloudStream for README.md (#13)
-
[ros_speech_recognition] log interim transcripts for GoogleCloudStream
-
[ros_speech_recognition] add GoogleCloudStream engine for streaming recognition Wrap google-cloud-speech v1 StreamingRecognize so the node can emit interim transcripts on ~voice_interim_topic while still publishing the finalised utterance on ~voice_topic.
File truncated at 100 lines see the full file
Package Dependencies
System Dependencies
Dependant Packages
Launch files
- launch/parrotry.launch
-
- use_google [default: true]
- language [default: en-US]
- confidence_threshold [default: 0.8]
- launch/speech_recognition.launch
-
- launch_sound_play [default: true] — Launch sound_play node to speak
- launch_audio_capture [default: true] — Launch audio_capture node to publish audio topic from microphone
- audio_topic [default: /audio] — Name of audio topic captured from microphone
- voice_topic [default: /speech_to_text] — Name of text topic of recognized speech
- n_channel [default: 1] — Number of channels of audio topic and microphone. '$ pactl list short sinks' to check your hardware
- depth [default: 16] — Bit depth of audio topic and microphone. '$ pactl list short sinks' to check your hardware
- sample_rate [default: 16000] — Frame rate of audio topic and microphone. '$ pactl list short sinks' to check your hardware
- device [default: ] — Card and device number of microphone (e.g. hw:0,0). you can check card number and device number by '$ arecord -l', then uses hw:[card number],[device number]
- engine [default: Google] — Speech to text engine. TTS engine, Google, GoogleCloud, Sphinx, Wit, Bing Houndify, IBM
- language [default: en-US] — Speech to text language. For Japanese, set ja-JP.
- continuous [default: true] — If false, /speech_recognition service is published. If true, /speech_to_text topic is published.
- auto_start [default: true] — Whether speech_recognition starts automatically or not. This parameter works when continuous is true
- energy_threshold [default: 300.0] — Minimum audio energy to consider for recording speech. Raise it if noise is taken for speech, lower it if quiet speech is missed
- dynamic_energy_threshold [default: true] — Raise energy_threshold automatically to follow the background noise. Set false to keep energy_threshold fixed, e.g. when the noise lifts it above normal speech
- self_cancellation [default: true] — Do not recognize the audio when robot is speaking or not.
- tts_tolerance [default: 1.0] — Tolerance second for recognizing whether robot is speaking or not
- tts_action_names [default: ['sound_play']] — tts action name. these servers outputs are ignored by sound_recognition
- launch/parrotry.launch.xml
- ROS2 version of parrotry.launch (based on Michi-Tsubaki's ROS2 port of this package). julius_ros and aques_talk (use_google:=false and ja-JP in parrotry.launch) have no ROS2 port, so the speech engine is given by engine and the voice comes from sound_play.
-
- engine [default: Google]
- language [default: en-US]
- confidence_threshold [default: 0.8]
- tts_action_name [default: sound_play]
- launch/speech_recognition.launch.xml
- ROS2 version of speech_recognition.launch (based on Michi-Tsubaki's ROS2 port of this package)
-
- launch_sound_play [default: true]
- launch_audio_capture [default: true]
- audio_topic [default: /audio]
- voice_topic [default: /speech_to_text]
- n_channel [default: 1]
- depth [default: 16]
- sample_rate [default: 16000]
- device [default: ]
- engine [default: Google]
- language [default: en-US]
- continuous [default: true]
- auto_start [default: true]
- energy_threshold [default: 300.0]
- dynamic_energy_threshold [default: true]
- self_cancellation [default: true]
- tts_tolerance [default: 1.0]
- tts_action_names [default: ['sound_play']]
Messages
Services
Plugins
Recent questions tagged ros_speech_recognition at Robotics Stack Exchange
|
ros_speech_recognition package from jsk_3rdparty repovoicevox chaplus_ros emotion_analyzer gdrive_ros google_chat_ros influxdb_store jsk_power_switching_tools respeaker_ros ros_speech_recognition rospatlite sesame_ros switchbot_ros |
ROS Distro
|
Package Summary
| Version | 3.0.1 |
| License | BSD-3-Clause |
| Build type | CATKIN |
| Use | RECOMMENDED |
Repository Summary
| Description | |
| Checkout URI | https://github.com/jsk-ros-pkg/jsk_3rdparty.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2026-11-13 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Yuki Furuta
Authors
- Yuki Furuta
ros_speech_recognition
A ROS package for speech-to-text services.
This package uses Python package SpeechRecognition as a backend.
Tutorials
Normal tutorial
- Install this package and SpeechReconition
sudo apt install ros-${ROS_DISTRO}-ros-speech-recognition
- Launch speech recognition node
roslaunch ros_speech_recognition speech_recognition.launch
- Echo
/speech_to_text
rostopic echo /speech_to_text
# you can get the recognition result
Parrotry tutorial
Parrotry mean オウム返し in Japanese
# english
roslaunch ros_speech_recognition parrotry.launch
# japanese
roslaunch ros_speech_recognition parrotry.launch language:=ja-JP
ROS2
The same nodes run on ROS2 (built with colcon; SpeechRecognition and vosk
are installed into a venv of this package with uv at build time).
The dynamic reconfigure parameters (see Parameters) are ROS2
parameters, e.g. ros2 param set /speech_recognition language ja-JP.
The vosk models are downloaded into the installed share directory by
colcon build (with jsk_data, as on ROS1).
ros2 launch ros_speech_recognition speech_recognition.launch.xml
ros2 topic echo /speech_to_text
# parrotry (julius and aques_talk are not available, use engine:=... and sound_play)
ros2 launch ros_speech_recognition parrotry.launch.xml
Streaming recognition with Google Cloud (GoogleCloudStream)
In addition to the request/response GoogleCloud engine, a streaming engine
GoogleCloudStream is available. It uses the bidirectional gRPC
StreamingRecognize API and publishes interim hypotheses on
~voice_interim_topic while the user is still speaking, then publishes the
finalised utterance on ~voice_topic as usual.
roslaunch ros_speech_recognition speech_recognition.launch \
engine:=GoogleCloudStream \
language:=ja-JP \
google_cloud_credentials_json:=/path/to/credentials.json
Notes:
- Endpointing combines Google’s own
is_finalflag with a stability timer controlled by~google_cloud_endpoint_stable_s(default: 1.0 s). - The gRPC session has a 305 s server-side limit; the recognizer reconnects lazily on the next audio chunk, so long-running nodes are safe.
- When
~self_cancellationis enabled, the streaming session is torn down while a~tts_action_namesaction is active and reopened automatically afterwards to avoid recognising the robot’s own voice.
Example:
The following is an example of speech recognition using GoogleCloudStream.
Interim: shows intermediate recognition results, while Result: shows the final recognition result after the speaker finishes speaking.
```bash [INFO] [1792069200.711352]: Interim: こんにちは。 [INFO] [1792069201.701424]: Result: こんにちは。 [INFO] [1792069218.021376]: Interim: 今日? [INFO] [1792069218.196229]: Interim: 今日は! [INFO] [1792069218.621582]: Interim: 今日はいい? [INFO] [1792069218.710931]: Interim: 今日はいい天気。 [INFO] [1792069219.011066]: Interim: 今日はいい天気です。 [INFO] [1792069219.221464]: Interim: 今日はいい天気ですね。 [INFO] [1792069219.911446]: Interim: 今日はいい天気ですね。外 [INFO] [1792069220.090884]: Interim: 今日はいい天気ですね。外で。 [INFO] [1792069220.211304]: Interim: 今日はいい天気ですね。外で遊び。 [INFO] [1792069220.510955]: Interim: 今日はいい天気ですね。外で遊びませ。 [INFO] [1792069220.595351]: Interim: 今日はいい天気ですね。外で遊びません。 [INFO] [1792069220.814139]: Interim: 今日はいい天気ですね。外で遊びませんか?
File truncated at 100 lines see the full file
Changelog for package ros_speech_recognition
3.0.1 (2026-11-10)
- Merge pull request #583 from k-okada/rosdistro-55247-review rosdistro#55247 review: rename power_switching_tools_ros to jsk_power_switching_tools, fix licenses
- use SPDX license identifiers (BSD-3-Clause, Apache-2.0) in package.xml BSD -> BSD-3-Clause and Apache / "Apache License, Version 2.0" -> Apache-2.0 in all packages (ros/rosdistro#55247 review). The LICENSE files of all of them are BSD 3-Clause and Apache 2.0 respectively. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
- Contributors: Kei Okada
3.0.0 (2026-11-06)
-
Merge pull request #581 from k-okada/ros2-buildfarm-ros-environment Fix ROS2 buildfarm binary jobs: ros_environment, bundled flac, numpy wheel
-
[ros_speech_recognition, respeaker_ros] remove flac binaries bundled with SpeechRecognition from the uv venv The 32bit flac-linux-x86 fails dh_shlibdeps of the buildfarm binary job. SpeechRecognition uses the flac in PATH first, which is an exec_depend. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
[voicevox, chaplus_ros, emotion_analyzer, gdrive_ros, google_chat_ros, influxdb_store, power_switching_tools_ros, respeaker_ros, ros_speech_recognition, rospatlite, sesame_ros, switchbot_ros] depend on ros_environment for ROS2 buildfarm The buildfarm builds each package with only its own build dependencies, so without ros_environment $ROS_VERSION is empty and CMakeLists.txt takes the ROS1 branch (same as jsk_common#1835). voicevox also guesses ROS_VERSION from AMENT_PREFIX_PATH when it is unset. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
Merge pull request #580 from k-okada/ros2-google-cloud-stream [ros_speech_recognition] add GoogleCloudStream engine (ROS1/ROS2, rebase of #572)
-
[ros_speech_recognition] use google-cloud-speech for GoogleCloud engine The GoogleCloud engine used google-api-python-client and oauth2client, which are not declared as dependencies. When they are installed in the venv, oauth2client imports the system pyOpenSSL, which does not work with the cryptography installed by google-auth (AttributeError: module 'lib' has no attribute 'GEN_EMAIL'). Send the request with google-cloud-speech, already a dependency of the GoogleCloudStream engine. The config is still built as the REST JSON dict, so user_config (e.g. diarizationConfig) works as before, and show_all returns the same JSON dict. google-api-python-client is kept for python < 3.7, where google-cloud-speech is not available. Also send preferred_phrases as speechContexts (speechContext is not a field of RecognitionConfig), and remove a debug print.
-
[ros_speech_recognition] report GoogleCloudStream stream errors instead of ignoring them Errors of the gRPC stream were swallowed by [except Exception: pass]{.title-ref}, so an invalid credential or a disabled API looked like nothing was recognized.
- errors that reconnecting cannot fix (Unauthenticated, PermissionDenied, InvalidArgument, NotFound) are logged once with logerr and stop the streaming loop, instead of reconnecting on every audio chunk
- other errors (305s session limit, network) are logged with logwarn and the stream reconnects as before
- streams closed by stop_stream() (e.g. self cancellation) are not logged
-
[ros_speech_recognition] import numpy only for GoogleCloudStream engine python3 venv on kinetic/melodic can not see python-numpy (python2), and the engine is not available there anyway. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
[ros_speech_recognition] add google-cloud-speech and numpy dependencies google-cloud-speech requires python >= 3.7, so skip it on kinetic/melodic python3 venv with a pip environment marker, and add it to pyproject.toml/uv.lock for ROS2. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
[ros_speech_recognition] support GoogleCloudStream engine on both ROS1 and ROS2 use ros_compat instead of rospy, import GoogleCloudStreamingRecognizer only when the engine is selected (google-cloud-speech is not available on python2), add GoogleCloudStream to cfg/ros2 and utf-8 coding header. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
add speech_recognition samples using GoogleCloudStream for README.md (#13)
-
[ros_speech_recognition] log interim transcripts for GoogleCloudStream
-
[ros_speech_recognition] add GoogleCloudStream engine for streaming recognition Wrap google-cloud-speech v1 StreamingRecognize so the node can emit interim transcripts on ~voice_interim_topic while still publishing the finalised utterance on ~voice_topic.
File truncated at 100 lines see the full file
Package Dependencies
System Dependencies
Dependant Packages
Launch files
- launch/parrotry.launch
-
- use_google [default: true]
- language [default: en-US]
- confidence_threshold [default: 0.8]
- launch/speech_recognition.launch
-
- launch_sound_play [default: true] — Launch sound_play node to speak
- launch_audio_capture [default: true] — Launch audio_capture node to publish audio topic from microphone
- audio_topic [default: /audio] — Name of audio topic captured from microphone
- voice_topic [default: /speech_to_text] — Name of text topic of recognized speech
- n_channel [default: 1] — Number of channels of audio topic and microphone. '$ pactl list short sinks' to check your hardware
- depth [default: 16] — Bit depth of audio topic and microphone. '$ pactl list short sinks' to check your hardware
- sample_rate [default: 16000] — Frame rate of audio topic and microphone. '$ pactl list short sinks' to check your hardware
- device [default: ] — Card and device number of microphone (e.g. hw:0,0). you can check card number and device number by '$ arecord -l', then uses hw:[card number],[device number]
- engine [default: Google] — Speech to text engine. TTS engine, Google, GoogleCloud, Sphinx, Wit, Bing Houndify, IBM
- language [default: en-US] — Speech to text language. For Japanese, set ja-JP.
- continuous [default: true] — If false, /speech_recognition service is published. If true, /speech_to_text topic is published.
- auto_start [default: true] — Whether speech_recognition starts automatically or not. This parameter works when continuous is true
- energy_threshold [default: 300.0] — Minimum audio energy to consider for recording speech. Raise it if noise is taken for speech, lower it if quiet speech is missed
- dynamic_energy_threshold [default: true] — Raise energy_threshold automatically to follow the background noise. Set false to keep energy_threshold fixed, e.g. when the noise lifts it above normal speech
- self_cancellation [default: true] — Do not recognize the audio when robot is speaking or not.
- tts_tolerance [default: 1.0] — Tolerance second for recognizing whether robot is speaking or not
- tts_action_names [default: ['sound_play']] — tts action name. these servers outputs are ignored by sound_recognition
- launch/parrotry.launch.xml
- ROS2 version of parrotry.launch (based on Michi-Tsubaki's ROS2 port of this package). julius_ros and aques_talk (use_google:=false and ja-JP in parrotry.launch) have no ROS2 port, so the speech engine is given by engine and the voice comes from sound_play.
-
- engine [default: Google]
- language [default: en-US]
- confidence_threshold [default: 0.8]
- tts_action_name [default: sound_play]
- launch/speech_recognition.launch.xml
- ROS2 version of speech_recognition.launch (based on Michi-Tsubaki's ROS2 port of this package)
-
- launch_sound_play [default: true]
- launch_audio_capture [default: true]
- audio_topic [default: /audio]
- voice_topic [default: /speech_to_text]
- n_channel [default: 1]
- depth [default: 16]
- sample_rate [default: 16000]
- device [default: ]
- engine [default: Google]
- language [default: en-US]
- continuous [default: true]
- auto_start [default: true]
- energy_threshold [default: 300.0]
- dynamic_energy_threshold [default: true]
- self_cancellation [default: true]
- tts_tolerance [default: 1.0]
- tts_action_names [default: ['sound_play']]
Messages
Services
Plugins
Recent questions tagged ros_speech_recognition at Robotics Stack Exchange
|
ros_speech_recognition package from jsk_3rdparty repovoicevox chaplus_ros emotion_analyzer gdrive_ros google_chat_ros influxdb_store jsk_power_switching_tools respeaker_ros ros_speech_recognition rospatlite sesame_ros switchbot_ros |
ROS Distro
|
Package Summary
| Version | 3.0.1 |
| License | BSD-3-Clause |
| Build type | CATKIN |
| Use | RECOMMENDED |
Repository Summary
| Description | |
| Checkout URI | https://github.com/jsk-ros-pkg/jsk_3rdparty.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2026-11-13 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Yuki Furuta
Authors
- Yuki Furuta
ros_speech_recognition
A ROS package for speech-to-text services.
This package uses Python package SpeechRecognition as a backend.
Tutorials
Normal tutorial
- Install this package and SpeechReconition
sudo apt install ros-${ROS_DISTRO}-ros-speech-recognition
- Launch speech recognition node
roslaunch ros_speech_recognition speech_recognition.launch
- Echo
/speech_to_text
rostopic echo /speech_to_text
# you can get the recognition result
Parrotry tutorial
Parrotry mean オウム返し in Japanese
# english
roslaunch ros_speech_recognition parrotry.launch
# japanese
roslaunch ros_speech_recognition parrotry.launch language:=ja-JP
ROS2
The same nodes run on ROS2 (built with colcon; SpeechRecognition and vosk
are installed into a venv of this package with uv at build time).
The dynamic reconfigure parameters (see Parameters) are ROS2
parameters, e.g. ros2 param set /speech_recognition language ja-JP.
The vosk models are downloaded into the installed share directory by
colcon build (with jsk_data, as on ROS1).
ros2 launch ros_speech_recognition speech_recognition.launch.xml
ros2 topic echo /speech_to_text
# parrotry (julius and aques_talk are not available, use engine:=... and sound_play)
ros2 launch ros_speech_recognition parrotry.launch.xml
Streaming recognition with Google Cloud (GoogleCloudStream)
In addition to the request/response GoogleCloud engine, a streaming engine
GoogleCloudStream is available. It uses the bidirectional gRPC
StreamingRecognize API and publishes interim hypotheses on
~voice_interim_topic while the user is still speaking, then publishes the
finalised utterance on ~voice_topic as usual.
roslaunch ros_speech_recognition speech_recognition.launch \
engine:=GoogleCloudStream \
language:=ja-JP \
google_cloud_credentials_json:=/path/to/credentials.json
Notes:
- Endpointing combines Google’s own
is_finalflag with a stability timer controlled by~google_cloud_endpoint_stable_s(default: 1.0 s). - The gRPC session has a 305 s server-side limit; the recognizer reconnects lazily on the next audio chunk, so long-running nodes are safe.
- When
~self_cancellationis enabled, the streaming session is torn down while a~tts_action_namesaction is active and reopened automatically afterwards to avoid recognising the robot’s own voice.
Example:
The following is an example of speech recognition using GoogleCloudStream.
Interim: shows intermediate recognition results, while Result: shows the final recognition result after the speaker finishes speaking.
```bash [INFO] [1792069200.711352]: Interim: こんにちは。 [INFO] [1792069201.701424]: Result: こんにちは。 [INFO] [1792069218.021376]: Interim: 今日? [INFO] [1792069218.196229]: Interim: 今日は! [INFO] [1792069218.621582]: Interim: 今日はいい? [INFO] [1792069218.710931]: Interim: 今日はいい天気。 [INFO] [1792069219.011066]: Interim: 今日はいい天気です。 [INFO] [1792069219.221464]: Interim: 今日はいい天気ですね。 [INFO] [1792069219.911446]: Interim: 今日はいい天気ですね。外 [INFO] [1792069220.090884]: Interim: 今日はいい天気ですね。外で。 [INFO] [1792069220.211304]: Interim: 今日はいい天気ですね。外で遊び。 [INFO] [1792069220.510955]: Interim: 今日はいい天気ですね。外で遊びませ。 [INFO] [1792069220.595351]: Interim: 今日はいい天気ですね。外で遊びません。 [INFO] [1792069220.814139]: Interim: 今日はいい天気ですね。外で遊びませんか?
File truncated at 100 lines see the full file
Changelog for package ros_speech_recognition
3.0.1 (2026-11-10)
- Merge pull request #583 from k-okada/rosdistro-55247-review rosdistro#55247 review: rename power_switching_tools_ros to jsk_power_switching_tools, fix licenses
- use SPDX license identifiers (BSD-3-Clause, Apache-2.0) in package.xml BSD -> BSD-3-Clause and Apache / "Apache License, Version 2.0" -> Apache-2.0 in all packages (ros/rosdistro#55247 review). The LICENSE files of all of them are BSD 3-Clause and Apache 2.0 respectively. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
- Contributors: Kei Okada
3.0.0 (2026-11-06)
-
Merge pull request #581 from k-okada/ros2-buildfarm-ros-environment Fix ROS2 buildfarm binary jobs: ros_environment, bundled flac, numpy wheel
-
[ros_speech_recognition, respeaker_ros] remove flac binaries bundled with SpeechRecognition from the uv venv The 32bit flac-linux-x86 fails dh_shlibdeps of the buildfarm binary job. SpeechRecognition uses the flac in PATH first, which is an exec_depend. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
[voicevox, chaplus_ros, emotion_analyzer, gdrive_ros, google_chat_ros, influxdb_store, power_switching_tools_ros, respeaker_ros, ros_speech_recognition, rospatlite, sesame_ros, switchbot_ros] depend on ros_environment for ROS2 buildfarm The buildfarm builds each package with only its own build dependencies, so without ros_environment $ROS_VERSION is empty and CMakeLists.txt takes the ROS1 branch (same as jsk_common#1835). voicevox also guesses ROS_VERSION from AMENT_PREFIX_PATH when it is unset. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
Merge pull request #580 from k-okada/ros2-google-cloud-stream [ros_speech_recognition] add GoogleCloudStream engine (ROS1/ROS2, rebase of #572)
-
[ros_speech_recognition] use google-cloud-speech for GoogleCloud engine The GoogleCloud engine used google-api-python-client and oauth2client, which are not declared as dependencies. When they are installed in the venv, oauth2client imports the system pyOpenSSL, which does not work with the cryptography installed by google-auth (AttributeError: module 'lib' has no attribute 'GEN_EMAIL'). Send the request with google-cloud-speech, already a dependency of the GoogleCloudStream engine. The config is still built as the REST JSON dict, so user_config (e.g. diarizationConfig) works as before, and show_all returns the same JSON dict. google-api-python-client is kept for python < 3.7, where google-cloud-speech is not available. Also send preferred_phrases as speechContexts (speechContext is not a field of RecognitionConfig), and remove a debug print.
-
[ros_speech_recognition] report GoogleCloudStream stream errors instead of ignoring them Errors of the gRPC stream were swallowed by [except Exception: pass]{.title-ref}, so an invalid credential or a disabled API looked like nothing was recognized.
- errors that reconnecting cannot fix (Unauthenticated, PermissionDenied, InvalidArgument, NotFound) are logged once with logerr and stop the streaming loop, instead of reconnecting on every audio chunk
- other errors (305s session limit, network) are logged with logwarn and the stream reconnects as before
- streams closed by stop_stream() (e.g. self cancellation) are not logged
-
[ros_speech_recognition] import numpy only for GoogleCloudStream engine python3 venv on kinetic/melodic can not see python-numpy (python2), and the engine is not available there anyway. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
[ros_speech_recognition] add google-cloud-speech and numpy dependencies google-cloud-speech requires python >= 3.7, so skip it on kinetic/melodic python3 venv with a pip environment marker, and add it to pyproject.toml/uv.lock for ROS2. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
[ros_speech_recognition] support GoogleCloudStream engine on both ROS1 and ROS2 use ros_compat instead of rospy, import GoogleCloudStreamingRecognizer only when the engine is selected (google-cloud-speech is not available on python2), add GoogleCloudStream to cfg/ros2 and utf-8 coding header. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
add speech_recognition samples using GoogleCloudStream for README.md (#13)
-
[ros_speech_recognition] log interim transcripts for GoogleCloudStream
-
[ros_speech_recognition] add GoogleCloudStream engine for streaming recognition Wrap google-cloud-speech v1 StreamingRecognize so the node can emit interim transcripts on ~voice_interim_topic while still publishing the finalised utterance on ~voice_topic.
File truncated at 100 lines see the full file
Package Dependencies
System Dependencies
Dependant Packages
Launch files
- launch/parrotry.launch
-
- use_google [default: true]
- language [default: en-US]
- confidence_threshold [default: 0.8]
- launch/speech_recognition.launch
-
- launch_sound_play [default: true] — Launch sound_play node to speak
- launch_audio_capture [default: true] — Launch audio_capture node to publish audio topic from microphone
- audio_topic [default: /audio] — Name of audio topic captured from microphone
- voice_topic [default: /speech_to_text] — Name of text topic of recognized speech
- n_channel [default: 1] — Number of channels of audio topic and microphone. '$ pactl list short sinks' to check your hardware
- depth [default: 16] — Bit depth of audio topic and microphone. '$ pactl list short sinks' to check your hardware
- sample_rate [default: 16000] — Frame rate of audio topic and microphone. '$ pactl list short sinks' to check your hardware
- device [default: ] — Card and device number of microphone (e.g. hw:0,0). you can check card number and device number by '$ arecord -l', then uses hw:[card number],[device number]
- engine [default: Google] — Speech to text engine. TTS engine, Google, GoogleCloud, Sphinx, Wit, Bing Houndify, IBM
- language [default: en-US] — Speech to text language. For Japanese, set ja-JP.
- continuous [default: true] — If false, /speech_recognition service is published. If true, /speech_to_text topic is published.
- auto_start [default: true] — Whether speech_recognition starts automatically or not. This parameter works when continuous is true
- energy_threshold [default: 300.0] — Minimum audio energy to consider for recording speech. Raise it if noise is taken for speech, lower it if quiet speech is missed
- dynamic_energy_threshold [default: true] — Raise energy_threshold automatically to follow the background noise. Set false to keep energy_threshold fixed, e.g. when the noise lifts it above normal speech
- self_cancellation [default: true] — Do not recognize the audio when robot is speaking or not.
- tts_tolerance [default: 1.0] — Tolerance second for recognizing whether robot is speaking or not
- tts_action_names [default: ['sound_play']] — tts action name. these servers outputs are ignored by sound_recognition
- launch/parrotry.launch.xml
- ROS2 version of parrotry.launch (based on Michi-Tsubaki's ROS2 port of this package). julius_ros and aques_talk (use_google:=false and ja-JP in parrotry.launch) have no ROS2 port, so the speech engine is given by engine and the voice comes from sound_play.
-
- engine [default: Google]
- language [default: en-US]
- confidence_threshold [default: 0.8]
- tts_action_name [default: sound_play]
- launch/speech_recognition.launch.xml
- ROS2 version of speech_recognition.launch (based on Michi-Tsubaki's ROS2 port of this package)
-
- launch_sound_play [default: true]
- launch_audio_capture [default: true]
- audio_topic [default: /audio]
- voice_topic [default: /speech_to_text]
- n_channel [default: 1]
- depth [default: 16]
- sample_rate [default: 16000]
- device [default: ]
- engine [default: Google]
- language [default: en-US]
- continuous [default: true]
- auto_start [default: true]
- energy_threshold [default: 300.0]
- dynamic_energy_threshold [default: true]
- self_cancellation [default: true]
- tts_tolerance [default: 1.0]
- tts_action_names [default: ['sound_play']]
Messages
Services
Plugins
Recent questions tagged ros_speech_recognition at Robotics Stack Exchange
|
ros_speech_recognition package from jsk_3rdparty repovoicevox chaplus_ros emotion_analyzer gdrive_ros google_chat_ros influxdb_store jsk_power_switching_tools respeaker_ros ros_speech_recognition rospatlite sesame_ros switchbot_ros |
ROS Distro
|
Package Summary
| Version | 3.0.1 |
| License | BSD-3-Clause |
| Build type | CATKIN |
| Use | RECOMMENDED |
Repository Summary
| Description | |
| Checkout URI | https://github.com/jsk-ros-pkg/jsk_3rdparty.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2026-11-13 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Additional Links
Maintainers
- Yuki Furuta
Authors
- Yuki Furuta
ros_speech_recognition
A ROS package for speech-to-text services.
This package uses Python package SpeechRecognition as a backend.
Tutorials
Normal tutorial
- Install this package and SpeechReconition
sudo apt install ros-${ROS_DISTRO}-ros-speech-recognition
- Launch speech recognition node
roslaunch ros_speech_recognition speech_recognition.launch
- Echo
/speech_to_text
rostopic echo /speech_to_text
# you can get the recognition result
Parrotry tutorial
Parrotry mean オウム返し in Japanese
# english
roslaunch ros_speech_recognition parrotry.launch
# japanese
roslaunch ros_speech_recognition parrotry.launch language:=ja-JP
ROS2
The same nodes run on ROS2 (built with colcon; SpeechRecognition and vosk
are installed into a venv of this package with uv at build time).
The dynamic reconfigure parameters (see Parameters) are ROS2
parameters, e.g. ros2 param set /speech_recognition language ja-JP.
The vosk models are downloaded into the installed share directory by
colcon build (with jsk_data, as on ROS1).
ros2 launch ros_speech_recognition speech_recognition.launch.xml
ros2 topic echo /speech_to_text
# parrotry (julius and aques_talk are not available, use engine:=... and sound_play)
ros2 launch ros_speech_recognition parrotry.launch.xml
Streaming recognition with Google Cloud (GoogleCloudStream)
In addition to the request/response GoogleCloud engine, a streaming engine
GoogleCloudStream is available. It uses the bidirectional gRPC
StreamingRecognize API and publishes interim hypotheses on
~voice_interim_topic while the user is still speaking, then publishes the
finalised utterance on ~voice_topic as usual.
roslaunch ros_speech_recognition speech_recognition.launch \
engine:=GoogleCloudStream \
language:=ja-JP \
google_cloud_credentials_json:=/path/to/credentials.json
Notes:
- Endpointing combines Google’s own
is_finalflag with a stability timer controlled by~google_cloud_endpoint_stable_s(default: 1.0 s). - The gRPC session has a 305 s server-side limit; the recognizer reconnects lazily on the next audio chunk, so long-running nodes are safe.
- When
~self_cancellationis enabled, the streaming session is torn down while a~tts_action_namesaction is active and reopened automatically afterwards to avoid recognising the robot’s own voice.
Example:
The following is an example of speech recognition using GoogleCloudStream.
Interim: shows intermediate recognition results, while Result: shows the final recognition result after the speaker finishes speaking.
```bash [INFO] [1792069200.711352]: Interim: こんにちは。 [INFO] [1792069201.701424]: Result: こんにちは。 [INFO] [1792069218.021376]: Interim: 今日? [INFO] [1792069218.196229]: Interim: 今日は! [INFO] [1792069218.621582]: Interim: 今日はいい? [INFO] [1792069218.710931]: Interim: 今日はいい天気。 [INFO] [1792069219.011066]: Interim: 今日はいい天気です。 [INFO] [1792069219.221464]: Interim: 今日はいい天気ですね。 [INFO] [1792069219.911446]: Interim: 今日はいい天気ですね。外 [INFO] [1792069220.090884]: Interim: 今日はいい天気ですね。外で。 [INFO] [1792069220.211304]: Interim: 今日はいい天気ですね。外で遊び。 [INFO] [1792069220.510955]: Interim: 今日はいい天気ですね。外で遊びませ。 [INFO] [1792069220.595351]: Interim: 今日はいい天気ですね。外で遊びません。 [INFO] [1792069220.814139]: Interim: 今日はいい天気ですね。外で遊びませんか?
File truncated at 100 lines see the full file
Changelog for package ros_speech_recognition
3.0.1 (2026-11-10)
- Merge pull request #583 from k-okada/rosdistro-55247-review rosdistro#55247 review: rename power_switching_tools_ros to jsk_power_switching_tools, fix licenses
- use SPDX license identifiers (BSD-3-Clause, Apache-2.0) in package.xml BSD -> BSD-3-Clause and Apache / "Apache License, Version 2.0" -> Apache-2.0 in all packages (ros/rosdistro#55247 review). The LICENSE files of all of them are BSD 3-Clause and Apache 2.0 respectively. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
- Contributors: Kei Okada
3.0.0 (2026-11-06)
-
Merge pull request #581 from k-okada/ros2-buildfarm-ros-environment Fix ROS2 buildfarm binary jobs: ros_environment, bundled flac, numpy wheel
-
[ros_speech_recognition, respeaker_ros] remove flac binaries bundled with SpeechRecognition from the uv venv The 32bit flac-linux-x86 fails dh_shlibdeps of the buildfarm binary job. SpeechRecognition uses the flac in PATH first, which is an exec_depend. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
[voicevox, chaplus_ros, emotion_analyzer, gdrive_ros, google_chat_ros, influxdb_store, power_switching_tools_ros, respeaker_ros, ros_speech_recognition, rospatlite, sesame_ros, switchbot_ros] depend on ros_environment for ROS2 buildfarm The buildfarm builds each package with only its own build dependencies, so without ros_environment $ROS_VERSION is empty and CMakeLists.txt takes the ROS1 branch (same as jsk_common#1835). voicevox also guesses ROS_VERSION from AMENT_PREFIX_PATH when it is unset. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
Merge pull request #580 from k-okada/ros2-google-cloud-stream [ros_speech_recognition] add GoogleCloudStream engine (ROS1/ROS2, rebase of #572)
-
[ros_speech_recognition] use google-cloud-speech for GoogleCloud engine The GoogleCloud engine used google-api-python-client and oauth2client, which are not declared as dependencies. When they are installed in the venv, oauth2client imports the system pyOpenSSL, which does not work with the cryptography installed by google-auth (AttributeError: module 'lib' has no attribute 'GEN_EMAIL'). Send the request with google-cloud-speech, already a dependency of the GoogleCloudStream engine. The config is still built as the REST JSON dict, so user_config (e.g. diarizationConfig) works as before, and show_all returns the same JSON dict. google-api-python-client is kept for python < 3.7, where google-cloud-speech is not available. Also send preferred_phrases as speechContexts (speechContext is not a field of RecognitionConfig), and remove a debug print.
-
[ros_speech_recognition] report GoogleCloudStream stream errors instead of ignoring them Errors of the gRPC stream were swallowed by [except Exception: pass]{.title-ref}, so an invalid credential or a disabled API looked like nothing was recognized.
- errors that reconnecting cannot fix (Unauthenticated, PermissionDenied, InvalidArgument, NotFound) are logged once with logerr and stop the streaming loop, instead of reconnecting on every audio chunk
- other errors (305s session limit, network) are logged with logwarn and the stream reconnects as before
- streams closed by stop_stream() (e.g. self cancellation) are not logged
-
[ros_speech_recognition] import numpy only for GoogleCloudStream engine python3 venv on kinetic/melodic can not see python-numpy (python2), and the engine is not available there anyway. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
[ros_speech_recognition] add google-cloud-speech and numpy dependencies google-cloud-speech requires python >= 3.7, so skip it on kinetic/melodic python3 venv with a pip environment marker, and add it to pyproject.toml/uv.lock for ROS2. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
[ros_speech_recognition] support GoogleCloudStream engine on both ROS1 and ROS2 use ros_compat instead of rospy, import GoogleCloudStreamingRecognizer only when the engine is selected (google-cloud-speech is not available on python2), add GoogleCloudStream to cfg/ros2 and utf-8 coding header. Co-Authored-By: Claude Opus 5.5 <<noreply@anthropic.com>>
-
add speech_recognition samples using GoogleCloudStream for README.md (#13)
-
[ros_speech_recognition] log interim transcripts for GoogleCloudStream
-
[ros_speech_recognition] add GoogleCloudStream engine for streaming recognition Wrap google-cloud-speech v1 StreamingRecognize so the node can emit interim transcripts on ~voice_interim_topic while still publishing the finalised utterance on ~voice_topic.
File truncated at 100 lines see the full file
Package Dependencies
System Dependencies
Dependant Packages
Launch files
- launch/parrotry.launch
-
- use_google [default: true]
- language [default: en-US]
- confidence_threshold [default: 0.8]
- launch/speech_recognition.launch
-
- launch_sound_play [default: true] — Launch sound_play node to speak
- launch_audio_capture [default: true] — Launch audio_capture node to publish audio topic from microphone
- audio_topic [default: /audio] — Name of audio topic captured from microphone
- voice_topic [default: /speech_to_text] — Name of text topic of recognized speech
- n_channel [default: 1] — Number of channels of audio topic and microphone. '$ pactl list short sinks' to check your hardware
- depth [default: 16] — Bit depth of audio topic and microphone. '$ pactl list short sinks' to check your hardware
- sample_rate [default: 16000] — Frame rate of audio topic and microphone. '$ pactl list short sinks' to check your hardware
- device [default: ] — Card and device number of microphone (e.g. hw:0,0). you can check card number and device number by '$ arecord -l', then uses hw:[card number],[device number]
- engine [default: Google] — Speech to text engine. TTS engine, Google, GoogleCloud, Sphinx, Wit, Bing Houndify, IBM
- language [default: en-US] — Speech to text language. For Japanese, set ja-JP.
- continuous [default: true] — If false, /speech_recognition service is published. If true, /speech_to_text topic is published.
- auto_start [default: true] — Whether speech_recognition starts automatically or not. This parameter works when continuous is true
- energy_threshold [default: 300.0] — Minimum audio energy to consider for recording speech. Raise it if noise is taken for speech, lower it if quiet speech is missed
- dynamic_energy_threshold [default: true] — Raise energy_threshold automatically to follow the background noise. Set false to keep energy_threshold fixed, e.g. when the noise lifts it above normal speech
- self_cancellation [default: true] — Do not recognize the audio when robot is speaking or not.
- tts_tolerance [default: 1.0] — Tolerance second for recognizing whether robot is speaking or not
- tts_action_names [default: ['sound_play']] — tts action name. these servers outputs are ignored by sound_recognition
- launch/parrotry.launch.xml
- ROS2 version of parrotry.launch (based on Michi-Tsubaki's ROS2 port of this package). julius_ros and aques_talk (use_google:=false and ja-JP in parrotry.launch) have no ROS2 port, so the speech engine is given by engine and the voice comes from sound_play.
-
- engine [default: Google]
- language [default: en-US]
- confidence_threshold [default: 0.8]
- tts_action_name [default: sound_play]
- launch/speech_recognition.launch.xml
- ROS2 version of speech_recognition.launch (based on Michi-Tsubaki's ROS2 port of this package)
-
- launch_sound_play [default: true]
- launch_audio_capture [default: true]
- audio_topic [default: /audio]
- voice_topic [default: /speech_to_text]
- n_channel [default: 1]
- depth [default: 16]
- sample_rate [default: 16000]
- device [default: ]
- engine [default: Google]
- language [default: en-US]
- continuous [default: true]
- auto_start [default: true]
- energy_threshold [default: 300.0]
- dynamic_energy_threshold [default: true]
- self_cancellation [default: true]
- tts_tolerance [default: 1.0]
- tts_action_names [default: ['sound_play']]