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

标签 iphone ios ipad avaudioplayer

我开发了一个通用应用程序,它从本地读取音频文件并使用 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/

相关文章:

iOS UIScrollView 中的 UIImageView

ios - 如何在 scenekit 中创建 3D 网格

iphone - ${EXECUTABLE_NAME} 和 ${PRODUCT_NAME} 在哪里定义

iOS:动态标签/验证错误的辅助功能支持?

iphone - NSNotificationCenter

ios - Objective C 中的属性(为自己读写,为他人只读)

iPad 浏览器模拟器?

objective-c - 释放所有缓存数据

iphone - 如果自定义生产力应用程序被 iOS App Store 拒绝怎么办?

javascript - Jquery 移动数据-rel ="dialog"在 iphone 或 ipad 上不起作用