Offline Rendering

Hi Guys

i am new guy with this framework

everything works perfect but i didn't find offline rendering.

Can someone provide the solution for offline rendering? or may be i didn't find?

thanks

Comments

  • There was a great thread and a solution posted here:
    http://forum.theamazingaudioengine.com/discussion/comment/649#Comment_649

    I actually just made the idiot move of updating TAAE without saving the modifications I'd made for this to work, and it seems like the newer update has changed enough stuff that I can no longer make the same adaptation.

    Anyone have any luck getting DJZ-Code's functionality working?
    (https://github.com/djz-code/TheAmazingAudioEngine)

    @Michael - is this included in the latest build but using some functions I've somehow missed?

  • thanks RossBeaf.

    i think offline rendering nice to have in the "main branch" to avoid future questions

  • edited June 2015

    @RossBeaf said:
    There was a great thread and a solution posted here:
    http://forum.theamazingaudioengine.com/discussion/comment/649#Comment_649

    I actually just made the idiot move of updating TAAE without saving the modifications I'd made for this to work, and it seems like the newer update has changed enough stuff that I can no longer make the same adaptation.

    Anyone have any luck getting DJZ-Code's functionality working?

    I forked TAAE a month ago (https://github.com/VladimirKravchenko/TheAmazingAudioEngine) and added lijon's function to AEAudioController. It worked for me with this code:

    [self play];
    [self.audioController stop];
    const int kBufferLength = 4096;
    NSTimeInterval renderDuration = self.playerWithMaxDuration.duration;
    Float64 sampleRate = self.audioController.audioDescription.mSampleRate;
    UInt32 lengthInFrames = (UInt32) (renderDuration * sampleRate);
    AudioTimeStamp timeStamp;
    memset (&timeStamp, 0, sizeof(timeStamp));
    timeStamp.mFlags = kAudioTimeStampSampleTimeValid;
    AEAudioFileWriter *audioFileWriter =
        [[AEAudioFileWriter alloc] initWithAudioDescription:self.audioController.audioDescription];
    AudioBufferList *buf =
        AEAllocateAndInitAudioBufferList(self.audioController.audioDescription, kBufferLength);
    NSString *filePath = [self pathForSong];
    [audioFileWriter beginWritingToFileAtPath:filePath fileType:kAudioFileM4AType error:nil];
    for (UInt64 i = 0; i < lengthInFrames; i += kBufferLength) {
        AEAudioControllerRenderMainOutput(self.audioController, timeStamp, kBufferLength, buf);
        timeStamp.mSampleTime += kBufferLength;
        OSStatus status = AEAudioFileWriterAddAudioSynchronously(audioFileWriter, buf, kBufferLength);
        if (status != noErr) {
            NSLog(@"ERROR: %d", (int) status);
        }
    }
    [audioFileWriter finishWriting];
    AEFreeAudioBufferList(buf);
    [self.audioController start:nil];
    [self stop];
    NSLog(@"Finished");
    
  • Hi Guys
    I don't see AEAudioControllerRenderMainOutput in 1.5.2 version any more.
    What to use instead?
    Thanks

Sign In or Register to comment.