void DecodeSound(string name, byte[] rawData) { long start = outData.Position; using (MemoryStream ms = new MemoryStream(rawData)) { OggContainer container = new OggContainer(ms); outDecoder.PlayStreaming(container); } long len = outData.Position - start; outText.WriteLine(format, name, outDecoder.Frequency, outDecoder.BitsPerSample, outDecoder.Channels, start, len); }
void DecodeSound(string name, byte[] rawData) { string path = Path.Combine(Program.AppDirectory, "audio"); path = Path.Combine(path, prefix + name + ".wav"); using (FileStream dst = File.Create(path)) using (MemoryStream src = new MemoryStream(rawData)) { dst.SetLength(44); RawOut output = new RawOut(dst, true); OggContainer container = new OggContainer(src); output.PlayStreaming(container); dst.Position = 0; BinaryWriter w = new BinaryWriter(dst); WriteWaveHeader(w, dst, output); } }
void DecodeSound( string name, byte[] rawData ) { string path = Path.Combine( Program.AppDirectory, "audio" ); path = Path.Combine( path, prefix + name + ".wav" ); using( FileStream dst = File.Create( path ) ) using ( MemoryStream src = new MemoryStream( rawData ) ) { dst.SetLength( 44 ); RawOut output = new RawOut( dst, true ); OggContainer container = new OggContainer( src ); output.PlayStreaming( container ); dst.Position = 0; BinaryWriter w = new BinaryWriter( dst ); WriteWaveHeader( w, dst, output ); } }