public static CreateCustomFormat ( WaveFormatEncoding tag, int sampleRate, int channels, int averageBytesPerSecond, int blockAlign, int bitsPerSample ) : |
||
tag | WaveFormatEncoding | The encoding |
sampleRate | int | Sample Rate |
channels | int | Number of channels |
averageBytesPerSecond | int | Average Bytes Per Second |
blockAlign | int | Block Align |
bitsPerSample | int | Bits Per Sample |
return |
public static WaveFormat CreateCustomFormat(WaveFormatEncoding tag, int sampleRate, int channels, int averageBytesPerSecond, int blockAlign, int bitsPerSample)
{
WaveFormat waveFormat = new WaveFormat();
waveFormat.waveFormatTag = tag;
waveFormat.channels = (short)channels;
waveFormat.sampleRate = sampleRate;
waveFormat.averageBytesPerSecond = averageBytesPerSecond;
waveFormat.blockAlign = (short)blockAlign;
waveFormat.bitsPerSample = (short)bitsPerSample;
waveFormat.extraSize = 0;
return waveFormat;
}
/// <summary> /// Creates a Mu-law wave format /// </summary> /// <param name="sampleRate">Sample Rate</param> /// <param name="channels">Number of Channels</param> /// <returns>Wave Format</returns> // Token: 0x06000889 RID: 2185 RVA: 0x0001892D File Offset: 0x00016B2D public static WaveFormat CreateMuLawFormat(int sampleRate, int channels) { return(WaveFormat.CreateCustomFormat(WaveFormatEncoding.MuLaw, sampleRate, channels, sampleRate * channels, channels, 8)); }