is there something like a global DisableAudio??

Non-platform specific questions.

is there something like a global DisableAudio??

Postby sonicfire » Sat Apr 23, 2011 5:52 pm

hi there,

i realized it would be cool for my games to enable or disable music/soundeffects.
So my question is, is it possible to disable all audio globally somehow?

(Other than using variables)?

Thanks!
sonicfire
 
Posts: 425
Joined: Wed Nov 01, 2006 9:34 pm
Location: berlin germany
Score: 16 Give a positive score

Re: is there something like a global DisableAudio??

Postby SuperSonic » Sat Apr 23, 2011 7:52 pm

Hmm, I don't know how to do it other than using variables. But if you wanted to use them, it wouldn't be hard. I could give you a tutorial if you want :P
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: is there something like a global DisableAudio??

Postby Game A Gogo » Sat Apr 23, 2011 9:59 pm

I think there is a function named "SetVolume" where channel 0 is all samples and channel 1 is music
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: is there something like a global DisableAudio??

Postby lcl » Sat Apr 23, 2011 10:00 pm

In ge, there is a variable called musicvol.
I haven't tried it, but I think it controls the global volume of all sounds & music. :)

Then you can just set it to 0. :)
And to 1 for having the sounds work again.
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: is there something like a global DisableAudio??

Postby sonicfire » Mon May 02, 2011 6:38 am

thanks, guys! :)

i´m currently just using the long-winded variant of checking audio at every sample play.
(e.g. if (audioEnabled) { play dat sound! })
sonicfire
 
Posts: 425
Joined: Wed Nov 01, 2006 9:34 pm
Location: berlin germany
Score: 16 Give a positive score

Re: is there something like a global DisableAudio??

Postby skydereign » Mon May 02, 2011 6:50 am

Setting musicvol should work, but if that isn't what you wanted, and you are going to use that if statement, make sure to use a function. I use a custom function to play sounds and music, that takes the music file's name, that way I can set its volume and whether or not it plays in the function, without having to do that for every instance of sound.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: is there something like a global DisableAudio??

Postby sonicfire » Mon May 02, 2011 3:39 pm

the musicvol method doesnt work for me, since it seems that it olnly affects music? (or everything played on channel zero).
so thats why i decided to go the "if (can i play audio?) yes? then play)" :)
sonicfire
 
Posts: 425
Joined: Wed Nov 01, 2006 9:34 pm
Location: berlin germany
Score: 16 Give a positive score

Re: is there something like a global DisableAudio??

Postby AnarchCassius » Mon May 02, 2011 6:47 pm

In the end variables will be nicer because it means you can implement volume controls, not just on/off. It's nice to be able to have the sound low enough that you aren't driving the other people on your train or in your house crazy but loud enough you can at least hear it.
AnarchCassius
 
Posts: 55
Joined: Sat Jan 29, 2011 1:33 am
Score: 6 Give a positive score

Re: is there something like a global DisableAudio??

Postby sonicfire » Wed May 04, 2011 9:43 pm

thats right! ;)

TO AKR / MAKSLANE: i finally had the chance to test my game on an ipod touch 3gs (iOS 4.2 something).
i noticed GE stops music that´s playing in the background as soon as i launch the App. Guess that´s intended?
However, is there (in the future) a way or possibility to let the user hear his music while playing GE games ???


Thanks! :D
sonicfire
 
Posts: 425
Joined: Wed Nov 01, 2006 9:34 pm
Location: berlin germany
Score: 16 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest