AVAudioPlayer

想要在 iOS 裝置上播放音效的話,只要:

1.引入AVFoundation 函式庫

2.生成 AVAudioPlayer

3.想要播放音效時,就直接讓AVAudioPlay播放音效即可。

程式碼於下:

AVAudio

 

***** Mac Mini 使用者請看這邊 *****

老婆的 Mac Mini 在開發使用 AVAudioPlayer 的程式時,會出現下面的錯誤:
error ‘!obj’ trying to fetch default input device’s sample rate

如果你也有相同的經驗。解決方法是:
把 Mac Mini上的麥克風孔,插一個麥克風就好啦。

(645)

superstardj

been a DJ, a rapper, a musician and a recording artist... a novel-writer, a language-book author, and a chief editor... a painter, a book-cover designer and many more... right now a programmer who designs mobile application, both iOS and Android devices...

Leave a Reply

Your email address will not be published. Required fields are marked *