繁体   English   中英

无法在wp8中播放.amr文件

[英]Can't play .amr file in wp8

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

请帮助我知道原因并帮助我解决此问题。 谢谢。

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM