public WaveFileBuffer(int numberOfChannels, int freq, Stream stream) { m_Buffer = new short[OBUFFERSIZE]; m_Bufferp = new short[MAXCHANNELS]; m_Channels = numberOfChannels; for (int i = 0; i < numberOfChannels; ++i) m_Bufferp[i] = (short) i; m_OutWave = new WaveFile(); int rc = m_OutWave.OpenForWrite(null, stream, freq, 16, (short) m_Channels); }
public WaveFileBuffer(int numberOfChannels, int freq, string fileName) { if (fileName == null) throw new NullReferenceException("FileName"); m_Buffer = new short[OBUFFERSIZE]; m_Bufferp = new short[MAXCHANNELS]; m_Channels = numberOfChannels; for (int i = 0; i < numberOfChannels; ++i) m_Bufferp[i] = (short) i; m_OutWave = new WaveFile(); int rc = m_OutWave.OpenForWrite(fileName, null, freq, 16, (short) m_Channels); }
private void InitBlock(WaveFile enclosingInstance) { m_EnclosingInstance = enclosingInstance; }
public WaveFileSample(WaveFile enclosingInstance) { InitBlock(enclosingInstance); Chan = new short[MAX_WAVE_CHANNELS]; }
public short FormatTag; // Format category (PCM=1) public WaveFormatChunkData(WaveFile enclosingInstance) { InitBlock(enclosingInstance); FormatTag = 1; // PCM Config(44100, 16, 1); }
/// <summary> /// Open for write using another wave file's parameters... /// </summary> public virtual int OpenForWrite(string filename, WaveFile otherWave) { return(OpenForWrite(filename, null, otherWave.SamplingRate(), otherWave.BitsPerSample(), otherWave.NumChannels())); }
public WaveFormatChunk(WaveFile enclosingInstance) { InitBlock(enclosingInstance); Header = new RiffChunkHeader(enclosingInstance); Data = new WaveFormatChunkData(enclosingInstance); Header.CkId = FourCC("fmt "); Header.CkSize = 16; }
/// <summary> /// Open for write using another wave file's parameters... /// </summary> public virtual int OpenForWrite(string filename, WaveFile otherWave) { return OpenForWrite(filename, null, otherWave.SamplingRate(), otherWave.BitsPerSample(), otherWave.NumChannels()); }