コード例 #1
0
 public void ConvertToPCM16Bit(string pathToSourceFile, string pathToDestinationFile)
 {
     using (IWaveSource source = CodecFactory.Instance.GetCodec(pathToSourceFile))
     {
         using (IWaveSource destination = source.ToSampleSource().ToWaveSource(16))
         {
             destination.WriteToFile(pathToDestinationFile);
         }
     }
 }
コード例 #2
0
        static void StereoToMono(string input, string sDest)
        {
            CSCore.DSP.ChannelMatrix cm = CSCore.DSP.ChannelMatrix.StereoToMonoMatrix;
            var sarasa = CodecFactory.Instance.GetCodec(input);

            if (sarasa.WaveFormat.Channels == 2)
            {
                IWaveSource waveSource = sarasa.AppendSource(x => new CSCore.Streams.CachedSoundSource(x))
                                         .AppendSource(x => new DmoChannelResampler(x, cm))        //append a channelresampler with the channelmatrix
                                         .ToSampleSource()
                                         .ToWaveSource(16);
                waveSource.WriteToFile(sDest);
            }
            else
            {
                sarasa.WriteToFile(sDest);
            }
            sarasa.Dispose();
        }
コード例 #3
0
ファイル: StageAudio.cs プロジェクト: forki/turnt-ninja
 public void ConvertToWav(string wavFilePath)
 {
     _soundSource.WriteToFile(wavFilePath);
 }