Click or drag to resize
AudioCompressionManagerWave2Mp3 Method (IntPtr, Byte)
Converts Wave audio data to Mp3 audio data.

Namespace: Alvas.Audio
Assembly: Alvas.Audio (in Alvas.Audio.dll) Version: 2016.0.6173.41573
Syntax
public static byte[] Wave2Mp3(
	IntPtr format,
	byte[] data
)

Parameters

format
Type: SystemIntPtr
audio format
data
Type: SystemByte
audio data

Return Value

Type: Byte

[Missing <returns> documentation for "M:Alvas.Audio.AudioCompressionManager.Wave2Mp3(System.IntPtr,System.Byte[])"]

Examples
This example shows simple using of Wave2Mp3 method.
string inFile = "test2.wav";
string outFile = @"test2.mp3";

WaveReader wr = new WaveReader(File.OpenRead(inFile));
IntPtr format = wr.ReadFormat();
byte[] data = wr.ReadData();
wr.Close();
byte[] dataMp3 = AudioCompressionManager.Wave2Mp3(format, data);
Mp3Writer mw = new Mp3Writer(File.Create(outFile));
mw.WriteData(dataMp3);
mw.Close();
See Also