Page 1 of 1

Suppressed: For Input String: "6ch"

Posted: 04 Dec 2021, 11:52
by jchh
Hi,

What am I doing wrong with this snippet?

Code: Select all

{af==/6ch/? '6ch':null}
I get the error: Suppressed: For Input String: "6ch"

I have also tried:

Code: Select all

{if  (bitdepth==/6ch/) ''}
{af.matches(/6ch/) ? " [$af]":""}

thanks!

Re: Suppressed: For Input String:

Posted: 04 Dec 2021, 13:06
by rednoah
e.g. check channel count:

Code: Select all

{af == 6 ? '6ch' : null}
e.g. check String match

Code: Select all

{af ==~ /6ch/ ? '6ch' : null}

Re: Suppressed: For Input String:

Posted: 04 Dec 2021, 13:21
by jchh
thanks!

To clarify, both of the following integer checks work:

Code: Select all

{af == 6 ? '6ch' : null}
{af ==~ 6 ? '6ch' : null}
But only the 'not' check works for strings?

Code: Select all

{af==~/2ch/? "]":" [$af]"}

Re: Suppressed: For Input String:

Posted: 04 Dec 2021, 13:33
by rednoah
af is not a String value. It's a ChannelCount value which behaves as if it was an Integer value, except for it's String representation.


:idea: The ==~ regex-match operator automatically treats the left and the right as String regardless of type. == is different and my work differently depending on the type. The == operator for the ChannelCount type currently only works for Integer type values, and seems to fails when comparing to a non-number String value.


:?: I'm not sure what you're trying to do. I guess one of these two things?

e.g. add 6ch for files that have exactly 6 audio channels:

Code: Select all

{ af == 6 ? " [6ch]" : null }
e.g. add 6ch, 8ch, etc for files where there are 3 or more audio channels:

Code: Select all

{ af > 2 ? " [$af]" : null }

Re: Suppressed: For Input String:

Posted: 04 Dec 2021, 13:37
by jchh
agh, got it - thanks!

yes, I was trying to do the 2nd thing:

Code: Select all

{ af > 2 ? " [$af]" : null }
...and learn at the same time :D