|
From: Ulrich K. <ul...@ch...> - 2012-11-30 00:45:39
|
Mathias Lenz <le...@li...>: > It happenes > that I need the exact opposite the silence effect does. I have hours or > even days of audio and need to copy the parts with a level below the > thresold (the "silence") and delete the samples above the thresold. > I know a bit of C programming, and thought it would be easy to alter the > code, but i never get the results I expected. I'd be glad if somebady can > give me a hint how to modify the code to achieve this. Oh, the silence effect code is quite inscrutable. It has so many cases and subcases, and there are bugs lurking in there. In principle, you need to find - the places where data is copied to the output buffer (written to obuf, and nrOfOutSamplesWritten incremented) and remove those, and - the places where data is discarded (nrOfInSamplesRead incremented without a write to obuf or the holdoff buffer) and copy it through instead. However, I guess I'd just print the places (sample counts) where copying is turned on/off, and make a second pass using trim with these values as parameters. I.e., when the modified silence effect tells me "off at 1234567, on at 2345678, off at 3456789", I'd run "trim =1234567s =2345678s =3456789s" next. This seems simpler to me and less error-prone. Ulrich |