Bonjour,
J’ai un fichier audio (lu avec un [tabread~]) qui commence par du silence et aimerai déterminer l’index du 1er sample qui n’est plus du silence. J’ai cherché à faire ça avec [bonk~], [fiddle~] ou encore [sigmund~] mais mes résultats ne sont ni précis ni constants.
Quelqu'un aurait-il une solution? Merci.
Pascal
Hors ligne
If the sound completely silent up to that point your marked (that is, is the table filled with zeroes up to that point) then you can simply go through the array's elements using [tabread ], starting at the first sample and checking if the absolute value of the subsequent ones is larger than zero. If the signal is not completely silent but near silent, then you will can either use sort of attack detection (such as [bonk~]) or simply use something like this:
...
|
[tabread array1]
|
{abs]
|
[> 0.001]
|
[sel 1]
|
...
Note how I used [> 0.001] instead of [> 0]. Adjust this number (either directly as an argument or via the rightmost inlet of [>]) to control the sensitivity of the detection. Then once [sel 1] receives a float of value 1, you can use its bang to stop the process since you found your first non-silent element.
Hors ligne