Packages | |
package | com.tencent.liteav.audio |
Data Structures | |
interface | TXAudioEffectManager.TXVoiceReverbType |
interface | TXAudioEffectManager.TXVoiceChangerType |
interface | TXAudioEffectManager.TXMusicPlayObserver |
class | TXAudioEffectManager.AudioMusicParam |
interface | TXAudioEffectManager |
Tencent Cloud Audio Effect Management Module.
Module: management class for background music, short audio effects, and voice effects Description: sets background music, short audio effects, and voice effects
interface com::tencent::liteav::audio::TXAudioEffectManager::TXVoiceReverbType |
Reverb effects
Reverb effects can be applied to human voice. Based on acoustic algorithms, they can mimic voice in different environments. The following effects are supported currently: 0: original; 1: karaoke; 2: room; 3: hall; 4: low and deep; 5: resonant; 6: metal; 7: husky; 8: ethereal; 9: studio; 10: melodious; 11: phonograph; 12: nature
Public Member Functions | |
TXLiveVoiceReverbType_0 (0) | |
TXLiveVoiceReverbType_1 (1) | |
TXLiveVoiceReverbType_2 (2) | |
TXLiveVoiceReverbType_3 (3) | |
TXLiveVoiceReverbType_4 (4) | |
TXLiveVoiceReverbType_5 (5) | |
TXLiveVoiceReverbType_6 (6) | |
TXLiveVoiceReverbType_7 (7) | |
TXLiveVoiceReverbType_8 (8) | |
TXLiveVoiceReverbType_9 (9) | |
TXLiveVoiceReverbType_10 (10) | |
TXLiveVoiceReverbType_11 (11) | |
TXLiveVoiceReverbType_12 (12) | |
TXVoiceReverbType (int value) | |
int | getNativeValue () |
|
inline |
|
inline |
TXLiveVoiceReverbType_0 | ( | 0 | ) |
TXLiveVoiceReverbType_1 | ( | 1 | ) |
< Disable
TXLiveVoiceReverbType_10 | ( | 10 | ) |
< studio
TXLiveVoiceReverbType_11 | ( | 11 | ) |
< melodious
TXLiveVoiceReverbType_12 | ( | 12 | ) |
< phonograph
nature
TXLiveVoiceReverbType_2 | ( | 2 | ) |
< Karaoke
TXLiveVoiceReverbType_3 | ( | 3 | ) |
< Room
TXLiveVoiceReverbType_4 | ( | 4 | ) |
< Hall
TXLiveVoiceReverbType_5 | ( | 5 | ) |
< Low and deep
TXLiveVoiceReverbType_6 | ( | 6 | ) |
< Resonant
TXLiveVoiceReverbType_7 | ( | 7 | ) |
< Metal
TXLiveVoiceReverbType_8 | ( | 8 | ) |
< Husky
TXLiveVoiceReverbType_9 | ( | 9 | ) |
< ethereal
interface com::tencent::liteav::audio::TXAudioEffectManager::TXVoiceChangerType |
Voice changing effects
Voice changing effects can be applied to human voice. Based on acoustic algorithms, they change the tone of voice. The following effects are supported currently: 0: original; 1: child; 2: little girl; 3: middle-aged man; 4: metal; 5: nasal; 6: foreign accent; 7: trapped beast; 8: otaku; 9: electric; 10: robot; 11: ethereal
Public Member Functions | |
TXLiveVoiceChangerType_0 (0) | |
TXLiveVoiceChangerType_1 (1) | |
TXLiveVoiceChangerType_2 (2) | |
TXLiveVoiceChangerType_3 (3) | |
TXLiveVoiceChangerType_4 (4) | |
TXLiveVoiceChangerType_5 (5) | |
TXLiveVoiceChangerType_6 (6) | |
TXLiveVoiceChangerType_7 (7) | |
TXLiveVoiceChangerType_8 (8) | |
TXLiveVoiceChangerType_9 (9) | |
TXLiveVoiceChangerType_10 (10) | |
TXLiveVoiceChangerType_11 (11) | |
TXVoiceChangerType (int value) | |
int | getNativeValue () |
|
inline |
|
inline |
TXLiveVoiceChangerType_0 | ( | 0 | ) |
TXLiveVoiceChangerType_1 | ( | 1 | ) |
< Disable
TXLiveVoiceChangerType_10 | ( | 10 | ) |
< Electric
TXLiveVoiceChangerType_11 | ( | 11 | ) |
< Robot
Ethereal
TXLiveVoiceChangerType_2 | ( | 2 | ) |
< Child
TXLiveVoiceChangerType_3 | ( | 3 | ) |
< Little girl
TXLiveVoiceChangerType_4 | ( | 4 | ) |
< Middle-aged man
TXLiveVoiceChangerType_5 | ( | 5 | ) |
< Metal
TXLiveVoiceChangerType_6 | ( | 6 | ) |
< Nasal
TXLiveVoiceChangerType_7 | ( | 7 | ) |
< Foreign accent
TXLiveVoiceChangerType_8 | ( | 8 | ) |
< Trapped beast
TXLiveVoiceChangerType_9 | ( | 9 | ) |
< Otaku
interface com::tencent::liteav::audio::TXAudioEffectManager::TXMusicPlayObserver |
Public Member Functions | |
void | onStart (int id, int errCode) |
void | onPlayProgress (int id, long curPtsMS, long durationMS) |
void | onComplete (int id, int errCode) |
void onComplete | ( | int | id, |
int | errCode | ||
) |
Background music ended.
void onPlayProgress | ( | int | id, |
long | curPtsMS, | ||
long | durationMS | ||
) |
Playback progress of background music.
void onStart | ( | int | id, |
int | errCode | ||
) |
Background music started.
class com::tencent::liteav::audio::TXAudioEffectManager::AudioMusicParam |
Background music playback information
The information, including playback ID, file path, and loop times, is passed in the startPlayMusic API.
interface com::tencent::liteav::audio::TXAudioEffectManager |
Voice effect APIs | |
void | enableVoiceEarMonitor (boolean enable) |
void | setVoiceEarMonitorVolume (int volume) |
void | setVoiceReverbType (TXVoiceReverbType type) |
void | setVoiceChangerType (TXVoiceChangerType type) |
void | setVoiceCaptureVolume (int volume) |
void | setVoicePitch (double pitch) |
Background music APIs | |
void | setMusicObserver (int id, TXMusicPlayObserver observer) |
boolean | startPlayMusic (final AudioMusicParam musicParam) |
void | stopPlayMusic (int id) |
void | pausePlayMusic (int id) |
void | resumePlayMusic (int id) |
void | setAllMusicVolume (int volume) |
void | setMusicPublishVolume (int id, int volume) |
void | setMusicPlayoutVolume (int id, int volume) |
void | setMusicPitch (int id, float pitch) |
void | setMusicSpeedRate (int id, float speedRate) |
long | getMusicCurrentPosInMS (int id) |
long | getMusicDurationInMS (String path) |
void | seekMusicToPosInMS (int id, int pts) |
void enableVoiceEarMonitor | ( | boolean | enable | ) |
Enabling in-ear monitoring
After enabling in-ear monitoring, anchors can hear in earphones their own voice captured by the mic. This is designed for singing scenarios.
In-ear monitoring cannot be enabled for Bluetooth earphones. This is because Bluetooth earphones have high latency. Please ask anchors to use wired earphones via a UI reminder. Given that not all phones deliver excellent in-ear monitoring effects, we have blocked this feature on some phones.
enable | true: enable; false : disable |
long getMusicCurrentPosInMS | ( | int | id | ) |
Getting the playback progress (ms) of background music
id | Music ID |
long getMusicDurationInMS | ( | String | path | ) |
Getting the total length (ms) of background music
path | Path of the music file. |
void pausePlayMusic | ( | int | id | ) |
Pausing background music
id | Music ID |
void resumePlayMusic | ( | int | id | ) |
Resuming background music
id | Music ID |
void seekMusicToPosInMS | ( | int | id, |
int | pts | ||
) |
Setting the playback progress (ms) of background music
id | Music ID |
pts | Unit: millisecond |
void setAllMusicVolume | ( | int | volume | ) |
Setting the local and remote playback volume of background music
This API is used to set the local and remote playback volume of background music.
volume | Volume. Value range: 0-100; default: 100 |
void setMusicObserver | ( | int | id, |
TXMusicPlayObserver | observer | ||
) |
Setting the background music callback
Before playing background music, please use this API to set the music callback, which can inform you of the playback progress.
musicId | Music ID |
observer | For more information, please see the APIs defined in ITXMusicPlayObserver . |
void setMusicPitch | ( | int | id, |
float | pitch | ||
) |
Adjusting the pitch of background music
id | Music ID |
pitch | Pitch. Value range: floating point numbers in the range of [-1, 1]; default: 0.0f |
void setMusicPlayoutVolume | ( | int | id, |
int | volume | ||
) |
Setting the local playback volume of a specific music track
This API is used to control the local playback volume (the volume heard by anchors) of a specific music track.
id | Music ID |
volume | Volume. Value range: 0-100. default: 100 |
void setMusicPublishVolume | ( | int | id, |
int | volume | ||
) |
Setting the remote playback volume of a specific music track
This API is used to control the remote playback volume (the volume heard by audience) of a specific music track.
id | Music ID |
volume | Volume. Value range: 0-100; default: 100 |
void setMusicSpeedRate | ( | int | id, |
float | speedRate | ||
) |
Changing the speed of background music
id | Music ID |
speedRate | Music speed. Value range: floating point numbers in the range of [0.5, 2]; default: 1.0f |
void setVoiceCaptureVolume | ( | int | volume | ) |
Setting speech volume
This API is used to set the volume of speech. It is often used together with the music volume setting API setAllMusicVolume to balance between the volume of music and speech.
volume | Volume. Value range: 0-100; default: 100 |
void setVoiceChangerType | ( | TXVoiceChangerType | type | ) |
Setting voice changing effects
This API is used to set voice changing effects. For the effects supported, please see TXVoiceChangeType.
void setVoiceEarMonitorVolume | ( | int | volume | ) |
Setting in-ear monitoring volume
This API is used to set the volume of in-ear monitoring.
volume | Volume. Value range: 0-100; default: 100 |
void setVoicePitch | ( | double | pitch | ) |
Setting speech pitch
This API is used to set the pitch of speech.
pitch | Ptich,Value range: -1.0f~1.0f; default: 0.0f。 |
void setVoiceReverbType | ( | TXVoiceReverbType | type | ) |
Setting voice reverb effects
This API is used to set reverb effects for human voice. For the effects supported, please see TXVoiceReverbType.
boolean startPlayMusic | ( | final AudioMusicParam | musicParam | ) |
Starting background music
You must assign an ID to each music track so that you can start, stop, or set the volume of music tracks by ID.
musicParam | Music parameter |
startBlock | Callback of starting music |
progressBlock | Callback of playback progress |
completeBlock | Callback of ending music |
void stopPlayMusic | ( | int | id | ) |
Stopping background music
id | Music ID |