【发布时间】:2013-04-29 10:42:47
【问题描述】:
我使用 AudioVideoCaptureDevice 录制语音并将其保存到 amr 格式的隔离存储中
dev = await AudioVideoCaptureDevice.OpenForAudioOnlyAsync();
dev.AudioEncodingFormat = CameraCaptureAudioFormat.Amr;
我可以通过 windows 媒体播放器播放它。但我无法在 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();
}
请帮助我了解原因并帮助我解决此问题。 谢谢。
【问题讨论】:
标签: c# windows-phone-8 audio-recording amr soundeffect