Stellarium already has a very high level of realism, but scripting and
audio support in version 0.7.0 provide new possibilities. What about
adding ambient sound to Stellarium sessions, maybe a typical
background evening sounds such as chirping crickets?
Here is how I have tried that on my Linux box. Although SDL_Mixer
support seems to be properly configured, this doesn't work. But I post
these notes because it may work on other platforms such as Windows or
Mac OS X.
First, I downloaded an audio recording of chirping crickets. This is a
good one because it is distributed with an open license, and makes
running it in a loop easier because it lasts more than a minute (free
This clip is in .WAV format, and I converted it to the .OGG format
required by Stellarium with:
sox crickets.wav crickets.ogg
Then I copied crickets.wav to the data/scripts directory of the
Stellarium installation. The last step is to add the appropriate
instructions to a script. If you want the sound in all Stellarium
sessions, startup.sts is a good choice. Add the following istructions
to the script:
audio filename "crickets.ogg" action play loop on
As I said, this does not work on my Linux box. But if it works on your
system, I'd like to know, so that I can know whether the idea works.
What about adding the smell of grass to the Guereins landscape? Well,
Fabien and Robert will eventually figure how to do that... :)
I wish there was a real, email based discussion forum like a mailing
You seem to have CSS turned off.
Please don't fill out this field.
hello, I have run STELLARIUM at SuSE Linux 10.0.
But command audio do not work.
command: audio filename "KDE_Star_Ship_1.ogg" action play loop on
can anybody help me?
I'm gonna try on Win XP.
Paolo, does the <image load> function work on your system ? It doesn't on mine...
No, <image load> does not seem to work on my Linux system. I have tried putting a PNG image, bitmap.png, in the data/scripts directory of the Stellarium installation and created the script bitmap.sts:
image filename "bitmap.sts" action load altitude 20 azimuth 180 duration 5 name bitmap
I have checked the file permissions of both bitmap.png and bitmap.sts.
This is in the docs, but easy to miss:
Images by default load with alpha set to 0. So to make it visible you must change the alpha.
Also, images and audio are dropped when a script ends, so you need to add a wait command to see or hear anything.
Scripting isn't ideal for background audio, since during a script you have only limited control over stellarium from the keyboard to avoid confusing the script. That's something we can tweak in the future.
Also, the windows 0.7.0 package doesn't have audio support included. I am trying to get Fabian to release an optional package for windows with audio support.
Audio should work fine if you have the right libraries installed on Linux and configure finds them.
For anyone who hasn't found it, here is the scripting documentation:
Adding a wait command makes sound work from a script. As for images, I have modified my script like this:
image filename "bitmap.png" action load altitude 20 azimuth 180 alpha 1 coordinate_system horizontal scale 30 duration 5
wait duration 10
But I still don't see the image. Thanks for the info,
Try this very basic test to start with:
image action load name test filename bitmap.png alpha 1
Now it works. In previous tests I had left out the `name' attribute. Vincent: the other attributes are indeed cool.
Neither the <image load> function, nor the <sound play> function work on my XP system...
Here are the scripts I used :
audio filename "test.ogg" action play loop on
audio filename "test.wav" action play loop on
image filename "test.png" action load altitude 45 azimuth 90
Paolo, there seems to have an error in your image script :
image filename "bitmap.STS" action load altitude 20 azimuth 180 duration 5 name bitmap
should be changed in
image filename "bitmap.BMP" action load altitude 20 azimuth 180 duration 5 name bitmap
Vincent: you are right about the bitmap.sts -> bitmap.png error. But fixing it does not show the image.
Hey, try that Paolo :
image filename "test.png" action load coordinate_system horizontal altitude 20 azimuth 0 duration 5 name test alpha 0.5 scale 50
wait duration 10
Look straight on the East... And see the image growing and going up in the air ! That's a big step forward for educational scripts !
(my image size is 128 * 128, that's why I added a scale 50 command)
I'll try your sound command ASAP
Thank you Rob !
Sign up for the SourceForge newsletter: