Solved

Compressing Streams

Posted on 1999-01-08
8
308 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
Independent Software Vendors: 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

Technology Partners: 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!

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

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