hanfrunz
5th March 2009, 15:26
Hello,
today i needed a -9db sinus-wave-tone. But the tone() function needs a value between 0 and 1. Here's a small function to calculate this value:
function dB2value(float dB) {
return Pow(10.0, dB/20.0)
}
you can then use it in a script like this:
function dB2value(float dB) {
return Pow(10.0, dB/20.0)
}
video=blankclip().converttoyv12()
audio=Tone(120.0, 1000, 48000, 2, "sine", dB2value(-9.0) )
audiodub(video,audio)
histogram("AudioLevels")
should'nt that be implemented to the source code of the filter?
In real life you use dB-values for sound.
regards,
hanfrunz
today i needed a -9db sinus-wave-tone. But the tone() function needs a value between 0 and 1. Here's a small function to calculate this value:
function dB2value(float dB) {
return Pow(10.0, dB/20.0)
}
you can then use it in a script like this:
function dB2value(float dB) {
return Pow(10.0, dB/20.0)
}
video=blankclip().converttoyv12()
audio=Tone(120.0, 1000, 48000, 2, "sine", dB2value(-9.0) )
audiodub(video,audio)
histogram("AudioLevels")
should'nt that be implemented to the source code of the filter?
In real life you use dB-values for sound.
regards,
hanfrunz