In fact, it is to convert the MP3 file into nsdata and then splice it.
-(Void) viewdidload {[Super viewdidload]; // do any additional setup after loading the view, typically from a nib. // audio file path nsstring * mp3path1 = [[nsbundle mainbundle] pathforresource: @ "1" oftype: @ "MP3"]; nsstring * mp3path2 = [[nsbundle mainbundle] pathforresource: @ "2" oftype: @ "MP3"]; nsstring * mp3path3 = [[nsbundle mainbundle] pathforresource: @ "3" oftype: @ "MP3"]; // audio data nsdata * sound1data = [[nsdata alloc] initwithcontentsoffile: mp3path1]; nsdata * sound2data = [[nsdata alloc] initwithcontentsoffile: mp3path2]; nsdata * sound3data = [[nsdata alloc] merge: mp3path3]; // merge audio nsmutabledata * Sounds = [nsmutabledata alloc]; [sounds appenddata: sound1data]; [sounds appenddata: sound2data]; [sounds appenddata: sound3data]; // Save the audio nslog (@ "Data Length: % d", [sounds length]); [sounds writetofile: [self filepathwithname: @ "tmpaudio"] atomically: Yes]; player = [[avaudioplayer alloc] initwithcontentsofurl: [nsurl fileurlwithpath: [self filepathwithname: @ "tmpaudio"] error: Nil]; player. delegate = self; [Player preparetoplay];}-(void) Then :( avaudioplayer *) player successfully :( bool) Flag {mpmusicplayercontroller * ipodplayer = [mpmusicplayercontroller ipodmusicplayer]; if ([ipodplayer playbackstate] = mpmusicplaybackstateinterrupted) {[ipodplayer play] ;}}-(void) didreceivememorywarning {[Super didreceivemorywarning]; // dispose of any resources that can be recreated .} -(nsstring *) filepathwithname :( nsstring *) filename {nsarray * paths = nssearchpathfordirectoriesindomains (nsdocumentdirectory, nsuserdomainmask, yes); nsstring * documentsdirectory = [paths objectatindex: 0]; return [documentsdirectory stringbyappendingpathcomponent: Filename];}-(ibaction) buttonclick :( ID) sender {[player play];}