예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
 private void InitBlock(WaveFile enclosingInstance)
 {
     m_EnclosingInstance = enclosingInstance;
 }
예제 #4
0
 public WaveFileSample(WaveFile enclosingInstance)
 {
     InitBlock(enclosingInstance);
     Chan = new short[MAX_WAVE_CHANNELS];
 }
예제 #5
0
            public short FormatTag;      // Format category (PCM=1)

            public WaveFormatChunkData(WaveFile enclosingInstance)
            {
                InitBlock(enclosingInstance);
                FormatTag = 1; // PCM
                Config(44100, 16, 1);
            }
예제 #6
0
 /// <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()));
 }
예제 #7
0
 private void InitBlock(WaveFile enclosingInstance)
 {
     m_EnclosingInstance = enclosingInstance;
 }
예제 #8
0
 public WaveFileSample(WaveFile enclosingInstance)
 {
     InitBlock(enclosingInstance);
     Chan = new short[MAX_WAVE_CHANNELS];
 }
예제 #9
0
 public WaveFormatChunk(WaveFile enclosingInstance)
 {
     InitBlock(enclosingInstance);
     Header = new RiffChunkHeader(enclosingInstance);
     Data = new WaveFormatChunkData(enclosingInstance);
     Header.CkId = FourCC("fmt ");
     Header.CkSize = 16;
 }
예제 #10
0
            public short FormatTag; // Format category (PCM=1)

            public WaveFormatChunkData(WaveFile enclosingInstance)
            {
                InitBlock(enclosingInstance);
                FormatTag = 1; // PCM
                Config(44100, 16, 1);
            }
예제 #11
0
 /// <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());
 }