Hi,
I’m really new in those forums, but I have used Audacity for years.
I have a problem with a audio track from my dv camcorder (mini-dv sd).
Here is the problem : from time to time, during the video, the sound makes a sort of “click”.
When I import the sound of the video inside audacity, I found that the “clicks” are either left or right.
And I have found that the structure of the click is quite simple :
A sample every 4 or 5 (or 6 or 7) has a db value of zero.
I could fix it by raising the sample to it’s (approximative) original value manually, but it’s an enormous work.
So I thought about creating a plugin for Audacity. I make some programs, but in a C, or php, or basic syntax. But Nyquist has a quite different syntax ; and I would like to work with individual samples (which is not covered by the tutorial).
So I have wrotten a pseudo-code for my plugin. So if I someone could translate it into a Nyquist plugin, it would save me a lot of time (and could help my friends with having an usable video of their show…).
Here is the pseudo code :
for $i=0 to numberOfSample(selection)-1
{
if (($i>0) and ($i<numberOfSample(selection)-1)) then
{
if (getdbSample(selection, $i) ==0)
{
putdbSample(selection, $i, (getdbSample(selection, $i)+getdbSample(selection, $i))/2);
}
}
}
Where numberOfSample(s) is a function that returns the number of samples in the selection s;
Where getdbSample(s,n) is a function that returns the db value of the sample number n in the selection s;
Where putdbSample(s,n,v) is a function that replaces the db value of the sample number n in the selection s by the value v;
Could you help me with this ?
Cordially
Jean CARTIER