tencent cloud

Tencent Real-Time Communication

Release Notes and Announcements
Release Notes
Recent Product Announcement
TRTC Live (TUILiveKit) Product Launch Announcement
TRTC Conference Official Editions Launched
The commercial version of Conference is coming soon
Terms and Conditions Applicable to $9.9 Starter Package
Rules for the "First Subscription $100 Discount" Promotion
Announcement on the Start of Beta Testing for Multi-person Audio and Video Conference
TRTC Call Official Editions Launched
License Required for Video Playback in New Version of LiteAV SDK
TRTC to Offer Monthly Packages
Product Introduction
Overview
Concepts
Features
Strengths
Use Cases
Performance Statistics
Tencent RTC Quickplay: Experience Ultimate Real-Time Audio and Video Interaction!
Purchase Guide
Billing Overview
Free Minutes
Monthly subscription
Pay-as-you-go
TRTC Overdue and Suspension Policy
FAQs
Refund Instructions
User Tutorial
Free Demo
Call
Overview
Activate the Service
Run Demo
Integration
Offline Call Push
Conversational Chat
On-Cloud Recording
AI Noise Reduction
UI Customization
Calls integration to Chat
Additional Features
No UI Integration
Server APIs
Client APIs
Solution
ErrorCode
Release Notes
FAQs
Conference
Overview(TUIRoomKit)
Activate the Service (TUIRoomKit)
Run Demo(TUIRoomKit)
Integration(TUIRoomKit)
Screen Sharing (TUIRoomKit)
Schedule a meeting (TUIRoomKit)
In-meeting Call (TUIRoomKit)
UI Customization(TUIRoomKit)
Virtual Background (TUIRoomKit)
Conference Control (TUIRoomKit)
Cloud Recording (TUIRoomKit)
AI Noise Reduction (TUIRoomKit)
In-Conference Chat (TUIRoomKit)
Robot Streaming (TUIRoomKit)
Enhanced Features (TUIRoomKit)
Client APIs (TUIRoomKit)
Server APIs (TUIRoomKit)
FAQs (TUIRoomKit)
Error Code (TUIRoomKit)
SDK Update Log (TUIRoomKit)
Live
Billing of Video Live Component
Overview
Activating the Service (TUILiveKit)
Run Demo
No UI Integration
UI Customization
Live Broadcast Monitoring
Video Live Streaming
Voice Chat Room
Advanced Features
Client APIs
Server APIs
Error Codes
Release Notes
FAQs
RTC Engine
Activate Service
SDK Download
API Examples
Usage Guidelines
API Reference Manual
Advanced Features
AI Integration
Overview
Configure MCP Server
Install Skills
Integration Guide
FAQ
RTC RESTFUL API
History
Introduction
API Category
Room Management APIs
Stream mixing and relay APIs
On-cloud recording APIs
Data Monitoring APIs
Pull stream Relay Related interface
Web Record APIs
AI Service APIs
Cloud Slicing APIs
Cloud Moderation APIs
Making API Requests
Call Quality Monitoring APIs
Usage Statistics APIs
Data Types
Appendix
Error Codes
Console Guide
Application Management
Package Management
Usage Statistics
Monitoring Dashboard
Development Assistance
Solution
Real-Time Chorus
FAQs
Migration Guide
Billing
Features
UserSig
Firewall Restrictions
How to Downsize Installation Package
Android and iOS
Web
Flutter
Electron
TRTCCalling for Web
Audio and Video Quality
Others
Legacy Documentation
RTC RoomEngine SDK(Old)
Integrating TUIRoom (Web)
Integrating TUIRoom (Android)
Integrating TUIRoom (iOS)
Integrating TUIRoom (Flutter)
Integrating TUIRoom (Electron)
TUIRoom APIs
On-Cloud Recording and Playback (Old)
RTC Analytics Monthly Packages (Previous Version)
Protocols and Policies
Compliance
Security White Paper
Notes on Information Security
Service Level Agreement
Apple Privacy Policy: PrivacyInfo.xcprivacy
TRTC Policy
Privacy Policy
Data Processing And Security Agreement
Glossary

Audio Settings

PDF
Focus Mode
Font Size
Last updated: 2025-06-23 14:35:19
this document primarily introduces how to use RTC Room Engine SDK to implement audio settings related features.

Prerequisites

Before using the audio settings related features provided by RTC Room Engine SDK, you need to complete log in to the SDK and ensure that you are in a live room.

User Guide

Turn On/Off Local Microphone

iOS
Android
You can turn on or off your local microphone by calling two APIs: openLocalMicrophone and closeLocalMicrophone.
When calling openLocalMicrophone to turn on the microphone, you need to input a parameter quality in types of TUIAudioQuality to set the audio encoding quality. TUIAudioQuality includes following types. You can select based on your business requirement:
Enumerated Value Type
Meaning
speech
Voice mode. Mono; Raw Bit Rate of audio: 18 kbps; suitable for scenarios mainly for voice calls.
default
Default mode. Mono; Raw Bit Rate of audio: 50 kbps; the default audio quality of the SDK. It is the recommended choice unless otherwise needed.
music
Music mode. Stereo + full-band; Raw Bit Rate of audio: 128 kbps; suitable for scenarios requiring high-quality music transmission, such as online karaoke, music live streaming.
You can turn on or off your local microphone by calling two APIs: openLocalMicrophone and closeLocalMicrophone.
When calling openLocalMicrophone to turn on the microphone, you need to input a parameter quality in types of AudioQuality to set the audio encoding quality. AudioQuality includes following types. You can select based on your business requirement:
Enumerated Value Type
Meaning
SPEECH
Voice mode. Mono; Raw Bit Rate of audio: 18 kbps; suitable for scenarios mainly for voice calls.
DEFAULT
Default mode. Mono; Raw Bit Rate of audio: 50 kbps; the default audio quality of the SDK. It is the recommended choice unless otherwise needed.
MUSIC
Music mode. Stereo + full-band; Raw Bit Rate of audio: 128 kbps; suitable for scenarios requiring high-quality music transmission, such as online karaoke, music live streaming.
Following is the example code for turning on and off the local microphone in default mode.
iOS
Android
import RTCRoomEngine

let roomEngine = TUIRoomEngine.sharedInstance()

// Turn on the local microphone
roomEngine.openLocalMicrophone(.default) {
// Successfully turn on the microphone
} onError: { code, message in
// Fail to turn on the microphone
}

// Turn off the local microphone
roomEngine.closeLocalMicrophone()
TUIRoomEngine roomEngine = TUIRoomEngine.sharedInstance();
// Turn on the local microphone
roomEngine.openLocalMicrophone(TUIRoomDefine.AudioQuality.DEFAULT, new TUIRoomDefine.ActionCallback() {
@Override
public void onSuccess() {
// Successfully turn on the microphone
}
@Override
public void onError(TUICommonDefine.Error error, String message) {
// Fail to turn on the microphone
}
});
// Turn off the local microphone
roomEngine.closeLocalMicrophone();

Update Local Audio Encoding Quality

iOS
Android
When updating the local audio encoding quality, the type of the passed parameters TUIAudioQuality needs to be consistent with what was mentioned in the previous context. Below, taking the default mode as an example, call the updateAudioQuality API to update the encoding quality of local audio:
import RTCRoomEngine

let audioQuality: TUIAudioQuality = .default
TUIRoomEngine.sharedInstance().updateAudioQuality(audioQuality)
When updating the local audio encoding quality, the type of the passed parameters AudioQuality needs to be the same as mentioned above. Below, taking the default mode as an example, call the updateAudioQuality API to update the encoding quality of local audio:
TUIRoomDefine.AudioQuality audioQuality = TUIRoomDefine.AudioQuality.DEFAULT;
TUIRoomEngine.sharedInstance().updateAudioQuality(audioQuality);

Pause/Resume Publishing Local Audio Stream

When you are in the live streaming room, you may need to pause/resume publishing your local audio stream. You can achieve this by calling the following interfaces:
iOS
Android
import RTCRoomEngine

let roomEngine = TUIRoomEngine.sharedInstance()

// Pause publishing local audio stream
roomEngine.muteLocalAudio()

// Resume publishing local audio stream
roomEngine.unmuteLocalAudio() {
// Resume publishing successful
} onError: { code, message in
// Resume publishing failed
}
TUIRoomEngine roomEngine = TUIRoomEngine.sharedInstance();

// Pause publishing local audio stream
roomEngine.muteLocalAudio();

// Resume publishing local audio stream
roomEngine.unmuteLocalAudio(new TUIRoomDefine.ActionCallback() {
@Override
public void onSuccess() {
// Resume publishing successful
}

@Override
public void onError(TUICommonDefine.Error error, String message) {
// Restore publication failed
}
});
Note:
Inside the room, if you have enabled your microphone and called the above API to suspend/resume the publishing of the local audio stream, the SDK will notify users in the room through the onUserAudioStateChanged callback in TUIRoomObserver.


Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback