gpt4 book ai didi

iphone - 如何在 iPhone 应用程序中播放歌曲时显示剩余时间?

转载 作者:行者123 更新时间:2023-12-03 20:59:08 24 4
gpt4 key购买 nike

我使用 AVAudioPlayer 在我的 iPhone 应用程序中向用户播放 mp3 文件。这一切都运行良好且花花公子。我什至根据播放器的状态更新“播放/暂停”按钮。但很高兴知道这首歌会播放多长时间。

那么如何显示剩余时间呢?

最佳答案

您可以设置 NSTimer 并在播放时计算 audioPlayer.duration - audioPlayer.currentTime

关于iphone - 如何在 iPhone 应用程序中播放歌曲时显示剩余时间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2437434/

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