AudioCompressionManagerCheckSilent Method |
Checks the level of audio signal. If it is above silentLevel returns false otherwise it returns true.
Namespace: Alvas.AudioAssembly: Alvas.Audio (in Alvas.Audio.dll) Version: 2016.0.6173.41573
Syntax public static bool CheckSilent(
IntPtr format,
byte[] data,
short silentLevel
)
Public Shared Function CheckSilent (
format As IntPtr,
data As Byte(),
silentLevel As Short
) As Boolean
public:
static bool CheckSilent(
IntPtr format,
array<unsigned char>^ data,
short silentLevel
)
Parameters
- format
- Type: SystemIntPtr
audio format - data
- Type: SystemByte
audio data - silentLevel
- Type: SystemInt16
Can be in the range 0 .. short.MaxValue
Return Value
Type:
Boolean[Missing <returns> documentation for "M:Alvas.Audio.AudioCompressionManager.CheckSilent(System.IntPtr,System.Byte[],System.Int16)"]
Examples This example shows simple using of CheckSilent method.
private static void SkipSilent(string fileName, short silentLevel)
{
WaveReader wr = new WaveReader(File.OpenRead(fileName));
IntPtr format = wr.ReadFormat();
WaveWriter ww = new WaveWriter(File.Create(fileName + ".wav"), AudioCompressionManager.FormatBytes(format));
int i = 0;
while (true)
{
byte[] data = wr.ReadData(i, 1);
if (data.Length == 0)
{
break;
}
if (!AudioCompressionManager.CheckSilent(format, data, silentLevel))
{
ww.WriteData(data);
}
}
ww.Close();
wr.Close();
}
See Also