• 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: Playback time at AVAudioEngineConfigurationChangeNotification?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Playback time at AVAudioEngineConfigurationChangeNotification?


  • Subject: Re: Playback time at AVAudioEngineConfigurationChangeNotification?
  • From: Tamás Zahola <email@hidden>
  • Date: Mon, 15 Apr 2019 13:55:42 +0200

Thanks for the insight Arshia!

I guess I’ll have to fallback to using AUGraph and AudioUnits, and ignore the
flashing deprecation warnings prompting me to use AVAudioEngine...

It’s unfortunate that AVAudioEngine is being touted as a replacement for these
APIs while still lacking support for such basic use cases...

Considering that AVAudioEngine was introduced in iOS 8, it would be nice to
have some clarification on Apple’s stance with these audio APIs, because I find
it hard to believe that I’m the first one encountering this problem.

Should we consider AVAudioEngine a “beginners” API, and are AUGraph +
AudioUnits still the preferred way to do audio processing?

Thanks,
Tamás Zahola

> On 2019. Apr 15., at 10:20, Arshia Cont <email@hidden> wrote:
>
> Tamás,
>
> I gave up AVAudioEngine for the same reasons a while back. I achieve similar
> results by counting on AVAudioSession RouteChange notifications (which I
> believe is what AVAudioEngine uses anyway) and low level AudioUnits to
> synchronize buffers during interruptions.
>
> My understanding is that AVAUdioEngine is a wrapper on top of good-old
> Avaudiosession and audiounits! My main issue with not wanting to go further
> on AVAUdioEngine was its poor performance on real-time tap nodes while
> classical AUnits are controllable to the slightest detail.
>
> If anyone can shed light on these observations it would be great.
>
> Arshia Cont
> www.antescofo.com
>
> Sent from my iPhone
>
>> On 15 Apr 2019, at 00:10, Tamás Zahola <email@hidden> wrote:
>>
>> Hi,
>>
>> I’m writing an iOS audio player utilizing AVAudioEngine with an
>> AVAudioPlayerNode and some effect nodes.
>>
>> I want the audio to continue as seamlessly as possible on an audio route
>> change, in other words: when playing audio through the external speakers and
>> we plug in a headphone, then the audio in the headphones should continue
>> exactly where the speakers have left off.
>>
>> According to the docs, AVAudioEngine is stopped and connections are severed
>> when such an audio route change occurs; thus the audio graph connections
>> have to be re-established and playback has to be started afresh (buffers has
>> to be enqueued again, erc.). When this happens a notification is posted
>> (AVAudioEngineConfigurationChangeNotification).
>>
>> In response to this notification, I wanted to simply re-enqueue the
>> previously enqueued audio buffers, possibly skipping a bunch of samples from
>> the start of the buffer that was playing at the time of the interruption, so
>> that those parts that made it through the speaker won’t be played again in
>> the headphones.
>>
>> But there’s an issue here: by the time this notification is posted, the
>> engine’s internal state seems to be torn down (the nodes are stopped and
>> their `lastRenderTime` is nil), so I can’t figure out exactly where the
>> playback was interrupted...
>>
>> Have I missed an API that would let me query the playback time after such an
>> interruption?
>>
>> What is the recommended approach for handling these route/configuration
>> changes seamlessly?
>>
>> Calculating playback time from “wall time” (i.e. mach_absolute_time) feels a
>> bit icky to me when working with a high-level API like AVAudioEngine...
>>
>> Best regards,
>> Tamás Zahola
>> _______________________________________________
>> 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
 _______________________________________________
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

  • Follow-Ups:
    • Re: Playback time at AVAudioEngineConfigurationChangeNotification?
      • From: Dave O'Neill <email@hidden>
References: 
 >Playback time at AVAudioEngineConfigurationChangeNotification? (From: Tamás Zahola <email@hidden>)
 >Re: Playback time at AVAudioEngineConfigurationChangeNotification? (From: Arshia Cont <email@hidden>)

  • Prev by Date: Re: Playback time at AVAudioEngineConfigurationChangeNotification?
  • Next by Date: Re: Playback time at AVAudioEngineConfigurationChangeNotification?
  • Previous by thread: Re: Playback time at AVAudioEngineConfigurationChangeNotification?
  • Next by thread: Re: Playback time at AVAudioEngineConfigurationChangeNotification?
  • Index(es):
    • Date
    • Thread