Can't play .amr file in wp8

邮差的信 提交于 2019-12-11 05:36:19

问题


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.


回答1:


this is not working because souneffect only accepts .wav file...| it does not support any other format except that ... so change your file format it should work fine...



来源:https://stackoverflow.com/questions/16276626/cant-play-amr-file-in-wp8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!