Author Topic: New Problem with Audio  (Read 1553 times)

Code: [Select]
datablock AudioProfile(BGM_TripLoop)
{
   filename    = "Add-ons/Koden/TripLoop.wav";
   description = AudioClose3d;
   preload = true;
};

package BGM_Trip
{
   function GameConnection::onClientEnterGame(%this)
   {
      Parent::onClientEnterGame(%this);
      %this.play2D(BGM_TripLoop);
   }
};
activatePackage(BGM_Trip);
The script works fine, but I can't get it to play new songs or repeat, because it only works when you enter the server. Much kudos to you if you can tell me how to loop or play new songs. If it all comes down to it, I can edit the songs together into one file, but I really don't want to do that.

First of all, your playing a 3D Sound with play2D.

Change the description of the audio profile to Audio2D.

Alternatively, if you do want your sound to loop, make it AudioLooping2D.

The only way I could see of playing new songs, is to schedule another song to play after the duration of the first song.

The only way I could see of playing new songs, is to schedule another song to play after the duration of the first song.
Well, this is set to start onEnter or w/e.
After that gets changed, would it look similar to this:
Code: [Select]
datablock AudioProfile(BGM_TripLoop)
{
   filename    = "Add-ons/Koden/TripLoop.wav";
   description = Audio2d;
   preload = true;
};

package BGM_Trip
{
   function GameConnection::onClientEnterGame(%this)
   {
      Parent::onClientEnterGame(%this);
      %this.play2D(BGM_TripLoop);
   }
};


function playBGM(%client)
{
activatePackage(BGM_Trip);
$adVar=schedule(453000,0,playBGM2,%client);
}

//And this would repeat, but with the new datablocks.
?

Double toasts

EDITED
« Last Edit: July 10, 2007, 12:05:51 AM by -Koden- »