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/
Erik, Brian, Ok. 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
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
On Fri, 2012-02-17 at 13:05 -0800, Earl Chew wrote:> 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 samplesEither way, the test script needs to check if they exist and give a sensible error (for the tests) if they don't. (put another way, don't assume either of them is available, and don't start requiring them to compile flac without testing it ...) Richard
Earl Chew wrote:> 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) ?Yes, bc looks quite nice. As Richard Ash mentioned, the test should detect the presence of bc and it its not available, print a nice big warning, and exit the script with an error code of 0. If bc is available, run the tests and any failure should result in the script exiting with a non-zero error code. Cheers, Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/