[flac-dev] Regain play analysis patches
Earl Chew
earl_chew at yahoo.com
Fri Feb 17 13:05:11 PST 2012
I'm a little reluctant to introduce another compiled program when there are
so many other options that will work well enough out of the box.
Here are two ideas:
1. Use bc(1) to compute the raw samples
2. Use perl(1) to compute the raw samples
To generate raw unsigned samples using bc(1) for example:
samplerate = 1000;
duration = 2;
bitspersample = 24;
samplerange = 2 ^ (bitspersample-1) - 1;
samplemidpoint = 2 ^ (bitspersample-1);
pi = 4 * a(1);
scale = 18;
obase = 16;
for (ix = 0; ix < duration * samplerate; ++ix) {
sample = samplemidpoint + samplerange * s(2 * pi * ix / samplerate);
s = scale;
scale = 0;
sample /= 1;
sample;
scale = s;
}
Are you ok with bc(1) ? Or would you prefer perl(1) ? Or something else ?
Earl
----- Original Message -----
From: Erik de Castro Lopo <mle+la at mega-nerd.com>
To: flac-dev at xiph.org
Cc:
Sent: Tuesday, February 14, 2012 6:52:34 PM
Subject: Re: [flac-dev] Regain play analysis patches
Brian Willoughby wrote:
> What about using the C library sin() and cos() functions to generate
> the test audio instead of sox? I did not see a description of how
> the test files are generated, so maybe this is easy or maybe it is
> hard. The benefit of shipping the test audio generation source code
> around with the FLAC sources is that the tests won't break when sox
> is modified.
+1
Erik
--
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/
_______________________________________________
flac-dev mailing list
flac-dev at xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev
More information about the flac-dev
mailing list