Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

In a script I play a sound ( .ogg file) using /usr/bin/play. The sound is played fine, but there is an annoying delay of a couple of seconds after the sound has been played before the program (play) terminates. Why is that, and can it be fixed?

Edit: The script is a git-commit hook. It just calls play -q filename.ogg. I have the same experience from the command line.

I'm on 10.04 if thats relevant.

share|improve this question

2 Answers 2

up vote 2 down vote accepted

There's no need to wait for the sound to be completed, right? So you could just

play file.ogg </dev/null &>/dev/null &

(or look here for more intense detaching). Also try ogg123 or mplayer instead of play, or try a different audio output.

share|improve this answer
    
The redirect foo worked beautifully. Thanks. –  Leif Aug 6 '10 at 6:43

I would attribute that to the time it takes for the application to shut down. It really depends how you wrote the script.

This might be more of scripting issue than a ubuntu one.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.