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

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