Log in

View Full Version : audio cutting


Ignus2
12th May 2007, 11:47
Trim() refuses to cut audio-only clips.
Is there a plugin, which can cut audio, either sample based or frame based, if given fps?
(Or preferably both? :) )

--
Greets,
I.

~bT~
12th May 2007, 12:30
try the avs cutter in megui.

wonkey_monkey
12th May 2007, 12:42
Couldn't you just use blankclip and audiodub to attach video to the clips, and then trim them? You can then use audiodub again to attach the audio to a different video, or getchannels to return an audio-only clip, I think.

David

Ignus2
12th May 2007, 20:50
Couldn't you just use blankclip and audiodub to attach video to the clips, and then trim them?

And how do I know the length of BlankClip to create?

wonkey_monkey
12th May 2007, 21:51
AudioLength(clip) will return the number of samples:


a=wavsource("...")
audiodub(blankclip(audiolength(a)),a)


David

Ebobtron
12th May 2007, 22:40
Hello,At 41000 or 48000 samples per secound we have a whole lot of video frames being made. Not that there is anything wrong with that. Too many video frames will just be that, should not cause anything more than confusion.

if you would like the two to match a little closer try something like.
a=wavsource("...")
audiodub(blankclip((audiolength(a)/Audiorate(a))*yourfps),a)

audiolength(a)/Audiorate(a) = nSeconds of audio


http://avsfilmcutter.com

Ebobtron
12th May 2007, 22:56
sorry try this


a=wavsource("...")
audiodub(blankclip(length=int((audiolength(a)/audiorate(a))*yourfps),fps=yourfps),a)

audiolength(a)/Audiorate(a) = nSeconds of audio

This works, I tried it.

IanB
12th May 2007, 23:32
Function AudioTrim(clip aclip, int start, int end, float "fps") {
rate = Default(fps, 25.0) # or 23.976, 29.97
end = (end != 0) ? end : Round(AudioLengthF(aclip) * rate / Audiorate(aclip))
BlankClip(length=end, fps=rate)
AudioDub(aclip)
Trim(start, end)
KillVideo() # 2.5.7 feature
return last
}

stickboy
13th May 2007, 18:18
end = (end != 0) ? end : Round(AudioLenghtF(aclip) * rate / Audiorate(aclip))Typo there. Should be AudioLengthF.

IanB
14th May 2007, 10:30
Oops! Ta! Fixed! :o

Ignus2
20th May 2007, 23:19
Good, it seems the only thing, that made this thread surface was the fact, that I didn't know about the existence of AudioLength(), AudioRate() and the like :)

(For others seeking this information, like me, it's documented here: http://avisynth.org/mediawiki/Clip_properties)

Thanks.

--
Greets,
I.

Space Hopper
1st August 2007, 21:14
Function AudioTrim(clip aclip, int start, int end, float "fps") {
rate = Default(fps, 25.0) # or 23.976, 29.97
end = (end != 0) ? end : Round(AudioLengthF(aclip) * rate / Audiorate(aclip))
BlankClip(length=end, fps=rate)
AudioDub(aclip)
Trim(start, end)
KillVideo() # 2.5.7 feature
return last
}

Thanks, that worked great! :thanks: