WAVParser Console Write Initializing WaveFileReader reader new WaveFil

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
WAVParser()
{
Console.Write("Initializing");
WaveFileReader reader = new WaveFileReader("X:\\test.wav");
WaveOffsetStream offsetStream = new WaveOffsetStream(reader);
WaveChannel32 channelSteam = new WaveChannel32(offsetStream);
int bps = (channelSteam.WaveFormat.BitsPerSample / 8) * channelSteam.WaveFormat.Channels;
byte[] buffer = new byte[bps];
Console.Write("Initialized");
for (i = 0; i < 100000; i++)
{
channelSteam.Read(buffer, 0, bps);
for (int j = 0; j < bps; j++)
{
Console.Write(buffer[j]);
}
Console.Write('\n');
buffer = new byte[bps];
}
Console.Write(i);
}