On Nov 26 22:39:27, hans at stare.cz wrote:> On Nov 25 00:43:22, mle+la at mega-nerd.com wrote: > > http://downloads.xiph.org/releases/flac/beta/ > > Please test. > > ./test_replaygain.sh fails for me in tonegenerator(), saying: > > ./test_replaygain.sh[91]: mawk: not found > Testing FLAC replaygain 8000 (8000 x 1) ... -: ERROR: got partial sample > > Apparently, the tone-generating awk script does not work with > my system's awk, which is "awk version 20110810" as distributed > with current OpenBSD 5.6 GENERIC.MP#610 amd64. > With mawk-1.3.4.20140914 it works fine > (and ./test_replaygain.sh passes). > > Can anyone please shed some light on what's mawk-spacific > about that awk script? It seems to be just a sine-generator. > > Here is the head of the hexdump of the two generated tones.Ha! If the final printf("%c", byte[bx]); is changed to printf("%d", byte[bx]); the results produced by mawk and awk are identical. So the diference must be just that mawk printf's "%c" differently. $ wc -c a ma 22000 a 24000 ma
On Nov 26 23:15:04, hans at stare.cz wrote:> On Nov 26 22:39:27, hans at stare.cz wrote: > > On Nov 25 00:43:22, mle+la at mega-nerd.com wrote: > > > http://downloads.xiph.org/releases/flac/beta/ > > > Please test. > > > > ./test_replaygain.sh fails for me in tonegenerator(), saying: > > > > ./test_replaygain.sh[91]: mawk: not found > > Testing FLAC replaygain 8000 (8000 x 1) ... -: ERROR: got partial sample > > > > Apparently, the tone-generating awk script does not work with > > my system's awk, which is "awk version 20110810" as distributed > > with current OpenBSD 5.6 GENERIC.MP#610 amd64. > > With mawk-1.3.4.20140914 it works fine > > (and ./test_replaygain.sh passes). > > > > Can anyone please shed some light on what's mawk-spacific > > about that awk script? It seems to be just a sine-generator. > > > > Here is the head of the hexdump of the two generated tones. > > Ha! If the final > > printf("%c", byte[bx]); > > is changed to > > printf("%d", byte[bx]); > > the results produced by mawk and awk are identical. > So the diference must be just that mawk printf's "%c" differently.BUGS mawk cannot handle ascii NUL \0 in the source or data files. You can output NUL using printf with %c, and any other 8 bit character is acceptable input. Could this be it?
Jan Stary wrote:> Ha! If the final > > printf("%c", byte[bx]); > > is changed to > > printf("%d", byte[bx]); > > the results produced by mawk and awk are identical. > So the diference must be just that mawk printf's "%c" differently.Which version of mawk are you using? I've got 1.3.3 and with your proposed change, test_replaygain.sh fails. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
On Nov 26 17:24:38, mle+la at mega-nerd.com wrote:> Jan Stary wrote: > > > Ha! If the final > > > > printf("%c", byte[bx]); > > > > is changed to > > > > printf("%d", byte[bx]); > > > > the results produced by mawk and awk are identical. > > So the diference must be just that mawk printf's "%c" differently. > > Which version of mawk are you using? I've got 1.3.3 and with your > proposed change, test_replaygain.sh fails.mawk-1.3.4.20140914 But I don't have any proposed change; in particular, I do not suggest to replace printf("%c", byte[bx]); with printf("%d", byte[bx]); I just observe that the two sequences of samples are identical as sequences of integers - they just differ in the way they are printed out with AWK's printf("%c") as opposed to MAWK's printf("%c"). I'll try to find time and look into it; this shouldn't be hard, we just want to generate a sine wave portably. Jan