ATEM Audio Interface

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

John Hartwell

  • Posts: 3
  • Joined: Wed Jun 15, 2016 3:26 am

ATEM Audio Interface

PostThu Jul 07, 2016 3:44 am

I have been trying to work with the ATEM SDK and am have some difficulty, mostly because I am trying to learn how to work with ‘COM’ in the C# environment. While doing research on ‘COM’ with Microsoft documents, and working with the ATEM samples, I thought I had figured it out. So I have been trying to make a connection (get a pointer) to the IBMDSwitcherAudioMixer interface and control the Program Output Gain.
In the development environment I have no errors, and it compiles without any problems. Yet when the app is run it exits citing an ‘Access Violation’. The code in question is:
IBMDSwitcherAudioMixer mxIterator = null;
IntPtr mxIteratorPtr;
Guid mxIteratorIID = typeof(IBMDSwitcherAudioMixer).GUID;
m_switcher.CreateIterator(ref mxIteratorIID, out mxIteratorPtr);

with the last line where the ‘Access Violation’ occurs. The ‘m_switcher’ object is the switcher object gotten through;
m_switcherDiscovery.ConnectTo(address, out m_switcher, out failReason)
from the C# example included with the SDK.
Can someone point me in the right direction?
Offline

Ian Morrish

  • Posts: 580
  • Joined: Sun Jan 18, 2015 9:24 pm
  • Location: New Zealand

Re: ATEM Audio Interface

PostFri Jul 08, 2016 2:44 am

Funny, I have just spent the last couple of nights trying to get it working and cracked it when I woke up this morning.
I was using the switcher iterator rather than the mixer iterator to get the audio inputs.
switcher is my existing switcher object.

Code: Select all
IBMDSwitcherAudioMixer m_audiomixer;
            m_audiomixer = (BMDSwitcherAPI.IBMDSwitcherAudioMixer)switcher;

            IBMDSwitcherAudioInputIterator audioIterator = null;

            IntPtr audioIteratorPtr;
            Guid audioIteratorIID = typeof(IBMDSwitcherAudioInputIterator).GUID;
           
            m_audiomixer.CreateIterator(ref audioIteratorIID, out audioIteratorPtr);             if (audioIteratorPtr != null)
            {
                audioIterator = (IBMDSwitcherAudioInputIterator)Marshal.GetObjectForIUnknown(audioIteratorPtr);
            }
            int audioinputnum = 1;
           
            IBMDSwitcherAudioInput audioInput;
            audioIterator.Next(out audioInput);

audioInput.xxx will give you level, balance etc.
Regards,
Ian
Regards,
Ian Morrish
Video Integrated Scripting Environment
(Windows PowerShell with ATEM driver + more)
https://ianmorrish.wordpress.com
Offline

Ian Morrish

  • Posts: 580
  • Joined: Sun Jan 18, 2015 9:24 pm
  • Location: New Zealand

Re: ATEM Audio Interface

PostFri Jul 08, 2016 9:11 pm

Video of the audio interface used in PowerShell with Midi device
Regards,
Ian Morrish
Video Integrated Scripting Environment
(Windows PowerShell with ATEM driver + more)
https://ianmorrish.wordpress.com
Offline

John Hartwell

  • Posts: 3
  • Joined: Wed Jun 15, 2016 3:26 am

Re: ATEM Audio Interface

PostMon Jul 11, 2016 12:19 am

Ian,

Thanks for the info, although it was not exactly what I was looking for which was to control the output gain of the ATEM mixer. I had reviewed the input and found that it looked a lot like the video selection interface, which you have just confirmed.

I did however realize from your information that the program gain was a single interface gotten directly through the BMDSwitcherAPI as shown in the lines below.

IBMDSwitcherAudioMixer m_AudioMixer;
m_AudioMixer = (BMDSwitcherAPI.IBMDSwitcherAudioMixer)m_switcher;
m_AudioMixer.AddCallback(m_PgmAudioMixer);
Offline

Ian Morrish

  • Posts: 580
  • Joined: Sun Jan 18, 2015 9:24 pm
  • Location: New Zealand

Re: ATEM Audio Interface

PostMon Jul 11, 2016 7:17 pm

Sorry, missed that. Yes, output is much simpler.
I add the following to my switcher class...

Code: Select all
        private double _gain;
        private double _balance;
        private int _FollowFTB;
        public double ProgramOutGain
        {

            get
            {
                BMDSwitcherAPI.IBMDSwitcherAudioMixer m_params =
               (BMDSwitcherAPI.IBMDSwitcherAudioMixer)switcher;
                m_params.GetProgramOutGain(out _gain);
                return _gain;
            }
            set
            {
                BMDSwitcherAPI.IBMDSwitcherAudioMixer m_params =
               (BMDSwitcherAPI.IBMDSwitcherAudioMixer)switcher;
                m_params.SetProgramOutGain(value);
            }
        }
        public double ProgramOutBalance
        {

            get
            {
                BMDSwitcherAPI.IBMDSwitcherAudioMixer m_params =
               (BMDSwitcherAPI.IBMDSwitcherAudioMixer)switcher;
                m_params.GetProgramOutBalance(out _balance);
                return _balance;
            }
            set
            {
                BMDSwitcherAPI.IBMDSwitcherAudioMixer m_params =
               (BMDSwitcherAPI.IBMDSwitcherAudioMixer)switcher;
                m_params.SetProgramOutBalance(value);
            }
        }
        public int ProgramOutFollowFTB
        {

            get
            {
                BMDSwitcherAPI.IBMDSwitcherAudioMixer m_params =
               (BMDSwitcherAPI.IBMDSwitcherAudioMixer)switcher;
                m_params.GetProgramOutFollowFadeToBlack(out _FollowFTB);
                return _FollowFTB;
            }
            set
            {
                BMDSwitcherAPI.IBMDSwitcherAudioMixer m_params =
               (BMDSwitcherAPI.IBMDSwitcherAudioMixer)switcher;
                m_params.SetProgramOutBalance(value);
            }
        }
Regards,
Ian Morrish
Video Integrated Scripting Environment
(Windows PowerShell with ATEM driver + more)
https://ianmorrish.wordpress.com

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 25 guests