Exemplo n.º 1
0
        void UpdateSettings()
        {
            if (string.IsNullOrEmpty(_camID))
            {
                _camID = AudioDeviceManager.ALTNAMEFORNULL;
            }

            MixCastData.CameraCalibrationData curCam = MixCast.Settings.GetCameraByID(_camID);
            if (curCam == null || curCam.audioData == null)
            {
                return; // shouldn't happen, but just in case.
            }
            var device = AudioDeviceManager.GetAudioDeviceByAltName(curCam.audioData.audioAltName);

            if (device != null)
            {
                _adeviceAltName       = device.audioDeviceAltName;
                _adeviceBitsPerSample = (int)device.bitsPerSample;
                _adeviceChannels      = (int)device.channel;
                _adeviceConfiguration = device.defaultSettings.audioConfig;
                _adeviceSamplingRate  = (int)device.samplingRate;
                _adeviceDelayMs       = (int)device.desktopDelayMs;
                // deviceName            = device.audioDeviceName; // commenting out so no import warning in SDK
            }
        }
Exemplo n.º 2
0
        public RETURNCHANGETYPE PlayWithSettings(MixCastData.CameraCalibrationData cam)
        {
            if (_suppressingPlayback)
            {
                return(RETURNCHANGETYPE.NothingNewDoNothing);
            }

            cam.audioData.delayMs = (int)cam.bufferTime;
            micData = AudioDeviceManager.GetAudioDeviceByAltName(cam.audioData.audioAltName);
            if (cam != null)
            {
                if (micData != null)
                {
                    return(SetPlay(cam.audioData.audioAltName, (int)micData.channel, (int)micData.samplingRate, (int)micData.bitsPerSample,
                                   cam.audioData.audioConfig, cam.audioData.volume, cam.audioData.desktopVolume, cam.audioData.delayMs));
                }
                cam.audioData.useAudioInput = false; // mic is null
                return(SetPlay("", 0, 0, 0, cam.audioData.audioConfig, 0.0f, cam.audioData.desktopVolume, cam.audioData.delayMs));
            }
            return(SetPlay("", 0, 0, 0, MixCastAV.AUDIOCONFIG.NO_AUDIO, 0.0f, 0.0f, 0));
        }