1

I use AudioVideoCaptureDevice to record the voice and save it to isolated storage with amr format

dev = await AudioVideoCaptureDevice.OpenForAudioOnlyAsync();
dev.AudioEncodingFormat = CameraCaptureAudioFormat.Amr;

I can play it by windows media player. But I can't play it with SoundEffect in WP8.

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();
}

Please help me to know why and help me to solve this problem. Thanks.

4

1 回答 1

0

这不起作用,因为 soundeffect 只接受 .wav 文件...| 它不支持任何其他格式,除了......所以改变你的文件格式它应该可以正常工作......

于 2013-06-13T11:03:50.853 回答