Giter Site home page Giter Site logo

audio_file_player's Introduction

audio_file_player

audio_file_player offers a simple way to play audio files through an action server interface and a topic interface.

By default it uses sox's play to play the audio files (as it plays more file types than for example aplay). You may need to install:

sudo apt-get install sox libsox-fmt-all

Example usage

You can find an example mp3 file in this package in the folder assets, called tada.mp3.

Launch the node:

roslaunch audio_file_player audio_file_player.launch

Try the topic interface:

rostopic pub /audio_file_player/play std_msgs/String `rospack find audio_file_player`/assets/tada.mp3

Try the actionlib interface:

rosrun actionlib axclient.py /audio_file_player

Use your own playing script

If you want to use your own command for playing the files (or even use this node for some other purpose) just modify the launch file to use the command and flags that you want:

<launch>
    <node pkg="audio_file_player" name="audio_file_player" type="play_file_server.py" output="screen">
        <!-- Parameters to change the player to use other commands, flags and the rate (Hz) at which
        the feedback is published, this is equivalent to the default configuration -->
        <param name="command" value="play"/>
        <param name="flags" value=""/>
        <param name="feedback_rate" value="10"/>
    </node>
</launch>

Extra: Volume manager

You have a tiny node to get and set the volume via a std_msgs/Int8 topic (values 0-100 representing the percentage of volume) in the scripts folder with it's launch file:

roslaunch audio_file_player volume_manager.launch

By default the topics are:

    /volume_manager/get_volume
    /volume_manager/set_volume

audio_file_player's People

Contributors

awesomebytes avatar

Stargazers

Göknur Derinöz avatar  avatar Cristopher avatar Xun avatar Jesse Clark avatar Brett avatar

Watchers

Jesse Clark avatar James Cloos avatar  avatar Benjamin Johnston avatar Xun avatar Nima Ramezani Taghiabadi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.