首页 \ 问答 \ 提取quicktime文件中的每个音频通道(extract every audio-channel in a quicktime file)

提取quicktime文件中的每个音频通道(extract every audio-channel in a quicktime file)

我想用QuickTime-API提取quicktime电影中的每个音频通道。 这意味着如果文件有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以及如何将每个通道导出为WAV 48kHz。 你可以帮我吗? 该示例来自此页面


I want to extract every audio channel in a quicktime movie with the QuickTime-API. That means if the file has 5.1 surround, i want 6 audio files in the end. But at the moment I don't know how to manage that. Until now I have:

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

The problem is that I don't know how to get mBufferList and how to export every channel as WAV 48kHz. Can you help me? The example is from this page.


原文:https://stackoverflow.com/questions/3184453
更新时间:2021-07-22 22:07

最满意答案

如果您在NetworkLink中设置了flyToView,则会出现这种情况。 检查flyToView元素是NetworkLink的子代,而不是Link。 可能由您正在使用的JavaScript API生成的KML未正确设置flyToView或者不支持它。

<Document>
  <visibility>1</visibility>
  <NetworkLink>
    <name>NE US Radar</name>
    <refreshVisibility>1</refreshVisibility>
    <flyToView>1</flyToView>
    <Link>...</Link>
  </NetworkLink>
</Document>

此外,您可能希望使用添加到NetworkLink的LookAt或Camera元素覆盖默认视图以进行飞行。


That is the behavior if you have flyToView set 1 in the NetworkLink. Check that the flyToView element is child of the NetworkLink not the Link. Possibly the KML being generated by the JavaScript API you're using is not setting the flyToView correctly or it isn't supported.

<Document>
  <visibility>1</visibility>
  <NetworkLink>
    <name>NE US Radar</name>
    <refreshVisibility>1</refreshVisibility>
    <flyToView>1</flyToView>
    <Link>...</Link>
  </NetworkLink>
</Document>

Also, you may want to override default view with a LookAt or Camera element added to the NetworkLink to fly.

相关问答

更多
  • 根据您的要求和架构,有几种解决方法。 一种方法是在不同的guvnor包中定义你的规则的每个子集。 在构建你的kbase时,你可以只加载那些包含特定规则的包。 另一种方法是始终加载所有规则,但使用“启用”表达式可以动态启用/禁用规则。 请注意,这种情况下的规则仍在评估中,但可以阻止它们的激活。 对于想要根据插入到会话中的事实启用/禁用规则的情况,这是一种有用的技巧。 例如: 规则X启用()然后... 上面的布尔表达式可以访问来自规则条件的变量绑定,以及规则属性,注释,显然,如果要定义激活DRL外部规则的条件, ...
  • 只需按“R”退出地面视图即可 Apparently the answer is that there is no solution at this stage.
  • 您需要获取对话框本身的引用以便稍后进行修改,因此您必须稍微更改构建器,但随后您可以随时调用AlertDialog.getButton()来启用或禁用该按钮。 这样的东西...... //Use create() so you can get the instance back AlertDialog dialog = AlertDialog.Builder(this) .setTitle(getString(R.string.createvfs)) ...
  • 如果您在NetworkLink中设置了flyToView,则会出现这种情况。 检查flyToView元素是NetworkLink的子代,而不是Link。 可能由您正在使用的JavaScript API生成的KML未正确设置flyToView或者不支持它。 1 NE US Radar 1
  • 通常,无法更改SWT样式,这是Text控件的Wrap样式的情况。 StyledText控件确实有一个setWordWrap(boolean)方法,你应该可以使用它。 In general SWT styles can't be changed and this is the case for the Wrap style of the Text control. The StyledText control does have a setWordWrap(boolean) method, you shoul ...
  • 我最终想到了解决这个问题,这就是我所做的。 在我的每个测试类(或者只有少数类中的测试需要MQ的方法)中,有MQ依赖性我将以下内容添加到类(或方法)decleration中 #if !RunMQTests [Ignore] #endif 这将禁用测试,除非您有条件比较符号RunMQTests decleared,此符号未在项目文件中定义,因此默认情况下禁用测试。 要在开发人员必须记住是否安装了MQ并添加或删除条件比较符号的情况下启用这些测试,我创建了一个自定义构建任务,它将告诉我们MQ是否已安装。 ...
  • 好像你可以创建两个模块,每个模块提供一个不同的入口点。 两者都将继承公共逻辑模块。 然后每个都有一个不同的boostrap JavaScript URL(.nocache.js)。 缺点是那些脚本与浏览器完全不同,因此如果在小部件和完整版之间切换,则没有缓存优势。 您还可以在入口点方法中进行简单测试是否应该执行入口点 - 如果没有则返回。 例如,您可以检查DOM,URL或其他内容中是否存在预期的容器元素。 如果在单个模块中执行两个入口点,则没有太多问题。 Seems like you could creat ...
  • 要禁用传送,您有2个选项。 您可以将目标标记(例如指针)上的“ Enable Teleport标记设置为false,然后每当您使用指针并单击选择按钮时,它将发出目标事件,但传送器将忽略它。 或者你可以简单地禁用传送脚本,所以像MyTeleportScript.enabled = false这样就可以从场景中取消注册传送器。 To disable the teleport you have 2 options. You can either set the Enable Teleport flag on th ...
  • 看到这个问题和接受的答案: 如何将我的谷歌地图应用程序转换为谷歌地球应用程序? 根据该答案,您可以在此处找到更多详细信息: http://code.google.com/apis/maps/documentation/javascript/v2/services.html#Earth See this question and the accepted answer: How do I convert my google maps application into a google earth applic ...
  • 有一个简单的解决方案: 将应用程序build.gradle更改为22。 然后在安装期间授予所有应用程序权限。 但是,这不会阻止用户转到电话设置并手动关闭它们。 您的应用程序将崩溃。 There is a simple solution: Change targetSdkVersion inside application build.gradle to 22. Then all application permission are granted during installation. However, ...

相关文章

更多

最新问答

更多
  • h2元素推动其他h2和div。(h2 element pushing other h2 and div down. two divs, two headers, and they're wrapped within a parent div)
  • 创建一个功能(Create a function)
  • 我投了份简历,是电脑编程方面的学徒,面试时说要培训三个月,前面
  • PDO语句不显示获取的结果(PDOstatement not displaying fetched results)
  • Qt冻结循环的原因?(Qt freezing cause of the loop?)
  • TableView重复youtube-api结果(TableView Repeating youtube-api result)
  • 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
  • SQL Server 2014版本支持的最大数据库数(Maximum number of databases supported by SQL Server 2014 editions)
  • 我如何获得DynamicJasper 3.1.2(或更高版本)的Maven仓库?(How do I get the maven repository for DynamicJasper 3.1.2 (or higher)?)
  • 以编程方式创建UITableView(Creating a UITableView Programmatically)
  • 如何打破按钮上的生命周期循环(How to break do-while loop on button)
  • C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
  • 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
  • 如何防止调用冗余函数的postgres视图(how to prevent postgres views calling redundant functions)
  • Sql Server在欧洲获取当前日期时间(Sql Server get current date time in Europe)
  • 设置kotlin扩展名(Setting a kotlin extension)
  • 如何并排放置两个元件?(How to position two elements side by side?)
  • 如何在vim中启用python3?(How to enable python3 in vim?)
  • 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
  • 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
  • Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
  • dedecms如何安装?
  • 在哪儿学计算机最好?
  • 学php哪个的书 最好,本人菜鸟
  • 触摸时不要突出显示表格视图行(Do not highlight table view row when touched)
  • 如何覆盖错误堆栈getter(How to override Error stack getter)
  • 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
  • USSD INTERFACE - > java web应用程序通信(USSD INTERFACE -> java web app communication)
  • 电脑高中毕业学习去哪里培训
  • 正则表达式验证SMTP响应(Regex to validate SMTP Responses)