Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
                }
        }
Ejemplo n.º 3
0
        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 );
            }
        }