combining two audiofiles

Nibbie
Posts: 1
Joined: 2011.02
Post: #1
Hello,
I want to play two audio files after each other.
I am using AVAudioPlayer with the delegate option to see if the audio is finished. If it is finished it sends a message to play the second file. But I have a lot of different combinations I want to use and the delegate becomes a big cluttered if statement.

So I am looking for a different way without having to resort to audioQueue that thing scares me.

An option like the UIVIew animatewithduration which has a completion block at the end would have been nice but alas.

If there is no standard framework to make this easy are there opensource frameworks that provide easy sound appending options?
I am finding that OBj C doesn't make it straight forward to append animations or sounds. I keep reading about people having to use NSTimer objects or other weird hoops they are jumping through.

Any tips are appreciated. I like the AVAudioPlayer it is a nice simple way, but the delegate just make sit a mess in my case.
Quote this message in a reply
⌘-R in Chief
Posts: 1,248
Joined: 2002.05
Post: #2
Quote:So I am looking for a different way without having to resort to audioQueue that thing scares me.

Think of how awesome you'll feel after you figure it out.



Quote:I am using AVAudioPlayer with the delegate option to see if the audio is finished. If it is finished it sends a message to play the second file. But I have a lot of different combinations I want to use and the delegate becomes a big cluttered if statement.

Wrap that logic in some other more generic form. For instance if the delegate method is doing "if stopped and movie was A then play X else if stopped and movie was B then play Y else if .... etc", then just do "if stopped { currentMovie = (currentMovie + 1) % numOfMovies; play queue[currentMovie]; }"
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Combining OpenGL vertex data into 1 object Jmcclane 0 3,219 Jun 17, 2011 12:03 PM
Last Post: Jmcclane