/// <summary> /// To be called each time the streaming process is stopped or suspended. /// </summary> public void NotifyStreamingStoppedSuspended(SoundStreamingStatus streamingStatus) { foreach (SoundFilter filter in filters) { filter.OnStreamingStoppedSuspended(streamingStatus); } }
protected override void OnStreamingStoppedSuspended(SoundStreamingStatus streamingStatus) { base.OnStreamingStoppedSuspended(streamingStatus); if (mp3Writer != null) { mp3Writer.Close(); mp3Writer = null; } }
protected internal override void OnStreamingStoppedSuspended(SoundStreamingStatus streamingStatus) { try { base.OnStreamingStoppedSuspended(streamingStatus); } finally { DestroyBuffer(); } }
protected internal override void OnStreamingStoppedSuspended(SoundStreamingStatus streamingStatus) { try { base.OnStreamingStoppedSuspended(streamingStatus); BufferStream.Position = 0; //Rewind to the beginning. BinaryWriter output = new BinaryWriter(Output); BinaryReader input = new BinaryReader(BufferStream); RewriteData(input, output); output.Flush(); } finally { DestroyBuffer(); } }
protected internal override void OnStreamingStoppedSuspended(SoundStreamingStatus streamingStatus) { base.OnStreamingStoppedSuspended(streamingStatus); if (Output != null && writer != null) { Output.Flush(); //Set the sample lenght. It may be later overriden if the streaming is again resumed. long curPos = Output.Position; writer.Seek(4, SeekOrigin.Begin); // Seek to the length descriptor of the RIFF file. writer.Write((int)(streamingStatus.BytesPassed + 36)); // Write the file length, minus first 8 bytes of RIFF description. writer.Seek(40, SeekOrigin.Begin); // Seek to the data length descriptor of the RIFF file. writer.Write(streamingStatus.BytesPassed); // Write the length of the sample data in bytes. //Return to the oryginal position (we're assuming that more data can be appended). //But if not, if the stream is closed then the above assures correct header values. Output.Position = curPos; Output.Flush(); } }
/// <summary> /// Called each time the streaming process is stopped or suspended. /// </summary> /// <param name="streamingStatus">Current status of streaming process (summary of all /// stop-resume sessions).</param> internal protected virtual void OnStreamingStoppedSuspended(SoundStreamingStatus streamingStatus) { }