Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2011-08

Deflating file created with TPAbbrevia

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Leonardo M. Ramé

Hi, the attached file is a .wav file created on Windows and compressed with TPAbbrevia's DeflateStream method of AbZipPrc unit.

I need to decompress it using fpc and save to a folder, to be played with mplayer.

This snippet shows what I'm doing to decompress the file, but I'm getting "buffer error" in DeCompress method.

    lcompressedStream := TMemoryStream.Create;
    lUncompressedStream := TMemoryStream.Create;
    lcompressedStream.LoadFromFile('compressed.file');
    lcompressedStream.Position:= 0;
    lDecompressor := TInflater.Create(lcompressedStream, lUncompressedStream,  lcompressedStream.Size);
    try
      lDecompressor.DeCompress;
      lUncompressedStream.Position:= 0;
      lUncompressedStream.SaveToFile('output.wav');
    finally
      lDecompressor.Free;
      lcompressedStream.Free;      lUncompressedStream.Free;
    end; 

Does anyone can check the attached file to help me to uncompress it?.

Maybe TInflater is not the class that I should use to decompress this file.  
Leonardo M. Ramé
http://leonardorame.blogspot.com

Reply by email