2011-01-19 4 views

答えて

1

CocosDenshionを使用してください。ただし、オーディオファイルをAACでエンコードされた* .caf形式に変換することをお勧めします。

#import "SimpleAudioEngine.h" 

//preloading is important. do it in the scene init function 
[[SimpleAudioEngine sharedEngine] preloadBackgroundMusic:@"MyBgMusic.caf"]; 
[[SimpleAudioEngine sharedEngine] preloadEffect:@"MyEffect.caf"]; 

//later on 
[[SimpleAudioEngine sharedEngine] playBackgroundMusic:@"MyBgMusic.caf"]; 
[[SimpleAudioEngine sharedEngine] playEffect:@"MyEffect.caf"]; 

完全なドキュメントはこちらです:http://www.cocos2d-iphone.org/api-ref/0.99.5/interface_simple_audio_engine.html

0

は、次の書籍を見てみましょう。あなたはアイデアを得るでしょう。

Adding Audio

関連する問題