初始化The Amazing Audio Engine之后,视频录制(使用GPUImage)中没有音频 [英] No audio in video recording (using GPUImage) after initializing The Amazing Audio Engine

查看:84
本文介绍了初始化The Amazing Audio Engine之后,视频录制(使用GPUImage)中没有音频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在项目中使用了两个第三方工具.一个是"The Amazing Audio Engine" .我将此用于音频过滤器.另一个是GPUImage,或更具体地说,是 GPUImageMovieWriter .录制视频时,我会将音频录制与视频合并.这很好.但是,有时我不使用Amazing Audio Engine,而只是使用GPUImageMovieWriter录制普通视频.问题是,即使在初始化了惊人的音频引擎"之后,视频开始时的音频也只有一秒钟的一小部分,然后音频消失了.

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;
}

初始化TAAE时发生了某些事情.我怀疑这与AVAudioSession有关,因为它是一个sharedInstance.任何帮助都将是惊人的.

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.

推荐答案

很自然,当我终于扣好问题并发布问题时,我发现了我的问题.

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

将preferredBufferDuration设置为0.005有点多余.删除此行解决了我的问题.

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

您可以了解有关PreferredBufferDuration的更多信息

You can learn more about preferredBufferDuration here.

这篇关于初始化The Amazing Audio Engine之后,视频录制(使用GPUImage)中没有音频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆