[英]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.