Solved

Compressing Streams

Posted on 1999-01-08
8
306 Views
Last Modified: 2010-04-06
Hi,

I saved the contents of a WAV file in a TMemoryStream.  I need to send this stream via tcp/ip, but it's too big!

Is there any way to compress the stream and decompress it once it gets to the client?

Thanx,

Nadia!
0
Comment
Question by:peimbert
8 Comments
 

Author Comment

by:peimbert
ID: 1355455
Edited text of question
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1355456
Hmmm. Compressing wav files is difficult (look at http://www.experts-exchange.com/Q.10114383 for this theme, the question is still open).
How about splitting the wav file into several packets?

Regards, Madshi.
0
 

Expert Comment

by:qdyoung
ID: 1355457
As what was discussed in Q.10114383, binary compressors provide only about 15% compression. But if you think that it suits your need. Than it's easy. Delphi3 already provide ZLib.pas. ZLIB came with Delphi 3.0 professional, located in the "extras" directory on the CD. You can visit http://www.radix.net/~bziegler/Delphi/Source.html and download remotecontrol.zip for a good example of how to compress TMemoryStream using the ZLib functions. This example compresses bitmap then send the stream via TCP/IP.

Regards, Young.
0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 7

Expert Comment

by:jconde
ID: 1355458
Uh..hmm, 15% doesn't seem much, especially when talking about transmitting "Many" streams through the net.


0
 

Expert Comment

by:jpdupont
ID: 1355459
I use TLZRW1 component with memory/file streams.
The component had an option "uses streams".
Compression is very good (like zip files).
==
TLZRW1 file compression component.
Visual feedback on a Panel if so desired.
VCL code by D. Heijl
==
See on DSP/Torry.
Create the component at run time and set visible:=false  because
this is a visual component - panel descendant.

Jean-Pol
0
 

Author Comment

by:peimbert
ID: 1355460
Your answer is not that bad, but when you want to transmit in a NRT manner, 15% is not that good !!!

I tried using ZLib as you stated, as well as the component proposed by  jpdupont and jpdupont's answer is much better....The compression rate is very good (almost as ZIP format) and the quality mantains (Human ear can detect from 20Hz to 20,000Hz) and only variation occurred beyond the 50,000 Hz.

Thank you very much anyway.
0
 

Author Comment

by:peimbert
ID: 1355461
jpdupont, Since your answer was the best, please post an answer.

Regards,

Nadia
0
 

Accepted Solution

by:
jpdupont earned 100 total points
ID: 1355462
Try the TLZRW1 component.
See comment :

"I use TLZRW1 component with memory/file streams.
The component had an option "uses streams".
Compression is very good (like zip files).
==
TLZRW1 file compression component.
Visual feedback on a Panel if so desired.
VCL code by D. Heijl
==
See on DSP/Torry.
Create the component at run time and set visible:=false  because
this is a visual component - panel descendant."

Jean-Pol

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question