View Single Post
Old 8th April 2013, 13:03   #73  |  Link
Reino
Registered User
 
Reino's Avatar
 
Join Date: Nov 2005
Posts: 693
Quote:
Originally Posted by http://avisynth.org/mediawiki/Trim
Since v2.60 you can trim the audio using AudioTrim. The start_time, end_time and duration need to be specified in seconds (but can be float)
Is it really?
I'm trying to load a cue-indexed audiosong from a TAK-image which starts at 40053972 samples (908.25333s) and is 16986144 samples (385.17333s) long:
Code:
LoadDll("C:\Program Files\AviSynth 2.6.0\plugins\tak_deco_lib.dll")
BassAudioSource("D:\Test\Image.tak")

AudioTrim(40053972/44100,-16986144/44100)
AudioTrim(Float(40053972)/44100,Float(-16986144)/44100)

ConvertAudioTo16bit
With the 1st AudioTrim foobar returns a length of 16978500 samples or exactly 385s. It seems the start_time and end_time are floored somehow. I'd figure the starting point would also be 40042800 samples or 908s.

With the 2nd AudioTrim foobar returns 16986144 samples, but when I then bit-compare the Avisynth-script and the cue-indexed TAK-song, it doesn't seem to be accurate:
Code:
Differences found in 1 out of 1 track pairs.

Comparing:
"D:\Test\Image.tak" / index: 3
"D:\Test\Image.avs"
Differences found: 33952821 sample(s), starting at 0.0000000 second(s), peak: 1.4393005 at 35.8453061 second(s), 2ch
- How come Float() is needed?
- Is it possible to AudioTrim with sample accuracy?
__________________
My hobby website
Reino is offline   Reply With Quote