ROS nodes and utilities for audio streams.
Author(s): Marc-Antoine Maheux
The following subsections explain how to use the library on Ubuntu.
sudo apt-get install cmake build-essential gfortran texinfo libasound2-dev
git submodule update --init --recursive
This node captures the sound from an ALSA device and publishes it to a topic.
device
(string): The ALSA device to capture (ex:hw:CARD=1,DEV=0
).format
(string): The audio format (see audio_utils/AudioFrame).channel_count
(int): The device channel count.sampling_frequency
(int): The device sampling frequency.frame_sample_count
(int): The number of samples in each frame.merge
(bool): Indicate to merge the channels or not.merge_gain
: The gain to apply after the merge.
audio_out
(audio_utils/AudioFrame) The captured sound.
This node captures the sound from a topic and plays it to an ALSA device.
device
(string): The ALSA device to capture (ex:hw:CARD=1,DEV=0
).format
(string): The audio format (see audio_utils/AudioFrame).channel_count
(int): The device channel count.sampling_frequency
(int): The device sampling frequency.frame_sample_count
(int): The number of samples in each frame.
audio_in
(audio_utils/AudioFrame) The sound to play.
This node estimates the song tempo and detects if the beat is in the current frame.
audio_in
(audio_utils/AudioFrame) The sound to analyze. The channel count must be 1, the sampling frequency must be 44100 Hz and the frame sample count must be 256.
bpm
(std_msgs/Float32): The tempo in bpm (beats per minute) for each frame.beat
(std_msgs/Bool): Indicate if the beat is in the current frame.
This node converts the format of an audio topic.
input_format
(string): The input audio format (see audio_utils/AudioFrame).output_format
(string): The output audio format (see audio_utils/AudioFrame).
audio_in
(audio_utils/AudioFrame) The sound topic to convert.
audio_out
(audio_utils/AudioFrame) The converted sound.
This node resamples an audio topic.
input_format
(string): The input audio format (see audio_utils/AudioFrame).output_format
(string): The output audio format (see audio_utils/AudioFrame).channel_count
(int): The device channel count.input_sampling_frequency
(int): The input sampling frequency.output_sampling_frequency
(int): The output sampling frequency.input_frame_sample_count
(int): The number of samples in each frame of the input.
audio_in
(audio_utils/AudioFrame) The sound topic to resample.
audio_out
(audio_utils/AudioFrame) The resampled sound.
This node split a multichannel audio topic into several mono audio topics.
input_format
(string): The input audio format (see audio_utils/AudioFrame).output_format
(string): The output audio format (see audio_utils/AudioFrame).channel_count
(int): The device channel count.
audio_in
(audio_utils/AudioFrame) The sound topic to split.
audio_out_0
(audio_utils/AudioFrame) The first channel sound.audio_out_1
(audio_utils/AudioFrame) The second channel sound.- ...
This node writes the raw sound data to a file.
output_path
(string): The output file path.
audio_in
(audio_utils/AudioFrame) The sound topic to write.