I solved the problem. Just drop frames, which were randomly properties, and add those frames whose properties match more than 10 times.Maybe i someone help with the error "AcmNotPossible calling acmStreamConvert".Sorry for bad english and bad code =)
privatevoid StreamMP3(object state) { fullyDownloaded = false;var url = (string) state; webRequest = (HttpWebRequest) WebRequest.Create(url); HttpWebResponse resp = null;try { resp = (HttpWebResponse) webRequest.GetResponse(); }catch (WebException e) {if (e.Status != WebExceptionStatus.RequestCanceled) { ShowError(e.Message); }return; }var buffer = newbyte[16384*4]; // needs to be big enough to hold a decompressed frameconstint maxMatchedFrames = 10;int matchedFramesCount = 0;int sampleRate = 44100;var channelMode = ChannelMode.JointStereo;var queueMatchedFrames = new Queue<Mp3Frame>();bool matchedFramesReady = false; IMp3FrameDecompressor decompressor = null;try {using (Stream responseStream = resp.GetResponseStream()) {var readFullyStream = new ReadFullyStream(responseStream);do {if (bufferedWaveProvider != null&& bufferedWaveProvider.BufferLength - bufferedWaveProvider.BufferedBytes < bufferedWaveProvider.WaveFormat.AverageBytesPerSecond/4) { Debug.WriteLine("Buffer getting full, taking a break"); Thread.Sleep(100); }else { Mp3Frame frame = null;try { frame = Mp3Frame.LoadFromStream(readFullyStream);if (frame == null) break;if (!matchedFramesReady) {if ((frame.SampleRate == sampleRate) && (frame.ChannelMode == channelMode)) { queueMatchedFrames.Enqueue(frame); matchedFramesCount++;if (matchedFramesCount == maxMatchedFrames) { matchedFramesReady = true; } }else { queueMatchedFrames.Clear(); sampleRate = frame.SampleRate; channelMode = frame.ChannelMode; matchedFramesCount = 0; } } }catch (EndOfStreamException) { fullyDownloaded = true;break; }catch (WebException) {break; }if (!matchedFramesReady) continue;if (decompressor == null) { WaveFormat waveFormat = new Mp3WaveFormat(frame.SampleRate, frame.ChannelMode == ChannelMode.Mono ? 1 : 2, frame.FrameLength, frame.BitRate); decompressor = new AcmMp3FrameDecompressor(waveFormat); bufferedWaveProvider = new BufferedWaveProvider(decompressor.OutputFormat); bufferedWaveProvider.BufferDuration = TimeSpan.FromSeconds(10); }int decompressed = decompressor.DecompressFrame(queueMatchedFrames.Count != 0 ? queueMatchedFrames.Dequeue() : frame, buffer, 0); bufferedWaveProvider.AddSamples(buffer, 0, decompressed); } } while (playbackState != StreamingPlaybackState.Stopped); } }finally {if (decompressor != null) { decompressor.Dispose(); } queueMatchedFrames.Clear(); } }