gpt4 book ai didi

c++ - 提取 quicktime 文件中的每个音频 channel

转载 作者:太空狗 更新时间:2023-10-29 22:53:04 24 4
gpt4 key购买 nike

我想使用 QuickTime-API 提取 quicktime 电影中的每个音频 channel 。这意味着如果文件有 5.1 环绕声,我最后想要 6 个音频文件。但目前我不知道如何管理它。到目前为止,我有:

OSStatus err = noErr;
MovieAudioExtractionRef extractionSessionRef = nil;
Boolean allChannelsDiscrete = true;
int flags;
int numFrames;
AudioBufferList *mBufferList;
err = MovieAudioExtractionBegin(movie, 0, &extractionSessionRef);


// disable mixing of audio channels
err = MovieAudioExtractionSetProperty(extractionSessionRef,
kQTPropertyClass_MovieAudioExtraction_Movie,
kQTMovieAudioExtractionMoviePropertyID_AllChannelsDiscrete,
sizeof (Boolean), &allChannelsDiscrete);

err = MovieAudioExtractionFillBuffer(extractionSessionRef, &numFrames,
mBufferList, &flags);
if (flags & kQTMovieAudioExtractionComplete)
{
// extraction complete!
}
err = MovieAudioExtractionEnd(extractionSessionRef);

问题是我不知道如何获取 mBufferList 以及如何将每个 channel 导出为 WAV 48kHz。你能帮助我吗?例子来自this page .

最佳答案

你检查过this了吗? ?

关于c++ - 提取 quicktime 文件中的每个音频 channel ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3184453/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com