0
$\begingroup$

Rosanswers logo

Hi!

I am TOTALLY new in ROS. I have a package consisting of two ROS modules where the first module takes input from a microphone and saves it as a ".wav" file. I want this module to publish this ".wav"-file to a topic so that the other ROS module is able to receive it(subscribe the topic). How do I do this? I have been looking at the ROS package called audio_common, but I cant figure out how to do it. Do I need to convert the ".wav"-file into bytes and stuff before sending? I have no idea!

Any advices would help here!


Originally posted by steinaak on ROS Answers with karma: 151 on 2016-03-05

Post score: 1


Original comments

Comment by ahendrix on 2016-03-05:
Are you trying to stream audio, or are you trying to capture short bursts? What are you trying to do with the audio samples in the receiving node?

Comment by steinaak on 2016-03-06:
Hey! Now, the microphone module captures small bursts(.wav files with duration up to 10 seconds). The other module will receive this audio(if I am able to solve that problem) and make a call to an API to translate the speech into text. What message type should I use? And how to do it?

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

There isn't a good audio transport convention in ROS. audio_common_msgs provides the AudioData message, but there's no documented convention about what data it's supposed to carry, and no way to indicate which format the data is in. audio_capture usually uses it for transporting chunks of MP3 streams, but you could use it for wav data too. If you need any kind of metadata with your audio, you should create your own message.

In practice, if you want to do speech recognition I'd recommend the ROS pocketsphinx package. It's what most ROS users use for speech recognition, and it's reasonably well maintained. The only place where it may not work is if you want to do the audio capture and speech processing on two different computers.


Originally posted by ahendrix with karma: 47576 on 2016-03-06

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by steinaak on 2016-03-06:
Thank you very much for your reply! I have had a look at the pocketsphinx package already, but it seems like you have to build the vocabulary of words to recognize yourself? Or does the pocketsphinx include a vocabulary so it is able to recognize speech already?

Comment by ahendrix on 2016-03-06:
There are two varieties of speech recognition - dictation and vocabulary-based recognizers. Vocabulary-based recognizers are usually good for commands. Dictation recognizers use a much larger vocabulary are are usually good for "speech typing".

Comment by steinaak on 2016-03-07:
Thank you! Is there a dictation-recognizer in pocketsphinx that works well?

Comment by ahendrix on 2016-03-07:
I'm not aware of anyone using pocketsphinx for dictation.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.