I have downloaded the Wave Audio component for using in the speech processing. However, I am trying to directly exact 16-bit data stream from the PCM file format but I cannot do that. As Kambiz replied on the question "How get the exact silence time" about the stream object that shown only the example of 8-bit audio data accessing (buffer is defined as Byte). Could any one kindly suggest me how to deal with 16-bit data? Which part of the following code should be changed? I am truly appreciative for the helping.
//-------- Example of 8-bit audio data accessing -----------------
var
Wave: TWaveFile;
BytesRead: Integer;
Buffer: array[0..1023] of Byte;
begin
Wave := TWaveFile.Create('C:\Sample.wav', fmOpenRead or fmShareDenyWrite);
try
Wave.BeginRead;
try
BytesRead := Wave.Read(Buffer, SizeOf(Buffer));
while BytesRead > 0 do
begin
// process the buffer
BytesRead := Wave.Read(Buffer, SizeOf(Buffer));
end;
finally
Wave.EndRead;
end;
finally
Wave.Free;
end;
end;