Alvas.Audio Class Library

AudioCompressionManager.ChangeSpeed Method (IntPtr, Byte[], Int32)

Changes the speed of audio data

[Visual Basic]
Overloads Public Shared Function ChangeSpeed( _
   ByVal format As IntPtr, _
   ByVal data As Byte(), _
   ByVal persent As Integer _
) As Byte()
[C#]
public static byte[] ChangeSpeed(
   IntPtr format,
   Byte[] data,
   Int32 persent
);

Parameters

format
audio format
data
audio data
persent
100 is normal speed, 50 is reduced by half, 200 is increased in 2 times

Return Value

Example

This example shows simple using of ChangeSpeed 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.ChangeSpeed(format, data, persent);
Mp3Writer mw = new Mp3Writer(File.Create(outFile));
mw.WriteData(outData);
mw.Close();
 

See Also

AudioCompressionManager Class | Alvas.Audio Namespace | AudioCompressionManager.ChangeSpeed Overload List