ACM Stream Convert exception displaying AcmNotPossible

有些话、适合烂在心里 提交于 2019-12-08 09:45:18

问题


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)


回答1:


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.



来源:https://stackoverflow.com/questions/9158276/acm-stream-convert-exception-displaying-acmnotpossible

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!