acm系统报输入异常java,ACM流转换的异常显示AcmNotPossible

When decompressing frames of Mp3 from Server the above mentioned exception occurs while the Mp3 have been played for 10 to 15 sec.My application is a Client/Server application.I m sending the Mp3 Frames by composing Mp3 Packets and serializing it over Network Stream.I m using NAudio Open Source API for Compressing and Decompressing Frames and Playing the Mp3.I get the following exception with Stack Trace.

NAudio.MmException.Try(MmResult result, String function)

at NAudio.Wave.Compression.AcmStreamHeader.Convert(Int32 bytesToConvert, Int32& sourceBytesConverted)

at NAudio.Wave.Compression.AcmStream.Convert(Int32 bytesToConvert, Int32& sourceBytesConverted)

at NAudio.Wave.AcmMp3FrameDecompressor.DecompressFrame(Mp3Frame frame, Byte[] dest, Int32 destOffset)

at Client.Audio.SoundPlayer.StreamMP3(Object state)

解决方案

AcmNotPossible is an error code returned by the acmStreamConvert Windows function, which calls into the MP3 ACM codec. This error likely indicates either an invalid MP3 frame, or that you have passed in too many frames at once. How sure are you that you are getting whole MP3 frames? It is a good idea to debug problems like this by also writing the data you receive to an MP3 file and then checking that can play as expected.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值