playing music at X(Free86) time


Forum: Other Help Topics
Topic: playing music at X(Free86) time
started by: Patrick

Posted by Patrick on Sep. 16 2005,13:31
Hello Y'all,

I use sox.dsl (play) to play a tune (wav) when i am almost in Fluxbox/Xfree/X. See below:

Last lines of .xinitrc:

/opt/sox/play /cdrom/keep/wav/operatio.wav &
/opt/sox/play /cdrom/keep/wav/zarathustra.wav &
exec fluxbox 2>/dev/null

Now the first line works, the second line doesn't (but there is nothing wrong with it when i paste it into a term and run it)

1) What's wrong?
2) Can i first enter X(Free86)/Fluxbox and only THEN make the music start to play?

Posted by mikshaw on Sep. 16 2005,13:36
It's probably because you are running both in the background, so they overlap.  Zarathustra won't play because the sound device is currently in use playing the first sound.  If you remove the ampersand from the first one, that will play and then be followed by Zarathustra while fluxbox loads.  This means nothing will happen while HAL is talking, so startup will take a couple seconds longer.
Posted by Patrick on Sep. 16 2005,13:46
Did that, you're right. Thnx.

What happens now is this:

I get and "empty" X(free86), at the left hand corner is one of the wmapps which i use. zarathustra.wav plays, X(Free86) comes up and the wmapps are placed at the right side of the screen (where they belong). Xplanet (which i love!) displays the earth with clouds as a background. THEN hal talks and the xplanet-background disapears. (i start xplanet with a script: see below)


#!/bin/bash
cp /cdrom/keep/marker_file/earth /etc/xplanet/markers &
myvar=0
until [ $myvar -eq -1]
do
#wget < http://spierepf.dyndns.org/~peter/clouds_2048.jpg > ~/.xplanet/images
#wget < http://xplanet.unixheads.com/xplanet/clouds_2048.php > ~/.xplanet/images
wget < http://xplanet.dyndns.org.nyud.net:8090/clouds/clouds_2048.jpg >
cp /home/dsl/clouds_2048.jpg /home/dsl/.xplanet/images
xplanet -num_times 1 -longitude 5 -latitude 51 -date `date +%G%m%d.%H%M%S` -range 100 -radius 100 &
sleep 6000
myvar=$(( $myvar + 1 ))
sudo rm -f /home/dsl/clouds*.* &
done

[I]

I would like this:

X(free86) comes up (xplanet as background)
sound1
sound2
(xplanet stays on as background)


Its got to be an error in the script i think

Posted by mikshaw on Sep. 16 2005,13:57
I don't know xplanet, but i think i can make a suggestion...

Does the xplanet program itself stay running? Does the background remain if you run your script manually after fluxbox loads? Is the background being replaced by the regular fluxbox wallpaper?

You might consider adding a "rootCommand" line to .fluxbox/init if the background is being changed by fluxbox.
rootCommand: /path/to/xplanet_script
This will override the background that is set from whatever style you use.  If this works, there is no need to run the script from .xinitrc. You could possibly also add your sounds to the script if it will improve the timing.

Posted by Patrick on Sep. 16 2005,18:33
Thnx Mikshaw, your idea's are great. I've got my xplanet script running now as rootcommand. So when X(Free86) comes up, i hear my tunes and at the same time see my xplanet-background! (i also moved my email-notifier wmbiff in .xinitrc after the tunes that need to be played so it can't "steal focus" from my play-command when there is mail at boot-time)

Cheers!

Posted by Patrick on Sep. 16 2005,20:12
Is there a rootcommand for sound in fluxbox init?
Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.