Log in

View Full Version : Check audio/stereo function?


Guest
4th January 2005, 23:35
Is there a way to check if an avisource has audio and if not - then add a silent audiotrack to it?

Tin2tin

stickboy
5th January 2005, 00:08
Originally posted by Guest
Is there a way to check if an avisource has audio and if not - then add a silent audiotrack to it?See my HasAudio function (http://www.avisynth.org/stickboy/).
c = AVISource(...)
c = c.HasAudio() ? c : AudioDub(c, c.BlankClip())

Guest
5th January 2005, 11:20
He he, that's a clever way to do it :) - thanks a lot!

Here's another one for you:

Is it possible to check if a wav is in stereo?

[tried with GetChannel, but it will make an error if there is not 2. channel]

Tin2tin

stickboy
5th January 2005, 11:57
AudioChannels() will tell you.

Wilbert
5th January 2005, 22:41
Nice way to check! HasAudio and HasVideo will be in the next alpha :)

stickboy
6th January 2005, 07:11
They're not that clever. They're basically the same checks that the internal VideoInfo::HasVideo and VideoInfo::HasAudio methods use.

(And I hope whatever you've added to the alpha version use those methods directly. :) )