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