无法在wp8中播放.amr文件 [英] Can't play .amr file in wp8

查看:126
本文介绍了无法在wp8中播放.amr文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用AudioVideoCaptureDevice录制语音并将其保存为amr格式的独立存储

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

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

我可以通过Windows Media Player播放它.但是我无法在WP8中使用SoundEffect播放它.

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.

推荐答案

这不起作用,因为souneffect仅接受.wav文件... |. 除了...以外,它不支持任何其他格式. 因此,更改文件格式应该可以正常工作...

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...

这篇关于无法在wp8中播放.amr文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆