From dd8a6eac57a48070e0b3046d6842626209b5e283 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Wed, 17 Feb 1993 14:21:09 +0000 Subject: [PATCH] Added lin2lin, findmax, findfactor and fintfit routines --- Modules/audioop.c | 61 +++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 51 insertions(+), 10 deletions(-) diff --git a/Modules/audioop.c b/Modules/audioop.c index f8810d3eb31..92152b9c2d5 100644 --- a/Modules/audioop.c +++ b/Modules/audioop.c @@ -270,6 +270,46 @@ audioop_rms(self, args) return newintobject(val); } +static object * +audioop_rms2(self, args) + object *self; + object *args; +{ + signed char *cp1, *cp2; + int len1, len2, size, val1, val2; + int i; + float sum_squares = 0.0; + + if ( !getargs(args, "(s#s#i)", &cp1, &len1, &cp2, &len2, &size) ) + return 0; + if ( size != 1 && size != 2 && size != 4 ) { + err_setstr(AudioopError, "Size should be 1, 2 or 4"); + return 0; + } + if ( len1 != len2 ) { + err_setstr(AudioopError, "Samples should be same size"); + return 0; + } + for ( i=0; i