

Plays one of the built-in sounds based on its integer ID. Usage: /u/blaise/ros/ros-pkg/stacks/sound_drivers/sound_play/scripts/playbuiltin.py Some standard sounds are built-into the driver, and can be played only by specifying their integer identifier using playbuiltin.py. Playing "/usr/share/xemacs21/xemacs-packages/etc/sounds/im_so_happy.wav". The path to the file should be absolute, and be valid on the computer on which sound_play is running.įor example (soundplay_node.py should be running first): $rosrun sound_play play.py /usr/share/xemacs21/xemacs-packages/etc/sounds/im_so_happy.wav Usage: /u/blaise/ros/ros-pkg/stacks/sound_drivers/sound_play/scripts/play.py sound_to_play.(ogg|wav)

The file must be available on the computer on which soundplay_node.py is running, and an absolute path should be given. For help on getting soundplay_node.py running refer to the tutorial. The following utilities can be used to play sound when soundplay_node.py is running. Documentation of the language bindings are in doxygen. It should be unnecessary to directly generate messages when playing sounds from C++ or Python.
#Play sounds python code#
(VS Code needs to be connected to the EV3 of course.) Assuming you have done this and now have the 'cat_yowl.The sound_play node considers each sound (built-in, wave file or synthesized text) as an entity that can be playing, playing repeatedly or stopped. Just make a folder called 'sounds' on your computer and place your WAV files inside that, then open the 'sounds' folder in VS Code and click the 'Send project to device' icon in the header of the EV3 Device browser. This will send a copy of the 'sounds' folder into the 'robot' folder on your EV3.

If you're using VS Code with the EV3 extension as I recommend then this is easy enough. I suggest you make a directory called 'sounds' in your 'robot' directory and use that to contain your WAV files. A sample wav file 'cat_yowl.wav' from can be downloaded using the link at the bottom of this page.

If you get the same message then delete that sound file and try another. I did have a problem with a WAV file that I downloaded from there though - I got an error message 'underrun' when I ran my script, which suggests that the sound file was damaged.
#Play sounds python for free#
A good source for free WAV sound files is.
