问题
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