简体   繁体   中英

Playing audio files continually using audio recorded url

I am newcomer in Objective-C and have experience only 12 months in iPhone development.

I am recording audio files in One UIViewController , and playing on another UIViewController . For playing purpose i am saving the date string for generation of url,it is fine working properly, But ,now my problem is i want to play previous audio record file for some time after that i want to play next audio file using url . i am saving all the data using nsuser dafaults please help me

NSM![enter image description here][1]utableArray *dateString;
NSURL recordFile = [NSURL fileURLWithPath:[NSTemporaryDirectory() stringByAppendingString:[self.dateString objectAtIndex:sender.tag]]];
For playing

player = [[AVAudioPlayer alloc] initWithContentsOfURL:recordFile error:&error];

from fig when i click a tag 2 i want to play first 5 sec tag1 after that i want to play tag2

Record the audio -> Save the audio in the Temp -> Track the saved path of the audio file (You can store this saved path in an array) . Repeat the same steps for the next file.

Use AVQueuePlayer for playing items one after the other.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM