Tag: 音频流

ACM Stream转换exception显示AcmNotPossible

当从服务器解压缩Mp3的帧时,在Mp3播放10到15秒时发生上述exception。我的应用程序是客户端/服务器应用程序。我通过编写Mp3数据包并通过网络流序列化来发送Mp3帧。我使用NAudio Open Source API来压缩和解压缩帧并播放Mp3.I使用Stack Trace获得以下exception。 NAudio.MmException.Try(MmResult结果,字符串函数) at NAudio.Wave.Compression.AcmStreamHeader.Convert(Int32 bytesToConvert,Int32&sourceBytesConverted) at NAudio.Wave.Compression.AcmStream.Convert(Int32 bytesToConvert,Int32&sourceBytesConverted) 在NAudio.Wave.AcmMp3FrameDecompressor.DecompressFrame(Mp3Frame帧,Byte [] dest,Int32 destOffset) 在Client.Audio.SoundPlayer.StreamMP3(对象状态)

如何使用临时文件流式传输mp3文件?

我正在使用Mp3流光。 要从url流式传输mp3文件,我想使用临时文件。 但是尝试读取和写入相同的文件会因File.ReadAllBytes而抛出IOException ,因为该文件正在使用中。 我怎样才能解决这个问题? long pos = 0; string path = pathtothetempfile; MemoryStream ms = new MemoryStream(); FileStream fs = new FileStream(path, FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite); do { bytesRead = responseStream.Read(buffer, 0, buffer.Length); fs.Write(buffer, 0, bytesRead); fs.Flush(); byte[] tempBuffer = File.ReadAllBytes(path); pos = ms.Position; ms = new MemoryStream(tempBuffer); ms.Position = pos; frame = Mp3Frame.LoadFromStream(ms); //….codes…. […]

Windows Phone 8 – 播放流式音频(网络电台)

我正在尝试使用以下URL http://icecast6.play.cz/radio1-128.mp3创建一个播放音频流(mp3)的应用程序。 我正在努力让它发挥作用。 这些案件是否有默认支持? 内容是否连续流式传输? 我曾尝试使用背景音频代理并设置媒体元素,但这些都不适用于我。 背景音频流媒体会是我的选择吗? 我会很高兴任何类似的例子,我将利用我的优势。 谢谢