如何在AVCaptureSession设置音频采样率是多少? [英] How to set audio sample rate on AVCaptureSession?

查看:2127
本文介绍了如何在AVCaptureSession设置音频采样率是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的 AVCaptureSession 使用录制的视频和音频到采样缓冲区的 AVCaptureVideoDataOutput AVCaptureAudioDataOutput

I am using AVCaptureSession to record video and audio into sample buffers using AVCaptureVideoDataOutput and AVCaptureAudioDataOutput.

为iPhone(4和4S)默认的音频采样率为44100Hz。我想将它设置为48000Hz然而AVCaptureSession似乎并不具有音频采样率的任何设置。

The default audio sample rate for the iPhone (4 and 4S) is 44100Hz. I would like to set this to 48000Hz however AVCaptureSession does not seem to have any settings for audio sample rate.

我曾尝试使用 AVAudioSession 以更改硬件采样率(使用set preferredHardwareSampleRate),但虽然报告作为改变了硬件采样率(激活会话之后)这并不影响实际速率采样我得到的AVCaptureAudioDataOutput的样品委托。

I have tried to use AVAudioSession to change the hardware sample rate (using setPreferredHardwareSampleRate) but though it reports the hardware sample rate as changed (after activating the session) this does not affect the actual rate of samples I'm getting in AVCaptureAudioDataOutput's sample delegate.

有没有办法从内部AVCaptureSession本身?

Is there any way to set the audio sample rate from within AVCaptureSession itself?

推荐答案

每苹果的支持,就没有办法在IOS 5。要做到这一点,他们认为这个功能可能在以后的版本中添加,甚至6。

Per Apple support, there is no way to do this in iOS 5. They suggest this feature might be added in a later version, maybe even 6.

这篇关于如何在AVCaptureSession设置音频采样率是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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