To get started, clone the repository into your ROS workspace, build with catkin build and source devel/setup.bash.
When compiling on Ubuntu 16.04, there can be a missing package issue - make sure GStreamer is installed.
Here is an installation command for Ubuntu or Debian:
sudo apt-get install libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio libgstreamer-plugins-base1.0-dev
For user documentation, please refer to the ROS Wiki page for audio_common
To be able to record sounds coming from the computer:
- Move the
.asoundrcfile to the user directory (~/) - Edit the file: replace both instances of
#NAMEwith the name of the Monitor Source. To find the name of the Monitor Source, typepactl listinto terminal and use the Search function. See example (the name is in the red rectangle):
- Log out the user and log back in for the change to take effect.
roslaunch audio_capture capture_all.launchstarts publishing audio from built-in microphone to /audio_mic/audio and onboard sounds to /audio_onboard/audio topicsroslaunch audio_capture capture_all_bag.launchsame as above + launches an audio_bagger node, which starts and stops rosbagging audio based on a Bool from the record_audio topic; for examplerostopic pub record_audio std_msgs/Bool 1starts the rosbagging.
roslaunch audio_play play_all.launchplays audio published to /audio_mic/audio and /audio_onboard/audio topics. Userosbag playto supply the audio.
NOTE: The mic and onboard audio is out of sync by a few seconds.