No audio in video recording (using GPUImage) after initializing The Amazing Audio Engine

本小妞迷上赌 提交于 2019-12-23 03:32:17

问题


I'm using two third party tools in my project. One is "The Amazing Audio Engine". I use this for audio filters. The other is GPUImage, or more specifically, GPUImageMovieWriter. When I record videos, I merge an audio recording with the video. This works fine. However, sometimes I do not use The Amazing Audio Engine and just record a normal video using GPUImageMovieWriter. The problem is, even just after initializing The Amazing Audio Engine, the video has only a fraction of a second of audio at the beginning, and then the audio is gone.

+ (STAudioManager *)sharedManager
{
    static STAudioManager *manager = nil;

    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        if (!manager)
        {
            manager = [[STAudioManager alloc] init];
            manager.audioController = [[AEAudioController alloc] initWithAudioDescription:[AEAudioController nonInterleaved16BitStereoAudioDescription] inputEnabled:YES];
            manager.audioController.preferredBufferDuration = 0.005;
            manager.audioController.voiceProcessingEnabled = YES;
            manager.audioController.useMeasurementMode = YES;
        }
    });
    return manager;
}

Something is happening when TAAE is initialized. My suspicion is it's something having to do with AVAudioSession as it's a sharedInstance. Any help would be amazing.


回答1:


Naturally when I finally buckle and post a question, I find my problem.

Setting the preferredBufferDuration to 0.005 is a bit excessive. Removing this line solved my problem.

You can learn more about preferredBufferDuration here.



来源:https://stackoverflow.com/questions/31485744/no-audio-in-video-recording-using-gpuimage-after-initializing-the-amazing-audi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!