AudioCompressionManagerFade Method |
Creates fade in/out effect
Namespace: Alvas.AudioAssembly: Alvas.Audio (in Alvas.Audio.dll) Version: 2016.0.6173.41573
Syntax public static byte[] Fade(
IntPtr format,
byte[] data,
bool isIn
)
Public Shared Function Fade (
format As IntPtr,
data As Byte(),
isIn As Boolean
) As Byte()
public:
static array<unsigned char>^ Fade(
IntPtr format,
array<unsigned char>^ data,
bool isIn
)
Parameters
- format
- Type: SystemIntPtr
input audio format - data
- Type: SystemByte
input audio data - isIn
- Type: SystemBoolean
true for fade in; otherwise, fade out.
Return Value
Type:
Byteaudio data with fade in/out effect
Examples This example shows simple using of Fade method.
WaveReader wr = new WaveReader(File.OpenRead("in.wav"));
IntPtr format = wr.ReadFormat();
byte[] data1 = wr.ReadData(0, 1);
byte[] data2 = wr.ReadData(1, 1);
byte[] data3 = wr.ReadData(2, 1);
wr.Close();
byte[] data11 = AudioCompressionManager.Fade(format, data1, true);
byte[] data33 = AudioCompressionManager.Fade(format, data3, false);
WaveWriter ww = new WaveWriter(File.Create("out.wav"), AudioCompressionManager.FormatBytes(format));
ww.WriteData(data11);
ww.WriteData(data2);
ww.WriteData(data33);
ww.Close();
See Also