AudioVideoCaptureDevice を使用して音声を録音し、amr 形式で分離ストレージに保存します
dev = await AudioVideoCaptureDevice.OpenForAudioOnlyAsync();
dev.AudioEncodingFormat = CameraCaptureAudioFormat.Amr;
Windows Media Player で再生できます。しかし、WP8のSoundEffectで再生できません。
using (IsolatedStorageFileStream sourceFile = ISF.OpenFile("\\data\\test.amr", FileMode.Open, FileAccess.Read))
{
byte[] b = new byte[sourceFile.Length];
sourceFile.Read(b, 0, b.Length);
SoundEffect sound = new SoundEffect(b, microphone.SampleRate, AudioChannels.Mono);
soundInstance = sound.CreateInstance();
soundInstance.Play();
}
理由を知り、この問題を解決するのを手伝ってください。ありがとう。