Suppressed: For Input String: "6ch"

Any questions? Need some help?
Post Reply
jchh
Posts: 45
Joined: 02 Nov 2020, 15:13

Suppressed: For Input String: "6ch"

Post 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!
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Suppressed: For Input String:

Post 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}
:idea: Please read the FAQ and How to Request Help.
jchh
Posts: 45
Joined: 02 Nov 2020, 15:13

Re: Suppressed: For Input String:

Post 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]"}
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Suppressed: For Input String:

Post 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 }
:idea: Please read the FAQ and How to Request Help.
jchh
Posts: 45
Joined: 02 Nov 2020, 15:13

Re: Suppressed: For Input String:

Post 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
Post Reply