Click or drag to resize
SoxConvert Method (String, String, 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,
	BinaryWriter to,
	SoxAudioFileType toType
)

Parameters

sox
Type: SystemString
Path to Sox executable file
from
Type: SystemString
Input audio file.
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 Creative Technology Sound Blaster format to a GSM 06.10 (full-rate) lossy speech compression file
try
{
using (BinaryWriter to = new BinaryWriter(File.Create("Output.gsm")))
{
    Sox.Convert("sox.exe", "input.voc", to, SoxAudioFileType.Gsm);
}
}
catch (SoxException e)
{
    Console.WriteLine("{0}: {1}", e.Code, e.Message);
}
See Also