Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var
- sr, Depth: Integer;
- Err: TR8BError;
- InputFormat: TR8BInputFormat;
- BuffIn, BuffOut: Pointer;
- OutLength: Integer;
- FSIn, FSOut: TFileStream;
- ActOut: integer;
- begin
- Done := False;
- FSIn := TFileStream.Create('32k_sample.wav', fmOpenRead );
- FSOut := TFileStream.Create('32k_sample_out.wav', fmCreate);
- try
- GetMem(BuffIn, FSIn.Size);
- FSIn.Read(BuffIn^, FSIn.Size);
- InputFormat.Channels := 1;
- InputFormat.Buffer := BuffIn;
- InputFormat.Len := 32000 * 28;
- InputFormat.Rate := 32000;
- OutLength := Trunc(InputFormat.Len * 44100 / InputFormat.Rate + 0.5);
- GetMem(BuffOut, OutLEngth);
- r8b_executeMem(
- InputFormat,
- BuffOut,
- OutLength,
- 44100,
- 16,
- 0,
- FCancelFlag,
- nil,
- nil,
- Err,
- ActOut
- );
- FSOut.Write(BuffOut^, ActOut)
- finally
- FSIn.Free;
- FSOut.Free;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement