• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Loop Audio on iPhone
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Loop Audio on iPhone


  • Subject: Re: Loop Audio on iPhone
  • From: Marco Papa <email@hidden>
  • Date: Wed, 11 Feb 2009 14:20:41 -0800

On Wed, Feb 11, 2009 at 1:56 PM, Jens Alfke <email@hidden> wrote:

On Feb 11, 2009, at 12:21 PM, Marco Papa wrote:
I have indeed seen several mentions in the iPhone Dev. Forum of the fact that the audio file must be "an exact multiple of the packet size", otherwise the player will fill the missing portion of the last packet with "silence" when looping, but this is the first time I see mention of  "enough context before the beginning and after the end of the loop." What is that?
The encoder doesn't process samples in isolation. It's always looking at the past history of the waveform, up to some (fairly short) horizon. So if you cut a snippet from an audio track and encode it by itself, the output data (and resulting played-back waveform) won't be identical to that section of the original track, because there's no prior context.

So ideally, when encoding a loop, you want to start the encoder near the end of the loop (a distance longer than its horizon), let the loop run until the second time it gets to the end, and then discard the encoded data for the audio before the start of the loop. That way the initial samples of the loop get encoded using the context acquired from the previous [i.e. last] samples, not from a clean slate.

If that isn't clear, think of a simpler example of trying to apply a 200ms echo effect to a loop. If you just take the bare loop and run it through the echo, it won't sound right when played back, because the first 200ms of the loop won't have any echo in it! Instead, you have to apply the echo to the running loop, so that the last 200ms gets echoed onto the first 200ms. Now, for "echo" substitute "secret MP3 encoding sauce" and you've got it.

—Jens

Great explanation, Jens. Thank you.  I am purchasing "stock" loops, so I will check if your "context" requirement is satisfied. As I understand it, if it isn't, the loop will play, but it won't sound like a real loop, because the beginning and end context won't match. 

--
Marco Papa, Ph.D.
Computer Science Department
University of Southern California
Henry Salvatori Computer Center
Los Angeles, California 90089-0781
Voice: +1-213-974-2137
Cell: +1-310-944-5468
E-mail: email@hidden
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Loop Audio on iPhone (From: Marco Papa <email@hidden>)
 >Re: Loop Audio on iPhone (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Parameter value convert
  • Next by Date: Re: Parameter value convert
  • Previous by thread: Re: Loop Audio on iPhone
  • Next by thread: Re: Loop Audio on iPhone
  • Index(es):
    • Date
    • Thread