インポート
#import "SimpleAudioEngine.h"
preload
[[SimpleAudioEngine sharedEngine] preloadBackgroundMusic:@"BGM.mp3"];
[[SimpleAudioEngine sharedEngine] preloadEffect:@"soundEffect.mp3"];
SE
[[SimpleAudioEngine sharedEngine] playEffect:@"soundEffect.mp3"];
[[SimpleAudioEngine sharedEngine] playEffect:@"soundEffect.mp3" pitch:1.0f pan:0.0f gain:1.0f];
BGM
[[SimpleAudioEngine sharedEngine] playBackgroundMusic:@"BGM.mp3"];
[[SimpleAudioEngine sharedEngine] playBackgroundMusic:@"BGM.mp3" loop:YES];
//停止、一時停止、再開
[[SimpleAudioEngine sharedEngine] stopBackgroundMusic];
[[SimpleAudioEngine sharedEngine] pauseBackgroundMusic];
[[SimpleAudioEngine sharedEngine] resumeBackgroundMusic];
//先頭へ戻す
[[SimpleAudioEngine sharedEngine] rewindBackgroundMusic];
//音量
[[SimpleAudioEngine sharedEngine] setBackgroundMusicVolume:1];
備考
ロードできる曲数は32曲まで
それを超える場合はunloadしてから追加する
0 件のコメント:
コメントを投稿