예제 #1
0
        public void prepareStream()
        {
            //This makes the stream realtime
            WaveChannel32 inputStream = new WaveChannel32(audioFileReader)
            {
                PadWithZeroes = false  // don't pad, otherwise the stream never ends
            };

            //This vocodes the stream
            stream = new JumpCutterStreamProcessor(inputStream, ref options);
        }
예제 #2
0
        public List <int> writeAudio()
        {
            //This vocodes the stream
            var stream     = new JumpCutterStreamProcessor(audioFileReader, ref options);
            var frameAudio = new byte[options.samplesPerFrame * 4];
            int readCount;
            var audioFileWriter = new WaveFileWriter(options.temp_dir + @"\finalAudio.wav", audioFileReader.WaveFormat);

            while ((readCount = stream.Read(frameAudio, 0, frameAudio.Length)) > 0)
            {
                audioFileWriter.Write(frameAudio, 0, readCount);
            }

            audioFileWriter.Dispose();

            return(stream.getFrames());
        }