Author Topic: Playing Music (It can't find the audio)  (Read 850 times)

function clientCmduRPG_PlaySong(%song,%type)
{
   if(isFile("Add-Ons/Client_UltimateRPG/rMusic/" @ %type @ "/" @ %song @ "_" @ %type @ ".ogg"))
   {
      if(alxIsPlaying($uRPG::CurrentSong))
         alxStop($uRPG::CurrentSong);
      $uRPG::CurrentSong = alxCreateSource(AudioGUI, "Add-Ons/Client_UltimateRPG/rMusic/" @ %type @ "/" @ %song @ "_" @ %type @ ".ogg");
      alxPlay($uRPG::CurrentSong);
   }
}

Somehow, this shows up: Unable to locate profile '0'

First off, you probably shouldn't use alx functions in the first place (Correct me if I'm wrong). It would probably be easier to just make datablocks for the songs and then play them using datablock.play or whatevertheforget the command is.

First off, you probably shouldn't use alx functions in the first place (Correct me if I'm wrong). It would probably be easier to just make datablocks for the songs and then play them using datablock.play or whatevertheforget the command is.
I have done the datablocks before, but this still doesn't help me at all.

First off, you probably shouldn't use alx functions in the first place (Correct me if I'm wrong). It would probably be easier to just make datablocks for the songs and then play them using datablock.play or whatevertheforget the command is.

alx* is the way to play sound client-sided.

Somehow, this shows up: Unable to locate profile '0'

That's because alxPlay takes a AudioProfile datablock. Create one and change the fileName attribute dynamically.

Thanks Port. It works now.