ECS-L Home Automation and Security Archives
  learn more | view messages for this month | NetBloc® | terms of use | search

Google
 


  subject (prev) or (next) | time (prev) or (next) | author (prev) or (next) | view more subjects

Subject:
From:
Date:
RE: [ECS] Low modem Record level
David Kindred
Sun, 4 Jun 2000 10:19:57 -0400

Mar,

I'm also trying to find a solution, but it would be an external program. I
have found a Delphi component that might do the trick and have sent a note
to the author asking for details.

Do you think you could incorporate Dario's function, or is it still worth
looking at an external app that I might slap together in Delphi?

--David

P.S. Cool, Dario!

-----Original Message-----
From: Dario Greggio [mailto:adpm.to@inwind.it]
Sent: Sunday, June 04, 2000 5:30 AM
To: ecs-list@netbloc.com
Subject: Re: [ECS] Low modem Record level


Mark Gilmore wrote:
>
> A while back, I spent a lot of time searching for
> a utility pgm that would add gain to an existing
> .WAV, but I could never find one that did NOT
> require some user-interaction.
> Perhaps one of you could give it a try.
> If we can find one, I can have ECS execute
> automatically after recording phone messages.

Hi Mark, I know you don't like such things written in C, but I'm sending
it anyway... :-))

This function takes a bunch of samples (8 bit, mono) "s", whose length
is "l", and gives you back in a buffer called "d" the samples amplified
or reduced by "level" (percentage). In fact, level=100 does nothing.

If you need to start from a WAV file rather than the raw samples, you
should open the file, move to position following "data" plus 4 bytes
(I'm attaching a hex dump of a WAV file from my telephone system) and
from there to EOF execute my function or equivalent.

BYTE *volWaves(BYTE *s,BYTE *d,DWORD l,int level) {
	register int ch;

	if(level==100)
		return d;
	if(!d)
		d=s;
	while(l--) {
		ch=*s;
		if(ch>=0x80)
			ch=(((ch-0x80)*level)/100)+0x80;
		else
			ch=0x80-(((0x80-ch)*level)/100);
		*d=ch;
		s++;
		d++;
		}

	return d;
  }


Hope it helps!

--
Ciao,
Dario
--
ADPM Synthesis sas - Torino
--
http://www.geocities.com/adpm99


  subject (prev) or (next) | time (prev) or (next) | author (prev) or (next) | view more subjects




Services provided by [NetBloc]®! NetBloc Solutions Inc.
Terms of use. Indexing software (c) 1999 Lin-De, Inc
.