gpt4 book ai didi

iphone - AVAudioPlayer 的 playAtTime 属性在 IOS 3.0/App Crash 中不起作用

转载 作者:行者123 更新时间:2023-11-28 18:44:06 25 4
gpt4 key购买 nike

我开发了一个通用应用程序,它从本地读取音频文件并使用 AvAudioPlayer 播放。这里我使用 AvAudioPlayer 的 PlayAtTime 属性来向前和向后播放音频。

我的问题是这个 playAtTime 属性在 ios 4.0 及更高版本中工作正常,但在 IOS-3.0 中不工作。

我引用了框架,它说 - (BOOL)playAtTime:(NSTimeInterval)time NS_AVAILABLE(10_7, 4_0); 在某种意义上我不能在 ios 3.0 中使用它,对吧..?那么 ios 3.0 的修复是什么

有什么办法可以解决这个问题吗?还有什么建议。??

最佳答案

快速浏览 documents会清楚地让你知道它只能从 iOS 4.0 开始使用

Availability

Available in iOS 4.0 and later.

尝试

currentTime

The playback point, in seconds, within the timeline of the sound associated with the audio player.

@property NSTimeInterval currentTime

Discussion

If the sound is playing, currentTime is the offset of the current playback position, measured in seconds from the start of the sound. If the sound is not playing, currentTime is the offset of where playing starts upon calling the play method, measured in seconds from the start of the sound.

By setting this property you can seek to a specific point in a sound file or implement audio fast-forward and rewind functions.

关于iphone - AVAudioPlayer 的 playAtTime 属性在 IOS 3.0/App Crash 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6954099/

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