Packages/Photon/Photon/PhotonVoice/Code/Recorder.cs
/// <summary>
/// Sets the AudioSessionParameters for iOS audio initialization when Photon MicrophoneType is used.
/// </summary>
/// <param name="category">Audio session category to be used.</param>
/// <param name="mode">Audio session mode to be used.</param>
/// <param name="options">Audio session category options to be used</param>
/// <returns>If a change has been made.</returns>
Sets the AudioSessionParameters for iOS audio initialization when Photon MicrophoneType is used.
Sets the AudioSessionParameters for iOS audio initialization when Photon MicrophoneType is used .
public bool SetIosAudioSessionParameters(IOS.AudioSessionCategory category, IOS.AudioSessionMode mode, IOS.AudioSessionCategoryOption[] options)
        {
            int opt = 0;
            if (options != null)
            {
                for (int i = 0; i < options.Length; i++)
                {
                    opt |= (int)options[i];
                }
            }
            if (this.audioSessionParameters.Category != category || 
                this.audioSessionParameters.Mode != mode ||
                this.audioSessionParameters.CategoryOptionsToInt() != opt)
            {
                this.audioSessionParameters.Category = category;
                this.audioSessionParameters.Mode = mode;
                this.audioSessionParameters.CategoryOptions = options;
                if (this.Logger.IsInfoEnabled)
                {
                    this.Logger.LogInfo("Changing iOS audioSessionParameters = {0}", this.audioSessionParameters);
                }
                #if !UNITY_EDITOR
                if (this.IsRecording && this.SourceType == InputSourceType.Microphone && this.MicrophoneType == MicType.Photon)
                {
                    this.RequiresRestart = true;
                    if (this.Logger.IsInfoEnabled)
                    {
                        this.Logger.LogInfo("Recorder.{0} changed, Recorder requires restart for this to take effect.", "iOSAudioSessionParameters");
                    }
                }
                #endif
                return true;
            }
            return false;
        }
public bool SetIosAudioSessionParameters ( IOS . AudioSessionCategory category , IOS . AudioSessionMode mode , IOS . AudioSessionCategoryOption [ ] options ) { int opt = 0 ; if ( options != null ) { for ( int i = 0 ; i < options . Length ; i ++ ) { opt |= ( int ) options [ i ] ; } } if ( this . audioSessionParameters . Category != category || this . audioSessionParameters . Mode != mode || this . audioSessionParameters . CategoryOptionsToInt ( ) != opt ) { this . audioSessionParameters . Category = category ; this . audioSessionParameters . Mode = mode ; this . audioSessionParameters . CategoryOptions = options ; if ( this . Logger . IsInfoEnabled ) { this . Logger . LogInfo ( " " , this . audioSessionParameters ) ; } if ! UNITY_EDITOR if ( this . IsRecording && this . SourceType == InputSourceType . Microphone && this . MicrophoneType == MicType . Photon ) { this . RequiresRestart = true ; if ( this . Logger . IsInfoEnabled ) { this . Logger . LogInfo ( " " , " " ) ; } } endif return true ; } return false ; }
Sets the AudioSessionParameters for iOS audio initialization when Photon MicrophoneType is used.
Sets the AudioSessionParameters for iOS audio initialization when Photon MicrophoneType is used .
If a change has been made.
If a change has been made .
category
IOS.AudioSessionCategory
Audio session category to be used.
Audio session category to be used .
mode
IOS.AudioSessionMode
Audio session mode to be used.
Audio session mode to be used .
options
IOS.AudioSessionCategoryOption[]
Audio session category options to be used
Audio session category options to be used