Click or drag to resize
SoxConvert Method (String, String, SoxAudioFileType, BinaryWriter, SoxAudioFileType)
Converts the audio data from the specified audio file type to the new audio file type.

Namespace: Alvas.Audio
Assembly: Alvas.Audio (in Alvas.Audio.dll) Version: 2016.0.6173.41573
Syntax
public static void Convert(
	string sox,
	string from,
	SoxAudioFileType fromType,
	BinaryWriter to,
	SoxAudioFileType toType
)

Parameters

sox
Type: SystemString
Path to Sox executable file
from
Type: SystemString
Input audio file.
fromType
Type: Alvas.AudioSoxAudioFileType
Input audio file type
to
Type: System.IOBinaryWriter
Output writer that write an audio data to the stream.
toType
Type: Alvas.AudioSoxAudioFileType
Output audio file type
Examples
This example shows how translates an audio file in GSM 06.10 (full-rate) lossy speech compression to a WavPack lossless, lossy, and hybrid audio compression file
try
{
using (BinaryWriter to = new BinaryWriter(File.Create("Output.wv")))
{
    Sox.Convert("sox.exe", "input.gsm", SoxAudioFileType.Gsm, to, SoxAudioFileType.Wv);
}
}
catch (SoxException e)
{
    Console.WriteLine("{0}: {1}", e.Code, e.Message);
}
See Also