Do you think that is critical to spend more than 2000$ in music for a game, and the music just doesn’t play? i do. Betas are intended for solve the problems before the launch of a system, and, even if I know that IOS5 is not official, i have an issue with the music that is playing in the background (since beta 4), that maybe can be interesting to fix before the upcoming launch of IOS 5.
My game has 4 different “worlds”, with many levels in each world, and every world have his own music.
When the player changes from one world to another, music changes and keeps reproducing until it changes to another world.
I use a global variable to know what music is playing, and in function of that, the game automatically changes the “splash screen” and the level selector to the world that is in play.
I use director to control the game, so, the code of the function that i use to change the music is the following:
--\> MÚSICA
-- Analiza qué música está sonando, y si no suena la música que le corresponde al nivel
-- detiene el audio y carga el que le corresponde. (Música y fondo, CANALES 1 y 2)
local sonando = \_G["global"].sonando
if sonando == "viajeplanetario" then
audio.fade( { channel = 1, time = 500, volume = 0.5 } )
else
audio.stop( 1 )
local backgroundMusic = audio.loadStream( "musica/planeta2.mp3")
audio.play( backgroundMusic, { channel = 1, loops = -1 } )
\_G["global"].sonando = "viajeplanetario"
end
audio.setVolume( 0.5, { channel = 1 } )
--\> Fin de música
Notes:
-
i have reserved the channel 1 to the music from the main.lua code.
-
The game loads by default the music from the world 1, and if i play to the levels of the world 1 music keeps playing without problem. When i change te world, music starts playing (for only 2 or 3 seconds) while it’s loading the level (just as expected) and when the level is shown in the screen, music stops (the rest of the sound effects plays as normally). This makes me think that maybe the problem is in this portion of the code atached bellow:
else
audio.stop( 1 )
local backgroundMusic = audio.loadStream( "musica/planeta2.mp3")
audio.play( backgroundMusic, { channel = 1, loops = -1 } )
\_G["global"].sonando = "viajeplanetario"
end
audio.setVolume( 0.5, { channel = 1 } )
- And the most important of all: music plays well and as expected on iOS 4.3, and on the first betas of ios 5. Is since the iOS 5 BETA 4 that i’m having this problem with the music.
PD: additionally, i have found another small issue: the pre-rendered icons since iOS 5 beta 4 are not working. This means that, even if i specify that my icon is pre-rendered in the “bulid.settings” (UIPrerenderedIcon = true,), iOS 5 treats my icon as not pre-rendered. I know this is a general “new feature” of iOS 5, because very much applications (not related with corona) are having the same issue. [import]uid: 14235 topic_id: 13844 reply_id: 313844[/import]