예제 #1
0
 public Mp3WaveFormat(int sampleRate, int channels, int blockSize, int bitRate)
 {
     this.waveFormatTag         = WaveFormatEncoding.MpegLayer3;
     this.channels              = (short)channels;
     this.averageBytesPerSecond = bitRate / 8;
     this.bitsPerSample         = 0;
     this.blockAlign            = 1;
     this.sampleRate            = sampleRate;
     this.extraSize             = 12;
     this.id             = Mp3WaveFormatId.Mpeg;
     this.flags          = Mp3WaveFormatFlags.PaddingIso;
     this.blockSize      = (ushort)blockSize;
     this.framesPerBlock = 1;
     this.codecDelay     = 0;
 }
예제 #2
0
        private const short Mp3WaveFormatExtraBytes = 12; // MPEGLAYER3_WFX_EXTRA_BYTES

        /// <summary>
        /// Creates a new MP3 WaveFormat
        /// </summary>
        public Mp3WaveFormat(int sampleRate, int channels, int blockSize, int bitRate)
        {
            waveFormatTag = WaveFormatEncoding.MpegLayer3;
            this.channels = (short)channels;
            this.averageBytesPerSecond = bitRate / 8;
            this.bitsPerSample = 0; // must be zero
            this.blockAlign = 1; // must be 1
            this.sampleRate = sampleRate;

            this.extraSize = Mp3WaveFormatExtraBytes;
            this.id = Mp3WaveFormatId.Mpeg;
            this.flags = Mp3WaveFormatFlags.PaddingIso;
            this.blockSize = (ushort)blockSize;
            this.framesPerBlock = 1;
            this.codecDelay = 0;
        }
예제 #3
0
        private const short Mp3WaveFormatExtraBytes = 12; // MPEGLAYER3_WFX_EXTRA_BYTES

        /// <summary>
        /// Creates a new MP3 WaveFormat
        /// </summary>
        public Mp3WaveFormat(int sampleRate, int channels, int blockSize, int bitRate)
        {
            waveFormatTag         = WaveFormatEncoding.MpegLayer3;
            this.channels         = (short)channels;
            averageBytesPerSecond = bitRate / 8;
            bitsPerSample         = 0; // must be zero
            blockAlign            = 1; // must be 1
            this.sampleRate       = sampleRate;

            extraSize      = Mp3WaveFormatExtraBytes;
            id             = Mp3WaveFormatId.Mpeg;
            flags          = Mp3WaveFormatFlags.PaddingIso;
            this.blockSize = (ushort)blockSize;
            framesPerBlock = 1;
            codecDelay     = 0;
        }
예제 #4
0
        private const short Mp3WaveFormatExtraBytes = 12; // MPEGLAYER3_WFX_EXTRA_BYTES

        /// <summary>
        /// Creates a new MP3 WaveFormat
        /// </summary>
        public Mp3WaveFormat(int sampleRate, int channels, int blockSize, int bitRate)
        {
            waveFormatTag = WaveFormatEncoding.MpegLayer3;
            this.channels = (short)channels;
            this.averageBytesPerSecond = bitRate * (1024 / 8);  // not really used but must be one of 64, 96, 112, 128, 160kbps
            this.bitsPerSample = 0; // must be zero
            this.blockAlign = 1; // must be 1
            this.sampleRate = sampleRate;

            this.extraSize = Mp3WaveFormatExtraBytes;
            this.id = Mp3WaveFormatId.Mpeg;
            this.flags = Mp3WaveFormatFlags.PaddingOff;
            this.blockSize = (ushort)blockSize;
            this.framesPerBlock = 1;
            this.codecDelay = 0;
        }