Player (66)
Joined: 4/21/2011
Posts: 232
AVISynth has been getting some upgrades, including audiotrim. It is time based instead of sample based, but it seems to work doing this.
AssumeSampleRate(4672).audiotrim(1,0).AssumeSampleRate(last.AudioRate)
P.S. AVS upgrades are on their CVS, no official builds, but here is an unofficial one.
Editor, Emulator Coder, Site Developer
Joined: 5/11/2011
Posts: 1108
Location: Murka
Interesting. As far as AAC fixup goes, can you accomplish the same thing with DelayAudio () ?
Player (66)
Joined: 4/21/2011
Posts: 232
YES! Not sure why the +1 to samples is needed.
function AudioTrimSample(clip clp, int samples){
    clp
    AssumeSampleRate(samples+1)
    DelayAudio(-1)
    AssumeSampleRate(clp.AudioRate)
}
Editor, Emulator Coder, Site Developer
Joined: 5/11/2011
Posts: 1108
Location: Murka
nanogyth wrote:
YES! Not sure why the +1 to samples is needed.
Cut point is probably computed with some dodgy floating point math and then incorrectly rounded.
Player (66)
Joined: 4/21/2011
Posts: 232
They're adding in a .5
a=DelayAudio( -4672.499 /AudioRate).audiolength
b=DelayAudio( -4672.5 /AudioRate).audiolength
subtitle(string(a-b)) #was 1 in the tests I tried
DelayAudio( -4673.0 /AudioRate) Should work pretty well.