Quantcast
Channel: NAudio
Viewing all articles
Browse latest Browse all 5831

New Post: Ima Adpcm Error during Compression

$
0
0

 

                TargetFormat = ImaAdpcmWaveFormat.MyImaAdpcmWaveFormat(8000, 1, 4, 505)   

                 convertedStream = New WaveFormatConversionStream(TargetFormat, Reader)

                  WaveFileWriter.CreateWaveFile(CurrentFile, convertedStream)

 

MyImaAdpcmWaveFormat class:

 public static ImaAdpcmWaveFormat MyImaAdpcmWaveFormat(int sampleRate, int channels, int bitsPerSample, float samplesperblock)   

    {   

        ImaAdpcmWaveFormat ImaAdpcmWformat = new ImaAdpcmWaveFormat();
        ImaAdpcmWformat.waveFormatTag = WaveFormatEncoding.ImaAdpcm; //

        ImaAdpcmWformat.sampleRate = sampleRate;   

        ImaAdpcmWformat.channels = (short)channels; 

         ImaAdpcmWformat.bitsPerSample = (short)bitsPerSample; // TODO: can be 3 or 4     

         ImaAdpcmWformat.extraSize = 2;//      

         ImaAdpcmWformat.blockAlign = 256; //TODO       

        ImaAdpcmWformat.averageBytesPerSecond = 4055; //TODO       

        ImaAdpcmWformat.samplesPerBlock = (short)samplesperblock; // TODO         

  return ImaAdpcmWformat;   

    }


Viewing all articles
Browse latest Browse all 5831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>