I've found that offline rendering pre iOS 11 requires some pretty hacky hacks. Some of the nodes won't work while the engine is paused. In order to get around that I subclassed AUAudioUnit and broke the render chain manually while AVAudioEngine thinks everything is running.
Here's the AUAudioUnit Subclass. https://github.com/AudioKit/AudioKit/blob/develop/AudioKit/Common/Nodes/Offline/OfflineRender/AKOfflineRendererAudioUnit.mm#L188 Dave On Fri, Aug 18, 2017 at 3:29 PM, Waverly Edwards <[email protected]> wrote: > I thought, just as possible I could make this work by accessing the > underlying audiounit and setting the parameter for > kAudioUnitProperty_OfflineRender > directly but I got an error -10851, kAudioUnitErr_InvalidPropertyValue > although the headers state there is an offline version of the unit. > Undeterred, I accessed the auAudioUnit and set > myPitchRateUnit.auAudioUnit.isRenderingOffline > = true, however if I immediately go back and check the value, it is still > false. > > > > I’ve run out of ideas and will gladly accept any ideas that anyone else > has. > > > > Thank you, > > > > > > W. > > > > *From:* Coreaudio-api [mailto:coreaudio-api-bounces+wedwards= > [email protected]] *On Behalf Of *Waverly Edwards > *Sent:* Friday, August 18, 2017 12:38 PM > *To:* Chris Adamson <[email protected]> > *Cc:* CoreAudio <[email protected]> > *Subject:* RE: Increasing speed without increasing pitch > > > > >> And it can go more than double-speed (I think the limits are 1/32x to > 32x) > > > > Wow. I constantly listen to spoken audio at 2-4x (my limit) so I tried > listening at rate from 5-32 using AVAudioUnitTimePitch . That is off the > charts fast. > > > > This works *perfectly* under normal conditions. I couldn’t be more > pleased. However, my conditions aren’t the norm. > > I am rendering offline by start playing the audio, immediately pausing the > engine, then pulling AudioUnitRender. > > This has worked fantastically with all the effect so far but with > AVAudioUnitTimePitch, the audio render never occurs. I’m *guessing* > because this is a converter as you said. I’ll try some other converters to > see what the outcome. > > > > Player -> TimePitch -> Mixer -> OutputNode > > > > If I bypass TimePitch, while offline rendering everything works as > expected. I’ve been trying to determine if you can signal the unit to > render offline. > > So far I haven’t found a way to do this. Is there a way where I can make > this work while rendering offline (engine paused)? > > > > > > Thank you for the insights. They were a massive help. > > > > W. > > > > *From:* Chris Adamson [mailto:[email protected] > <[email protected]>] > *Sent:* Friday, August 18, 2017 9:30 AM > *To:* Waverly Edwards <[email protected]> > *Cc:* CoreAudio <[email protected]> > *Subject:* Re: Increasing speed without increasing pitch > > > > Just use AUNewTimePitch (or whatever it’s called) by itself. That’ll > change rate without changing pitch. And it can go more than double-speed (I > think the limits are 1/32x to 32x) > > > > Note that this unit is of type format converter, not effect, because you > of the differing counts of input and output frames. > > > > —Chris > > > > On Aug 18, 2017, at 8:41 AM, Waverly Edwards <[email protected]> wrote: > > > > Would someone provide some guidance on how you can take an audio file and > speed it up without changing the pitch. > > I was working yesterday and I added AVAudioUnitVarispeed unit to my > engine and increased the speed by 2. It worked, however I found output to > have the chipmunk sound. > > Would you use a AVAudioUnitTimePitch unit to lower the pitch to compensate > or is there a better way to achieve this outcome? > > > > I would like to increase the speed by more than a rate of 2. Is there a > reason why I couldn’t daisy chain two AVAudioUnitVarispeed units together? > > > > Lastly, is there a way to know how many audio frames were produced *after* > the effect completed. Since I have a change in time, the number of > frames coming in are not the same number going out. > > > > Thank you, > > > > > > W. > > _______________________________________________ > Do not post admin requests to the list. They will be ignored. > Coreaudio-api mailing list ([email protected]) > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/coreaudio-api/ > invalidname%40gmail.com > > This email sent to [email protected] > > > > _______________________________________________ > Do not post admin requests to the list. They will be ignored. > Coreaudio-api mailing list ([email protected]) > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/coreaudio-api/ > oneill707%40gmail.com > > This email sent to [email protected] > >
_______________________________________________ Do not post admin requests to the list. They will be ignored. Coreaudio-api mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/coreaudio-api/archive%40mail-archive.com This email sent to [email protected]
