ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

audio_capture adjustible

asked 2015-06-12 02:21:52 -0500

Saragossa gravatar image

I was wondering whether audio_capture has these capabilities:

How can i set different recording parameters: e.g. 16bit resolution, WAV output and 44 Hz sampling frequency? How can i play a prerecorded .wav file to the /audio topic.

Are there any other solutions to stream audio data in binary form on a ROS topic?! Thanks for your help,

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-06-12 16:04:25 -0500

lucasw gravatar image

It looks like https://github.com/ros-drivers/audio_... is a thin wrapper around GStreamer, which is very flexible, but the wrapper itself is mostly hardcoded. The source is set to alsasrc (when you would want it to be filesrc, unless you can play your file into alsasrc), and the only parameter is for bitrate, but that is mp3 bitrate.

The encoder is set to lame, which I think means only mp3:

    _encode = gst_element_factory_make("lame", "encoder");

It might be a learning curve to use the gstreamer api but maybe not too hard to hack the existing audio_capture to do what you want (and maybe there are gstreamer experts on stackoverflow)- or even better extend it and push the changes back into the public repo.

edit flag offensive delete link more

Comments

Thanks for your response. I have typed sth. together based on audio_capture that lets me get the rate and format i want. however, it's nowhere as configurable as it could be writen by a gst-expert. The "filesrc" thing is commented by default in the master so i assume sth is wrong with it...

Saragossa gravatar image Saragossa  ( 2015-06-15 03:39:05 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-06-12 02:21:52 -0500

Seen: 300 times

Last updated: Jun 12 '15