Canīt think of a topic, but it pretty much has to do with having the script adapt to things.
May sound hard, but itīs a very simple thing i want it to adapt to.
The part i want to enhance is this:
avs2 = "Avisource(""" & Replace(ActiveWorkbook.FullName, ".csv", ".avi") & """).GetChannels(1,1).ConvertToMono()" & ".DelayAudio(-0.0" & Replace(TextBox4.Value, ".", "") & ").SyncAudio(" & TextBox1.Value & ")"
Specifically: ".DelayAudio(-0.0" & Replace(TextBox4.Value, ".", "")
Now it may seem a mess, but just ignore all the code itself, it has to do with Avisynth which is another Script language.
The only thing i want to enhance is DelayAudio.
As you can see, i simple write .DelayAudio(-0.0(texbox)) , The textbox will be something like 63.353223 etc.
This works all fine, as long as the textbox (the value) is only xx.xxxx.... If itīs 3 numbers, the thing breaks, xxx.xxxxx....
Why is because i have only made the code work with 2 digits, hence the "-0.0" , it simply means i only want to use a value under 100.
Normally it isnīt a problem as the value shouldnīt be above 100.
But when it is, it wonīt work, it will write it as a 2 digit.
For example:
44.2222 will be 44.2222 milliseconds, nothing wrong there.
But
121.2323 will become 12.12323 milliseconds, which is way off.
So i want it to adapt. If the value is xx. write -0.0(...), if the value is xxx. write -0.(...).
I think i made a total mess of my explanation, please ask if there is something you donīt understand.
I myself am thinking of something pretty easy, like:
If there is 2 number before . write -0.0, if there is 3, -0. , if 4 -
Something like that.
Will look pretty ugly, but should be simple to implement i think.
Many Thanks!
Bookmarks