Trying to control audio gain

Ask software engineering and SDK questions for developers working on Mac OS X, Windows or Linux.
  • Author
  • Message
Offline

tejmii

  • Posts: 5
  • Joined: Thu Nov 10, 2022 12:39 pm
  • Real Name: Tomas Mejzr

Trying to control audio gain

PostMon Apr 03, 2023 8:26 pm

Hello,

i am trying to write an app for ATEM Mini.
Thanks to Sample codes i have an idea how to controll transition and input. But I can't find how to controll audio gain. I tried topics here on forum called "Control Audio Mixer Atem" and "ATEM Audio Interface" but they not worked for me.
When i trying to do something like that
Code: Select all
IBMDSwitcherAudioMixer m_audiomixer;
            m_audiomixer = (BMDSwitcherAPI.IBMDSwitcherAudioMixer)switcher;

It showed me error
System.InvalidCastException: 'Unable to cast COM object of type 'System.__ComObject' to interface type 'BMDSwitcherAPI.IBMDSwitcherAudioMixer'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{BCED8CA2-E915-4701-87D4-F68045701E09}' failed due to the following error: Neznámé rozhraní (0x80004002 (E_NOINTERFACE)).'


Can someone help me how to control audio? Or can someone provide me a sample code?

Thanks a lot,

Tomas
Offline

Cameron Nichols

Blackmagic Design

  • Posts: 443
  • Joined: Mon Sep 04, 2017 4:05 am

Re: Trying to control audio gain

PostWed Apr 12, 2023 5:49 am

Hi Tomas,

The ATEM Mini does not implement the older audio mixer (IBMDSwitcherAudioMixer interface). Instead it implements the Fairlight audio mixer (IBMDSwitcherFairlightAudioMixer interface) which is a more advanced and feature-rich audio mixer.

For full compatibility with both mixers, you should implement similar to:
Code: Select all
IBMDSwitcherFairlightAudioMixer m_fairlightAudioMixer;
IBMDSwitcherAudioMixer m_audiomixer;

try
{
    m_fairlightAudioMixer = (IBMDSwitcherFairlightAudioMixer)switcher;
}
catch (InvalidCastException)
{
   m_audiomixer = (IBMDSwitcherAudioMixer)switcher;
}
Then test (eg m_audiomixer != null) to determine which mixer should be used to set audio gain.

Regards
Cameron
Offline

tejmii

  • Posts: 5
  • Joined: Thu Nov 10, 2022 12:39 pm
  • Real Name: Tomas Mejzr

Re: Trying to control audio gain

PostSat Apr 15, 2023 9:53 am

Hello Cameron!

Thanks a lot for yout answer!
It helped me a lot!

Tomas.

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 18 guests