Solved

Compressing Streams

Posted on 1999-01-08
8
307 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Title # Comments Views Activity
Simple Delphi Question 9 105
select query - oracle 16 101
Firemonkey android show image from resource ? 1 57
Delphi: making a BW image transparent 10 94
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

726 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