简体   繁体   English

在iPhone中查找录音的长度

[英]Finding the length of an audio recording in iPhone

I am recording the audio using avaudiorecorder. 我正在使用avaudiorecorder录制音频。 How do I find the length of the recording after saving the recording in a .caf file? 在.caf文件中保存录制文件后如何找到录制的长度?

You can use helpers in the CoreMedia framework. 您可以在CoreMedia框架中使用帮助程序。

AVURLAsset *asset = [[AVURLAsset alloc] initWithURL:avAudioRecorder.url options:nil];
CMTime time = asset.duration;
double durationInSeconds = CMTimeGetSeconds(time);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM