It would be really helpful if there was an option where you could push a button on the simulator to mute the sound or make it louder or quieter. I realize this won't affect the app, it would just be a way to mute the music so one could listen to the radio while he is coding.
Label: corona android iphone ipad building error inmobi problem display screen View image tableView failed object physics touch button game lua config event listener |
Mute
Put this on top of main.lua and you can bool the sound on/off
1 2 3 4 | local mute = true if mute then audio.play = function () end end |
Ah! Thanks! Never would have figured that out!
Much appreciated,
J.K.
Out of interest, is that code also a good idea for an in-game mute button?
That'd save alot of effort if so.
Cheers.
That would work fine to mute, so would;
audio.setVolume( 0 )
See here; http://developer.anscamobile.com/reference/index/audiosetvolume
Peach :)
@ ojnab
Whenever I use that, later in the game when I have the volume fade out rewind for a level transition, it gives me an error:
Runtime error
.../Desktop/Corona Projects/Warp Speed/easyGame.lua:1155: Unsupported argument in audio.rewind
stack traceback:
[C]: ?
[C]: in function 'rewind'
.../Desktop/Corona Projects/Warp Speed/easyGame.lua:1155: in function '_listener'
?: in function <?:446>
?: in function <?:215>
Runtime error
.../Desktop/Corona Projects/Warp Speed/easyGame.lua:1155: Unsupported argument in audio.rewind
stack traceback:
[C]: ?
[C]: in function 'rewind'
...mith/Desktop/Corona Projects/Warp Speed/easyGame.lua:1155: in function '_listener'
?: in function <?:446>
?: in function <?:215>
send message and call to a person
Forum: Report Spam + PM
[INSTALL_PARSE_FAILED_NO_CERTIFICATES]
[SOLVED] Director ERROR: Failed to execute new( params ) function on 'screen1'
Too many (200) local variables
Corona SVG Level Builder released. Drag and drop physics level editor with Inkscape and SVG.
Small bug in Collectible Items example
Pivot Joints and apparent elasticity
Can't make removeSelf() delayed
Why must I use tonumber() only sometimes?
Touch Events with transparent PNG
Is Lime completely necessary?
Simulating Apple Features + Graphics
a new particle system for corona sdk Graffiti PS Beta Testing Begins 10-4-11
Collisions
InMobi Ads Size Problem 300x250
Can we store images input from photo library into App's documents directory?
Texture Packer: Artifacts?