私はアニメーションビデオとそれに対応するサウンドを再生する必要があるゲームアプリケーションを構築しています(状況によって異なる場合があります)。私はすべてのビデオとサウンドファイルを用意していますが、同時に再生することはできません。私はビデオとAVFoundationフレームワークのオーディオを再生するMPMoviePlayerを使用しています。とにかくこれらを同時に実行するのですか?ビデオ用のiPhone:オーディオとビデオを同時に再生
:サウンドの
MPMoviePlayerViewController *videoController = [[[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:[cellDetails objectForKey:@"AVFile"]]] autorelease];
[self presentMoviePlayerViewControllerAnimated:videoController];
:
// Instantiates the AVAudioPlayer object, initializing it with the sound
AVAudioPlayer *newPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL: soundFileURL error: nil];
self.appSoundPlayer = newPlayer;
[newPlayer release];
[appSoundPlayer prepareToPlay];
appSoundPlayer.numberOfLoops = -1;
[appSoundPlayer setVolume: self.soundLevel];
[appSoundPlayer setDelegate: self];
[appSoundPlayer play];
感謝。
どのようにAVFoundationを使用しているかによって異なります。いくつかのコードを投稿したいですか? –
編集した質問をご覧ください。ありがとう! – applefreak