• 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: Is it possible to record a MusicPlayer piece to an audio file faster than real-time?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is it possible to record a MusicPlayer piece to an audio file faster than real-time?


  • Subject: Re: Is it possible to record a MusicPlayer piece to an audio file faster than real-time?
  • From: Archagon <email@hidden>
  • Date: Thu, 21 Apr 2016 22:45:17 -0700

Sorry to keep replying to myself, but I figured it out and thought I'd share my solution for posterity!

As the PlaySequence sample code[1] indicates, the trick is to use kAudioUnitSubType_GenericOutput instead of the default kAudioUnitSubType_RemoteIO. You also have to hook up your MusicTracks to actual AudioUnits, not virtual MIDI endpoints; kAudioUnitSubType_MIDISynth works best, but you have to preload your instruments as discussed here[2]. The kAudioUnitProperty_OfflineRender property doesn't work with the built-in iOS AudioUnits, but fortunately it's not required. Sadly, I don't think this process is currently possible with AVAudioEngine: you have to use AUGraph and friends.

Here's my updated sample code: https://github.com/archagon/aumidisynth-offline-render-test/blob/master/AVAudioEngineTest/ViewControllerAUGraph.m

[1]: https://developer.apple.com/library/mac/samplecode/PlaySequence/Listings/main_cpp.html
[2]: http://lists.apple.com/archives/coreaudio-api/2016/Jan/msg00015.html

On Wed, Apr 20, 2016 at 7:23 PM, Archagon <email@hidden> wrote:
Update: I made a prototype based on a StackOverflow answer[1], but unfortunately it sounds like all the MIDI events come in all at once, at the beginning of the offline recording: https://github.com/archagon/aumidisynth-offline-render-test/blob/master/AVAudioEngineTest/ViewController.m

Is there any way to solve this problem?

[1]: http://stackoverflow.com/a/30680391/89812

On Tue, Apr 19, 2016 at 1:12 AM, Archagon <email@hidden> wrote:
I have an iPad app that uses MusicPlayer (from AudioToolbox) to play MIDI files. Is it possible to run MusicPlayer "off the clock" (as fast as the CPU permits) and record the output to an audio file (WAV, etc.) faster than normal playback speed?


 _______________________________________________
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: 
 >Is it possible to record a MusicPlayer piece to an audio file faster than real-time? (From: Archagon <email@hidden>)
 >Re: Is it possible to record a MusicPlayer piece to an audio file faster than real-time? (From: Archagon <email@hidden>)

  • Prev by Date: AUv3 Passthru
  • Next by Date: Is it possible to have multiple scheduled playback events on a single AUAudioFilePlayer?
  • Previous by thread: Re: Is it possible to record a MusicPlayer piece to an audio file faster than real-time?
  • Next by thread: AUAudioUnit (v3) in AUGraph?
  • Index(es):
    • Date
    • Thread