Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[respeaker_ros] Add documentation for displaying Japanese /speech_to_text #352

Merged
merged 3 commits into from
Jun 27, 2022

Conversation

tkmtnt7000
Copy link
Member

This PR adds documentation for getting readable Japanese voice recognition results from rostopic echo.
Users sometimes had a problem that they don't know making Japanese voice recognition results readable through rostopic echo and where the example code is.

Examples

$ rostopic echo --filter "print(m.transcript[0])" /speech_to_text
こんにちは

c.f. jsk-ros-pkg/jsk_demos#1347 (comment), jsk-ros-pkg/jsk_demos#1347 (comment)

k-okada@p51s:~$ rostopic echo /text
data: !!python/str "\u3053\u3093\u306B\u3061\u306F 1636542913.42"
---
data: !!python/str "\u3053\u3093\u306B\u3061\u306F 1636542913.52"
^Ck-okada@p51s:~$ rostopic echo /text | ascii2uni -a U -q
data: !!python/str "こんにちは 1636542916.02"
rostopic echo --filter "print('transcript: [%s]\n---'%(', '.join(map(lambda x: '\'%s\''%(x.decode('utf-8')), m.transcript))))" /speech_to_text
transcript: [' こんにちは 。', ' こんにちは あ 。', ' 今日 わ 。', ' こんにちは は 。', ' 今日 は 。']

rostopic echo /speech_to_text # Voice recognition
# Voice recognition result for Japanese
rostopic echo --filter "print(m.transcript[0])" /speech_to_text
rostopic echo --filter "print('transcript: [%s]\n---'%(', '.join(map(lambda x: '\'%s\''%(x.decode('utf-8')), m.transcript))))" /speech_to_text
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work with python3 (noetic)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, it doesn't work with python3. Thank you for letting me know.
I drop this line.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have also confirmed that the others work well with python3.

rostopic echo /speech_to_text # Voice recognition
# Voice recognition result for Japanese
rostopic echo --filter "print(m.transcript[0])" /speech_to_text
rostopic echo /speech_to_text | ascii2uni -a U -q
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rostopic echo --filter "print('transcript: [%s]\n---'%(', '.join(map(str, m.transcript))))" /speech_to_text is good?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's ok to use it. I'll add.

@k-okada k-okada merged commit c9af824 into jsk-ros-pkg:master Jun 27, 2022
@tkmtnt7000 tkmtnt7000 deleted the PR-add-speech-to-text-readme branch June 27, 2022 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants