Controling volume for extrenal MP3 and Audio CD

Started by Cassiebsg, Tue 29/11/2016 20:03:14

Previous topic - Next topic

Cassiebsg

Uhm... Sorry if this is basic, but I didn't found an answer to this in either the manual or by searching the forum.

So at this point I'm guessing the answer is: You can't do that. In which case I'll just add a note that music volume control does not work for using external audio files or music CD.

Question is simple:
I have a slider to set the volume of the music, which I wrongly assumed worked for external files (PlayMP3File) and CDAudio... realizing today that these don't get affected when changing the slider back and forth. :(
So... is there a way to achieve this? Or should I just add the "doesn't work for this type of sound" warning?
There are those who believe that life here began out there...

Crimson Wizard

#1
What does the slider do exactly, what is inside script function?

I think that since PlayMP3File do not return AudioChannel, you can only use Game.SetAudioTypeVolume(eAudioTypeMusic, ...).

As for CDAudio, it uses operating system to play CD, which means the sound is totally beyond AGS control.

Cassiebsg

Yeah, that's the code am using:

Code: ags

function SldMusic_OnChange(GUIControl *control)
{ 
    Game.SetAudioTypeVolume(eAudioTypeMusic, SldMusic.Value, eVolExistingAndFuture);
    Game.SetAudioTypeVolume(eAudioTypeAmbientSound, SldMusic.Value, eVolExistingAndFuture);
}


But this doesn't seem to affect the mp3. :-\

As for the CD, guess I was surprised not to find a function for setting the volume, since there are so many options to pick track, find how many tracks there are, and so on... 
There are those who believe that life here began out there...

SMF spam blocked by CleanTalk