Beispiel #1
0
        public override void DeleteTexture(int tex)
        {
            if (_rtcEngine == null)
            {
                return;
            }

            IRtcEngineNative.deleteTexture(tex);
        }
Beispiel #2
0
        /** Retrieves the total number of the indexed video recording devices in the system.
         *
         * @return Total number of the indexed video recording devices.
         */
        public override int GetVideoDeviceCount()
        {
            if (_mEngine == null)
            {
                return((int)ERROR_CODE.ERROR_NOT_INIT_ENGINE);
            }

            return(IRtcEngineNative.getVideoDeviceCollectionCount());
        }
Beispiel #3
0
        /** Create a VideoDeviceManager instance.
         *
         * @note Ensure that you call {@link agora_gaming_rtc.VideoDeviceManager.ReleaseAVideoDeviceManager ReleaseAVideoDeviceManager} to release this instance after calling this method.
         *
         * @return
         * - true: Success.
         * - false: Failure.
         */
        public override bool CreateAVideoDeviceManager()
        {
            if (_mEngine == null)
            {
                return(false);
            }

            return(IRtcEngineNative.createAVideoDeviceManager());
        }
        /** Starts the test of the current audio playback device.
         *
         * This method tests whether the audio playback device works properly. Once a user starts the test, the SDK plays an audio file
         * specified by the user. If the user can hear the audio, the playback device works properly.
         *
         * After calling this method, the SDK triggers the
         * {@link agora_gaming_rtc.OnVolumeIndicationHandler OnVolumeIndicationHandler} callback every 100 ms, which
         * reports `uid = 1` and the volume of the playback device.
         *
         * @note
         * - Ensure that you call {@link agora_gaming_rtc.AudioPlaybackDeviceManager.StopAudioPlaybackDeviceTest StopAudioPlaybackDeviceTest} after calling this method.
         * - Call this method before joining a channel.
         * - This method is for Windows and macOS only.
         *
         * @param testAudioFilePath The path of the audio file for the audio playback device test in UTF-8:
         * - Supported file formats: wav, mp3, m4a, and aac.
         * - Supported file sample rates: 8000, 16000, 32000, 44100, and 48000 Hz.
         *
         * @return
         * - 0: Success, and you can hear the sound of the specified audio file.
         * - < 0: Failure.
         */
        public override int StartAudioPlaybackDeviceTest(string testAudioFilePath)
        {
            if (mEngine == null)
            {
                return((int)ERROR_CODE.ERROR_NOT_INIT_ENGINE);
            }

            return(IRtcEngineNative.startAudioPlaybackDeviceTest(testAudioFilePath));
        }
Beispiel #5
0
        /** Starts the video recording device test.
         *
         * This method tests whether the video recording device works properly. Before calling this method, ensure that you have already called the {@link agora_gaming_rtc.IRtcEngine.EnableVideo EnableVideo} method, and the window handle (`hwnd`) parameter is valid.
         *
         * @note
         * Ensure that you call {@link agora_gaming_rtc.VideoDeviceManager.StopVideoDeviceTest StopVideoDeviceTest} after calling this method.
         *
         * @param hwnd The window handle used to display the screen.
         *
         * @return
         * - 0: Success.
         * - < 0: Failure.
         */
        public override int StartVideoDeviceTest(IntPtr hwnd)
        {
            if (_mEngine == null)
            {
                return((int)ERROR_CODE.ERROR_NOT_INIT_ENGINE);
            }

            return(IRtcEngineNative.startVideoDeviceTest(hwnd));
        }
        /** Sets the audio playback device using the device ID.
         *
         * @note
         * - Call {@link agora_gaming_rtc.AudioPlaybackDeviceManager.GetAudioPlaybackDevice GetAudioPlaybackDevice} before this method.
         * - Plugging or unplugging the audio device does not change the device ID.
         *
         * @param deviceId Device ID of the audio playback device, retrieved by calling `GetAudioPlaybackDevice`.
         *
         * @return
         * - 0: Success.
         * - < 0: Failure.
         */
        public override int SetAudioPlaybackDevice(string deviceId)
        {
            if (mEngine == null)
            {
                return((int)ERROR_CODE.ERROR_NOT_INIT_ENGINE);
            }

            return(IRtcEngineNative.setAudioPlaybackDevice(deviceId));
        }
        /** Sets whether to stop audio playback.
         *
         * @param mute Sets whether to stop audio playback.
         * - true: Stops.
         * - false: Doesn't stop.
         *
         * @return
         * - 0: Success.
         * - < 0: Failure.
         */
        public override int SetAudioPlaybackDeviceMute(bool mute)
        {
            if (mEngine == null)
            {
                return((int)ERROR_CODE.ERROR_NOT_INIT_ENGINE);
            }

            return(IRtcEngineNative.setAudioPlaybackDeviceMute(mute));
        }
Beispiel #8
0
        /** Starts the test of the current audio recording device.
         *
         * This method tests whether the local audio devices are working properly. After calling this method, the microphone captures the local audio and plays it through the speaker. The {@link agora_gaming_rtc.OnVolumeIndicationHandler OnVolumeIndicationHandler} callback returns the local audio volume information at the set interval.
         *
         * @note
         * - Ensure that you call {@link agora_gaming_rtc.AudioRecordingDeviceManager.StopAudioRecordingDeviceTest StopAudioRecordingDeviceTest} after calling this method.
         * - This method tests the local audio devices and does not report the network conditions.
         *
         * @param indicationInterval The time interval (ms) at which the `OnVolumeIndicationHandler` callback returns.
         *
         * @return
         * - 0: Success.
         * - < 0: Failure.
         */
        public override int StartAudioRecordingDeviceTest(int indicationInterval)
        {
            if (mEngine == null)
            {
                return((int)ERROR_CODE.ERROR_NOT_INIT_ENGINE);
            }

            return(IRtcEngineNative.startAudioRecordingDeviceTest(indicationInterval));
        }
        /** UnRegisters the audio raw data observer.
         *
         * @return
         * - 0: Success.
         * - < 0: Failure.
         */
        public override int UnRegisterAudioRawDataObserver()
        {
            if (_irtcEngine == null)
            {
                return((int)ERROR_CODE.ERROR_NOT_INIT_ENGINE);
            }

            return(IRtcEngineNative.unRegisterAudioRawDataObserver());
        }
Beispiel #10
0
        /** Retrieves the total number of the indexed audio recording devices in the system.
         *
         * @return Total number of the indexed audio recording devices.
         */
        public override int GetAudioRecordingDeviceCount()
        {
            if (mEngine == null)
            {
                return((int)ERROR_CODE.ERROR_NOT_INIT_ENGINE);
            }

            return(IRtcEngineNative.getAudioRecordingDeviceCount());
        }
Beispiel #11
0
        /** Sets the volume of the current audio recording device.
         *
         * @param volume The volume of the current audio recording device. The value ranges between 0 (lowest volume) and 255 (highest volume).
         *
         * @return
         * - 0: Success.
         * - < 0: Failure.
         */
        public override int SetAudioRecordingDeviceVolume(int volume)
        {
            if (mEngine == null)
            {
                return((int)ERROR_CODE.ERROR_NOT_INIT_ENGINE);
            }

            return(IRtcEngineNative.setAudioRecordingDeviceVolume(volume));
        }
Beispiel #12
0
        /** UnRegisters the video raw data observer.
         *
         * @return
         * - 0: Success.
         * - < 0: Failure.
         */
        public override int UnRegisterVideoRawDataObserver()
        {
            if (_irtcEngine == null)
            {
                return((int)ERROR_CODE.ERROR_OK);
            }

            return(IRtcEngineNative.unRegisterVideoRawDataObserver());
        }
Beispiel #13
0
        public override int SetVideoRenderMode(VIDEO_RENDER_MODE _renderMode)
        {
            if (_rtcEngine == null)
            {
                return((int)ERROR_CODE.ERROR_NOT_INIT_ENGINE);
            }

            return(IRtcEngineNative.setRenderMode((int)_renderMode));
        }
Beispiel #14
0
        public override bool GetMultiChannelWanted()
        {
            if (_rtcEngine == null)
            {
                return(false);
            }

            return(IRtcEngineNative.getMultiChannelWanted());
        }
Beispiel #15
0
        /** Changes the voice pitch of the local speaker.
         *
         * @note You can call this method either before or after joining a channel.
         *
         * @param pitch Sets the voice pitch. The value ranges between 0.5 and 2.0. The lower the value, the lower the voice pitch. The default value is 1.0 (no change to the local voice pitch).
         *
         * @return
         * - 0: Success.
         * - < 0: Failure.
         */
        public override int SetLocalVoicePitch(double pitch)
        {
            if (_mEngine == null)
            {
                return((int)ERROR_CODE.ERROR_NOT_INIT_ENGINE);
            }

            return(IRtcEngineNative.setLocalVoicePitch(pitch));
        }
Beispiel #16
0
        /** Pulls the remote audio data.
         *
         * Before calling this method, call the {@link agora_gaming_rtc.IRtcEngine.SetExternalAudioSink SetExternalAudioSink(enabled: true)} method to enable and set the external audio sink.
         *
         * After a successful method call, the app pulls the decoded and mixed audio data for playback.
         *
         * @note
         * - Once you call the `PullAudioFrame` method successfully, the app will not retrieve any audio data from the {@link agora_gaming_rtc.AudioRawDataManager.OnPlaybackAudioFrameHandler OnPlaybackAudioFrameHandler} callback.
         * - The difference between the `OnPlaybackAudioFrameHandler` callback and the `PullAudioFrame` method is as follows:
         *   - `OnPlaybackAudioFrameHandler`: The SDK sends the audio data to the app through this callback. Any delay in processing the audio frames may result in audio jitter.
         *   - `PullAudioFrame`: The app pulls the remote audio data. After setting the audio data parameters, the SDK adjusts the frame buffer and avoids problems caused by jitter in the external audio playback.
         *
         * @param audioBuffer The data buffer of the audio frame. When the audio frame uses a stereo channel, the data buffer is interleaved. The size of the data buffer is as follows: `audioBuffer` = `samples` &times; `channels` &times; `bytesPerSample`.
         * @param type The type of the audio frame. See #AUDIO_FRAME_TYPE.
         * @param samples The number of samples per channel in the audio frame.
         * @param bytesPerSample The number of bytes per audio sample, which is usually 16-bit (2-byte).
         * @param channels The number of audio channels.
         * - 1: Mono
         * - 2: Stereo (the data is interleaved)
         * @param samplesPerSec The sample rate.
         * @param renderTimeMs The timestamp of the external audio frame. You can use this parameter for the following purposes:
         * - Restore the order of the captured audio frame.
         * - Synchronize audio and video frames in video-related scenarios, including where external video sources are used.
         * @param avsync_type The reserved parameter.
         *
         * @return
         * - 0: Success.
         * - < 0: Failure.
         */
        public override int PullAudioFrame(IntPtr audioBuffer, int type, int samples, int bytesPerSample, int channels, int samplesPerSec, long renderTimeMs, int avsync_type)
        {
            if (_irtcEngine == null)
            {
                return((int)ERROR_CODE.ERROR_NOT_INIT_ENGINE);
            }

            return(IRtcEngineNative.pullAudioFrame_(audioBuffer, type, samples, bytesPerSample, channels, samplesPerSec, renderTimeMs, avsync_type));
        }
Beispiel #17
0
        /** Retrieves the volume of the audio effects.
         *
         * The value ranges between 0.0 and 100.0.
         *
         * @note Ensure that this method is called after {@link agora_gaming_rtc.AudioEffectManagerImpl.PlayEffect PlayEffect}.
         *
         * @return
         * - &ge; 0: Volume of the audio effects, if this method call succeeds.
         * - < 0: Failure.
         */
        public override double GetEffectsVolume()
        {
            if (_mEngine == null)
            {
                return((double)ERROR_CODE.ERROR_NOT_INIT_ENGINE);
            }

            return(IRtcEngineNative.getEffectsVolume());
        }
Beispiel #18
0
        /** Sets the volume of the audio effects.
         *
         * @note Ensure that this method is called after {@link agora_gaming_rtc.AudioEffectManagerImpl.PlayEffect PlayEffect}.
         *
         * @param volume Sets the volume of the audio effects. The value ranges between 0 and 100 (default).
         *
         * @return
         * - 0: Success.
         * - < 0: Failure.
         */
        public override int SetEffectsVolume(int volume)
        {
            if (_mEngine == null)
            {
                return((int)ERROR_CODE.ERROR_NOT_INIT_ENGINE);
            }

            return(IRtcEngineNative.setEffectsVolume(volume));
        }
        /** Retrieves the volume of the current audio playback device.
         *
         * @return
         * - The volume of the current audio playback device, if this method call succeeds.
         * - < 0: Failure.
         */
        public override int GetAudioPlaybackDeviceVolume()
        {
            if (mEngine == null)
            {
                return((int)ERROR_CODE.ERROR_NOT_INIT_ENGINE);
            }

            return(IRtcEngineNative.getAudioPlaybackDeviceVolume());
        }
Beispiel #20
0
        /** Preloads a specified audio effect file into the memory.
         *
         * To ensure smooth communication, limit the size of the audio effect file. We recommend using this method to preload the audio effect before calling the {@link agora_gaming_rtc.IRtcEngine.JoinChannelByKey JoinChannelByKey} method.
         *
         * Supported audio formats: mp3, aac, m4a, 3gp, and wav.
         *
         * @note This method does not support online audio effect files.
         *
         * @param soundId ID of the audio effect. Each audio effect has a unique ID.
         * @param filePath The absolute path of the audio effect file.
         *
         * @return
         * - 0: Success.
         * - < 0: Failure.
         */
        public override int PreloadEffect(int soundId, string filePath)
        {
            if (_mEngine == null)
            {
                return((int)ERROR_CODE.ERROR_NOT_INIT_ENGINE);
            }

            return(IRtcEngineNative.preloadEffect(soundId, filePath));
        }
        /** Retrieves the status of the current audio playback device.
         *
         * @return Whether the current audio playback device stops audio playback.
         * - true: Stops.
         * - false: Doesn't stop.
         */
        public override bool IsAudioPlaybackDeviceMute()
        {
            if (mEngine == null)
            {
                return(false);
            }

            return(IRtcEngineNative.isAudioPlaybackDeviceMute());
        }
Beispiel #22
0
        /** Pauses a specified audio effect.
         *
         * @param soundId ID of the audio effect. Each audio effect has a unique ID.
         *
         * @return
         * - 0: Success.
         * - < 0: Failure.
         */
        public override int PauseEffect(int soundId)
        {
            if (_mEngine == null)
            {
                return((int)ERROR_CODE.ERROR_NOT_INIT_ENGINE);
            }

            return(IRtcEngineNative.pauseEffect(soundId));
        }
        /** Create an AudioPlaybackDeviceManager instance.
         *
         * @note Ensure that you call {@link agora_gaming_rtc.AudioPlaybackDeviceManager.ReleaseAAudioPlaybackDeviceManager ReleaseAAudioPlaybackDeviceManager} to release this instance after calling this method.
         *
         * @return
         * - true: Success.
         * - false: Failure.
         */
        public override bool CreateAAudioPlaybackDeviceManager()
        {
            if (mEngine == null)
            {
                return(false);
            }

            return(IRtcEngineNative.creatAAudioPlaybackDeviceManager());
        }
Beispiel #24
0
        /** Resumes playing all audio effects.
         *
         * @return
         * - 0: Success.
         * - < 0: Failure.
         */
        public override int ResumeAllEffects()
        {
            if (_mEngine == null)
            {
                return((int)ERROR_CODE.ERROR_NOT_INIT_ENGINE);
            }

            return(IRtcEngineNative.resumeAllEffects());
        }
Beispiel #25
0
        /** Stops the video recording device test.
         *
         * @note Ensure that you call this method to stop the test after calling {@link agora_gaming_rtc.VideoDeviceManager.StartVideoDeviceTest StartVideoDeviceTest}.
         *
         * @return
         * - 0: Success.
         * - < 0: Failure.
         */
        public override int StopVideoDeviceTest()
        {
            if (_mEngine == null)
            {
                return((int)ERROR_CODE.ERROR_NOT_INIT_ENGINE);
            }

            return(IRtcEngineNative.stopVideoDeviceTest());
        }
Beispiel #26
0
        /** Sets the voice-only mode (transmit the audio stream only), and the other streams will be ignored; for example the sound of the keyboard strokes.
         *
         * @param enable Whether to enable the voice-only mode.
         * - true: Enable.
         * - false: Disable.
         *
         * @return
         * - 0: Success.
         * - < 0: Failure.
         */
        public override int SetVoiceOnlyMode(bool enable)
        {
            if (_mEngine == null)
            {
                return((int)ERROR_CODE.ERROR_NOT_INIT_ENGINE);
            }

            return(IRtcEngineNative.setVoiceOnlyMode(enable));
        }
Beispiel #27
0
        /** Sets the video recording device using the device ID.
         *
         * @note
         * - Call {@link agora_gaming_rtc.VideoDeviceManager.GetVideoDevice GetVideoDevice} before this method.
         * - Plugging or unplugging the video device does not change the device ID.
         *
         * @param deviceId Device ID of the video recording device, retrieved by calling `GetVideoDevice`.
         *
         * @return
         * - 0: Success.
         * - < 0: Failure.
         */
        public override int SetVideoDevice(string deviceId)
        {
            if (_mEngine == null)
            {
                return((int)ERROR_CODE.ERROR_NOT_INIT_ENGINE);
            }

            return(IRtcEngineNative.setVideoDeviceCollectionDevice(deviceId));
        }
Beispiel #28
0
        /** Sets the sound position and gain of a remote user.
         *
         * When the local user calls this method to set the sound position of a remote user, the sound difference between the left and right channels allows the local user to track the real-time position of the remote user, creating a real sense of space. This method applies to massively multiplayer online games, such as Battle Royale games.
         *
         * @note
         * - For this method to work, enable stereo panning for remote users by calling the {@link agora_gaming_rtc.IRtcEngine.EnableSoundPositionIndication EnableSoundPositionIndication} method before joining a channel.
         * - This method requires hardware support. For the best sound positioning, we recommend using a stereo speaker.
         * - Ensure that you call this method after joining a channel.
         *
         * @param uid The ID of the remote user.
         * @param pan The sound position of the remote user. The value ranges from -1.0 to 1.0:
         * - 0.0: the remote sound comes from the front.
         * - -1.0: the remote sound comes from the left.
         * - 1.0: the remote sound comes from the right.
         * @param gain Gain of the remote user. The value ranges from 0.0 to 100.0. The default value is 100.0 (the original gain of the remote user). The smaller the value, the less the gain.
         *
         * @return
         * - 0: Success.
         * - < 0: Failure.
         */
        public override int SetRemoteVoicePosition(uint uid, double pan, double gain)
        {
            if (_mEngine == null)
            {
                return((int)ERROR_CODE.ERROR_NOT_INIT_ENGINE);
            }

            return(IRtcEngineNative.setRemoteVoicePosition(uid, pan, gain));
        }
Beispiel #29
0
        /** Release a VideoDeviceManager instance.
         *
         * @return
         * - 0: Success.
         * - < 0: Failure.
         */
        public override int ReleaseAVideoDeviceManager()
        {
            if (_mEngine == null)
            {
                return((int)ERROR_CODE.ERROR_NOT_INIT_ENGINE);
            }

            return(IRtcEngineNative.releaseAVideoDeviceManager());
        }
Beispiel #30
0
        public override int GenerateNativeTexture()
        {
            if (_rtcEngine == null)
            {
                return((int)ERROR_CODE.ERROR_NOT_INIT_ENGINE);
            }

            return(IRtcEngineNative.generateNativeTexture());
        }