2
A
回答
2
這裏是some sample code將告訴您如何在Mac OS X(10.5+)播放聲音文件。 它使用AudioQueue API。
看看aqplay代碼。
0
假設您希望播放預先錄製的音樂,請嘗試使用QTMovieView。有關於如何使用它的教程here。
1
由於您對xcode
這個問題加了標記,因此請看NSSound和Apple's Audio Overview。
3
1
-(void) playAlarmSound
{
// Get the filename of the sound file
NSString *path = [NSString stringWithFormat:@"%@%@",
[[NSBundle mainBundle] resourcePath],
@"/alarm.wav"];
// Declare a sound id
SystemSoundID soundID;
// get a URL for the sound file
NSURL *filepath = [NSURL fileURLWithPath:path isDirectory:NO];
// Use audio services to create sound
AudioServicesCreateSystemSoundID((CFURLRef) filepath, &soundID);
// Use audio services to play the sound
AudioServicesPlaySystemSound(soundID);
}
相關問題
- 1. objective c iphone音樂播放器崩潰
- 2. 音樂播放
- 3. 播放音樂javascript
- 4. 讓我的背景音樂播放器停止? Objective C
- 5. 停止音樂應用播放音樂
- 6. 連續播放音樂的音樂
- 7. 如何在音樂播放器中播放LRC和音樂
- 8. 從停止播放音樂的時刻繼續播放音樂
- 9. 音樂播放器錯誤
- 10. ffmpeg音樂播放器
- 11. JMF音樂播放器
- 12. Mac上的C++音樂播放
- 13. C#音樂播放器和頻率
- 14. 如何在C++中播放音樂
- 15. C - 正在播放音樂嗎?
- 16. 從資源C播放音樂#
- 17. C++ sfml mp3音樂播放器錯誤
- 18. 音樂播放器的播放列表
- 19. ReverbNation音樂/播放列表播放器
- 20. 使用JSON播放器播放音樂
- 21. 在google中播放mp3播放音樂
- 22. Android音樂播放器
- 23. Android Mediplayer未播放音樂
- 24. 音樂播放器進程
- 25. 循環播放音樂
- 26. OnLongClickListener - 播放()音樂 - 止回()
- 27. HTML/JavaScript音樂播放器
- 28. 另類音樂播放器
- 29. 隨機播放音樂
- 30. ios音樂播放器