/ Published in: Objective C
Expand |
Embed | Plain Text
// アプリケーションフォルダをオープン // ファイルのパス生成 // URLを生成 // AVAudioPlayerインスタンス生成 avap = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:nil]; // AVAudioPlayerのdelegate設定 avap.delegate = self; // // 音量設定 avap.volume = 0.5f; // 無限ループ avap.numberOfLoops = -1; // 1回のみ再生 avap.numberOfLoops = 0; // 2回再生 avap.numberOfLoops = 1; // 再生準備 [avap prepareToPlay]; ・ ・ ・ // サウンド再生処理 [avap play]; ・ ・ ・ // サウンド停止処理 [avap stop]; [avap prepareToPlay];
You need to login to post a comment.
