Click or drag to resize
AudioCompressionManagerChangeVolume Method
Changes the volume of audio data

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

Parameters

format
Type: SystemIntPtr
audio format
data
Type: SystemByte
audio data
persent
Type: SystemInt32
100 is normal volume, 50 is reduced by half, 200 is increased in 2 times

Return Value

Type: Byte

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

Examples
This example shows simple using of ChangeVolume method.
string inFile = @"in.mp3";
string outFile = @"out.mp3";
int persent = 50;
Mp3Reader mr = new Mp3Reader(File.OpenRead(inFile));
IntPtr format = mr.ReadFormat();
byte[] data = mr.ReadData();
mr.Close();
byte[] outData = AudioCompressionManager.ChangeVolume(format, data, persent);
Mp3Writer mw = new Mp3Writer(File.Create(outFile));
mw.WriteData(outData);
mw.Close();
See Also