示例#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());
 }