加载AVAsset后,如下所示:
AVAsset *asset = [AVAsset assetWithURL:url];
我想知道音频轨道的采样率是多少。目前,我得到的音频轨道是这样的:
AVAssetTrack *audioTrack = [[asset tracksWithMediaCharacteristic:AVMediaCharacteristicAudible] objectAtIndex:0];
这很管用。但我似乎找不到任何类型的财产,甚至在使用谷歌后也找不到;- ),这就给出了采样率。这通常是如何工作的?这可能吗(我开始越来越怀疑,因为谷歌并没有给我很多信息...)
4条答案
按热度按时间7lrncoxx1#
我使用的是Swift,所以它看起来有点不同,但它仍然可以与Obj-C一起工作。
似乎也给予了正确的答案,但我有点担心,因为这个名字。
wwtsj6pe2#
使用Swift和AVFoundation:
要在元数据中查找更多信息,您还可以参考:https://developer.apple.com/documentation/avfoundation/avassettrackhttps://developer.apple.com/documentation/avfoundation/media_assets_playback_and_editing/finding_metadata_values
fhg3lkii3#
找到了。我正在使用MTAudioProcessingTap,所以在prepare()函数中我可以用途:
mzillmmw4#