【问题标题】:Can't play .amr file in wp8无法在 wp8 中播放 .amr 文件
【发布时间】: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


    【解决方案1】:

    这不起作用,因为 soundeffect 只接受 .wav 文件...| 它不支持任何其他格式,除了... 所以改变你的文件格式它应该可以正常工作......

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多