gpt4 book ai didi

ios AVAudioPlayer 持续时间错误

转载 作者:行者123 更新时间:2023-11-29 01:46:57 26 4
gpt4 key购买 nike

我使用 NCMusicEngine实现下载时播放 mp3 但是当我播放一些特定的远程 mp3 文件时,我得到的 mp3 的持续时间是错误的,例如我得到的值是 58 它应该是 29 它看起来像实际值的两倍,然后我播放远程 mp3在 chrome 中,它工作正常,

我尝试使用 AVAssetURL 来获取远程 mp3 文件的持续时间,同样的错误发生了

发生了什么?

最佳答案

在我的项目中我使用这样的东西:

AVURLAsset *asset = [[AVURLAsset alloc] initWithURL:url options:nil];
float t = CMTimeGetSeconds(asset.duration);

它会返回正确的持续时间。

关于ios AVAudioPlayer 持续时间错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31804489/

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