Hi there,
Many of my customers, are asking if in my next update of 'Noid' they could use his own music while playing.
Actually, i think that is not possible on glbasic. I wonder if anyone has get to managed to do this.
King Regards, fjsantos.
My customers are asking the same thing. I do not think its possible from GLBASIC alone (please correct me if I am wrong). You will most probably have to try hook into the apple api's from Xcode? ;/
There is an API for the iPod library. We have to wait for Trucidare I guess.
Any news about this, I'm looking forward to it as well...
On Todo right after AGON.
Wow, really great!!!
I think that will be a great improvement for GLBasic!
Thanks for share your great work trucidare!
I am a volunteer for beta testing :P.
King Regards, fjsantos.
I'd definitely like to see this happen as well. It's a popular option among many players who'd rather have their own music than the in-game music provided. A way to detect whether the user is already playing music on the iPod at game launch would be good so you can give the player the option of continuing to listen to their music or turn it off to listen to in-game music.
Hate to bring this up but this is also something that our customers are asking us a lot... :)
Look at userlibs iPhone Musik
Damn, how did I miss that, thank you very much once more, much appreciated... =D
is there any sample code for this function with glbasic?
Put this in it's own .gbas file attached to your project (mine is GLBMusic.gbas):-
// PRoject GLBMusic Wrapper
//
// Wrapper GBAS
//1. -> Download the lib AND gbas from: http://davis.org.au/trucidare/GLBMusic.zip
//2. -> Add GLBMusic.gbas TO your Project
//3. -> Use functions TO add Music support AND compile
//4. -> copy TO mac
//5. -> open xcode project
//6. -> drag AND drop libGLBMusic.a TO frameworks on the left side (dont forget TO add MediaPlayer.framework, thats missing IN the glbasic xcode project, simple right click on frameworks add-> existing frameworks -> choose mediaplayer AND click ok)
//NOTE: It seems Mediaplayer.framework is already there now. No worries...
//7. -> edit info.plist
//8. -> compile AND have fun.
?IFDEF IPHONE
IMPORT "C" void GLB_MP_StartMusicPlayer()
IMPORT "C" void GLB_MP_PlayMusic()
IMPORT "C" void GLB_MP_StopMusic()
IMPORT "C" void GLB_MP_NextTitle()
IMPORT "C" void GLB_MP_PreviousTitle()
IMPORT "C" int GLB_MP_isPlaying()
?ELSE
FUNCTION GLB_MP_StartMusicPlayer:
ENDFUNCTION
FUNCTION GLB_MP_PlayMusic:
IF ISMUSICPLAYING()=0 THEN PLAYMUSIC "Media/music.mp3",TRUE
ENDFUNCTION
FUNCTION GLB_MP_StopMusic:
STOPMUSIC
ENDFUNCTION
FUNCTION GLB_MP_NextTitle:
ENDFUNCTION
FUNCTION GLB_MP_PreviousTitle:
ENDFUNCTION
FUNCTION GLB_MP_isPlaying:
RETURN FALSE
ENDFUNCTION
?ENDIF
FUNCTION GLBMusicDummy:
ENDFUNCTION
Then in your main code use these commands:-
GLB_MP_StartMusicPlayer() This brings up the iPod music selection screen. You can select as many songs as you like
GLB_MP_PlayMusic() This plays the music you selected earlier
GLB_MP_StopMusic() This stops the music
Also when you start the game again, assuming it carries on from where it left off, then do this:-
SUB GLB_ON_RESUME: //Happens when gets loaded again
IF musicon=1 THEN GLB_MP_PlayMusic()
ENDSUB
Note musicon is just a variable I use to know I selected music in the first place.
This all seems to work on my iPhone game that is on the app store. It is Rotaslider if you want to see it working (free version availble), just select music option in options menu. Music starts when you go back to main menu.
Cheers
has anyone try this code with ios 5??? since I have update there is no sound more playing :rant:
any idea ?