Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

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 that’s relevant.

share|improve this question
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


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.