Game Development Community

Adding backgroun music

by Tim Lei · in Torque Game Engine · 05/03/2002 (3:37 pm) · 5 replies

How can I add background music during a mission?

Thanks for all your replies!

#1
05/03/2002 (3:50 pm)
The best way i've seen is to use Kurtis Seebaldt's Ogg Vorbis add-on then just play the music from script when the player joins. And you save loads of room with the music compression :)

The discussion of it and the code is Here
#2
05/03/2002 (4:10 pm)
http://holodeck.st.usm.edu/vrcomputing/vrc_t/tutorials/
Link to Desmond's sound tutorial site.
#3
05/05/2002 (11:45 am)
oops - never mind .. right reply , wrong thread :-)
#4
05/05/2002 (11:51 am)
I've included Kurt's great Ogg Vorbis code for Torque... and it does work to play it at startup, in the menus, during missing loading, etc.! You just have to define datablocks like this:
new AudioProfile(MainMenu_Music) {
      fileName = "~/data/sound/music/Track09.ogg";
      description = "AudioMusic";
      preload = "0";
   };
e.g. in "mainMenuGui.gui".
And then you can call it e.g. in client\init.cs
function loadMainMenu()
{
   // Startup the client with the Main menu...
   Canvas.setContent( MainMenuGui );
   Canvas.setCursor("DefaultCursor");
   alxPLay("MainMenu_Music");
}
Haven't tried it with normal sound, though...
#5
05/05/2002 (6:44 pm)
thanx alot pal, works!