Ask Your Question
0

'volume' error using sound_play

asked 2016-02-02 18:32:10 -0600

the8Bitts gravatar image

I can't find a way a make sound_play work. I've been searching for days already, but I can't find a fix to this error. Have any of you ever experienced this error?

$ rosrun sound_play say.py 'Hello again'

Saying: Hello again Voice: voice_kal_diphone Traceback (most recent call last): File: "/opt/ros/indigo/lib/sound_play/say.py", line 79, in <module> print 'Volume: %s' % volume NameError: name 'volume' is not defined

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2016-02-02 23:18:31 -0600

ahendrix gravatar image

updated 2016-03-10 12:07:54 -0600

This is a bug in sound_play. Please report it on the issue tracker.

UPDATE

The bug was reported here: https://github.com/ros-drivers/audio_... and is fixed in the most recent release of sound_play, which has not yet made it to the public apt repository.

Until then, if this issue is a problem, please use audio_common from source by checking out the audio_common repository into your catkin workspace.

DO NOT modify the files in /opt/ros ; they are managed by the package manager and your changes may be overwritten at any time.

edit flag offensive delete link more
0

answered 2016-03-09 13:32:48 -0600

tgibbons gravatar image

I ran into this same problem. As mentioned above, there seems to be a bug in say.py which is part of sound_play. If you want to temporarily get around this bug while they fix it, you can edit say.py replacing these two lines

    print 'Volume: %s' % volume
    soundhandle.say(s, voice, volume)

with

    #print 'Volume: %s' % volume
    soundhandle.say(s, voice)

This simply comments out the printing of the volume and does not pass it to soundhandle.say() which only expects the two parameters in the current version.

It is generally not a good idea to modify code in /opt/ros/indigo/lib/sound_play directly, but I did anyway to avoid moving all of sound_play to a work space. I had to chmod the file permissions which restrict permissions in this folder, but thought it was OK since I want later updates to overwrite this fix.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2016-02-02 18:32:10 -0600

Seen: 495 times

Last updated: Mar 10 '16