FuncList | DESC |
Background music preload progress | |
Background music preload error |
FuncList | DESC |
Background music started. | |
Playback progress of background music | |
Background music ended |
FuncList | DESC |
Enabling in-ear monitoring | |
Setting in-ear monitoring volume | |
Setting voice reverb effects | |
Setting voice changing effects | |
Setting speech volume | |
Setting speech pitch | |
Setting the background music callback | |
Starting background music | |
Stopping background music | |
Pausing background music | |
Resuming background music | |
Setting the local and remote playback volume of background music | |
Setting the remote playback volume of a specific music track | |
Setting the local playback volume of a specific music track | |
Adjusting the pitch of background music | |
Changing the speed of background music | |
Getting the playback progress (ms) of background music | |
Getting the total length (ms) of background music | |
Setting the playback progress (ms) of background music | |
Adjust the speed change effect of the scratch disc | |
Setting music preload callback | |
Preload background music | |
Get the number of tracks of background music | |
Specify the playback track of background music |
FuncList | DESC |
Background music playback information |
EnumType | DESC |
Reverb effects | |
Voice changing effects |
void onLoadProgress | (int id |
| int progress) |
void onLoadError | (int id |
| int errorCode) |
Param | DESC |
errorCode | -4001: Failed to open the file, such as invalid data found when processing input, ffmpeg protocol not found, etc; -4002: Decoding failure, such as audio file corruption, inaccessible network audio file server, etc; -4003: The number of preloads exceeded the limit,Please call stopPlayMusic first to release the useless preload;-4005: Invalid path, Please check whether the path you passed points to a legal music file;-4006: Invalid URL, Please use a browser to check whether the URL address you passed in can download the desired music file;-4007: No audio stream, Please confirm whether the file you passed is a legal audio file and whether the file is damaged;-4008: Unsupported format, Please confirm whether the file format you passed is a supported file format. The mobile version supports [mp3, aac, m4a, wav, ogg, mp4, mkv], and the desktop version supports [mp3, aac, m4a, wav, mp4, mkv]. |
void onStart | (int id |
| int errCode) |
Param | DESC |
errCode | 0: Start playing successfully; -4001: Failed to open the file, such as invalid data found when processing input, ffmpeg protocol not found, etc; -4005: Invalid path, Please check whether the path you passed points to a legal music file;-4006: Invalid URL, Please use a browser to check whether the URL address you passed in can download the desired music file;-4007: No audio stream, Please confirm whether the file you passed is a legal audio file and whether the file is damaged;-4008: Unsupported format, Please confirm whether the file format you passed is a supported file format. The mobile version supports [mp3, aac, m4a, wav, ogg, mp4, mkv], and the desktop version supports [mp3, aac, m4a, wav, mp4, mkv]. |
id | music ID. |
void onPlayProgress | (int id |
| long curPtsMS |
| long durationMS) |
void onComplete | (int id |
| int errCode) |
Param | DESC |
errCode | 0: End of play; -4002: Decoding failure, such as audio file corruption, inaccessible network audio file server, etc. |
id | music ID. |
void enableVoiceEarMonitor | (boolean enable) |
Param | DESC |
enable | true: enable; false : disable |
void setVoiceEarMonitorVolume | (int volume) |
Param | DESC |
volume | Volume. Value range: 0-100; default: 100 |
void setVoiceReverbType |
void setVoiceChangerType |
void setVoiceCaptureVolume | (int volume) |
Param | DESC |
volume | Volume. Value range: 0-100; default: 100 |
void setVoicePitch | (double pitch) |
Param | DESC |
pitch | Ptich,Value range: -1.0f~1.0f; default: 0.0f。 |
void setMusicObserver | (int id |
|
Param | DESC |
musicId | Music ID |
observer | For more information, please see the APIs defined in ITXMusicPlayObserver . |
boolean startPlayMusic |
Param | DESC |
musicParam | Music parameter |
void stopPlayMusic | (int id) |
Param | DESC |
id | Music ID |
void pausePlayMusic | (int id) |
Param | DESC |
id | Music ID |
void resumePlayMusic | (int id) |
Param | DESC |
id | Music ID |
void setAllMusicVolume | (int volume) |
Param | DESC |
volume | Volume. Value range: 0-100; default: 60 |
void setMusicPublishVolume | (int id |
| int volume) |
Param | DESC |
id | Music ID |
volume | Volume. Value range: 0-100; default: 60 |
void setMusicPlayoutVolume | (int id |
| int volume) |
Param | DESC |
id | Music ID |
volume | Volume. Value range: 0-100. default: 60 |
void setMusicPitch | (int id |
| float pitch) |
Param | DESC |
id | Music ID |
pitch | Pitch. Value range: floating point numbers in the range of [-1, 1]; default: 0.0f |
void setMusicSpeedRate | (int id |
| float speedRate) |
Param | DESC |
id | Music ID |
speedRate | Music speed. Value range: floating point numbers in the range of [0.5, 2]; default: 1.0f |
long getMusicCurrentPosInMS | (int id) |
Param | DESC |
id | Music ID |
long getMusicDurationInMS | (String path) |
Param | DESC |
path | Path of the music file. |
void seekMusicToPosInMS | (int id |
| int pts) |
Param | DESC |
id | Music ID |
pts | Unit: millisecond |
void setMusicScratchSpeedRate | (int id |
| float scratchSpeedRate) |
Param | DESC |
id | Music ID |
scratchSpeedRate | Scratch disc speed, the default value is 1.0f, the range is: a floating point number between [-12.0 ~ 12.0], the positive/negative speed value indicates the direction is positive/negative, and the absolute value indicates the speed. |
void setPreloadObserver |
Param | DESC |
observer | For more information, please see the APIs defined in ITXMusicPreloadObserver . |
boolean preloadMusic |
Param | DESC |
musicParam | Music parameter |
int getMusicTrackCount | (int id) |
Param | DESC |
id | Music ID |
void setMusicTrack | (int id |
| int trackIndex) |
Param | DESC |
id | Music ID |
index | Specify which track to play (the first track is played by default). Value range [0, total number of tracks). |
Enum | Value | DESC |
TXLiveVoiceReverbType_0 | 0 | disable |
TXLiveVoiceReverbType_1 | 1 | KTV |
TXLiveVoiceReverbType_2 | 2 | small room |
TXLiveVoiceReverbType_3 | 3 | great hall |
TXLiveVoiceReverbType_4 | 4 | deep voice |
TXLiveVoiceReverbType_5 | 5 | loud voice |
TXLiveVoiceReverbType_6 | 6 | metallic sound |
TXLiveVoiceReverbType_7 | 7 | magnetic sound |
TXLiveVoiceReverbType_8 | 8 | ethereal |
TXLiveVoiceReverbType_9 | 9 | studio |
TXLiveVoiceReverbType_10 | 10 | melodious |
TXLiveVoiceReverbType_11 | 11 | studio2 |
Enum | Value | DESC |
TXLiveVoiceChangerType_0 | 0 | disable |
TXLiveVoiceChangerType_1 | 1 | naughty kid |
TXLiveVoiceChangerType_2 | 2 | Lolita |
TXLiveVoiceChangerType_3 | 3 | uncle |
TXLiveVoiceChangerType_4 | 4 | heavy metal |
TXLiveVoiceChangerType_5 | 5 | catch cold |
TXLiveVoiceChangerType_6 | 6 | foreign accent |
TXLiveVoiceChangerType_7 | 7 | caged animal trapped beast |
TXLiveVoiceChangerType_8 | 8 | indoorsman |
TXLiveVoiceChangerType_9 | 9 | strong current |
TXLiveVoiceChangerType_10 | 10 | heavy machinery |
TXLiveVoiceChangerType_11 | 11 | intangible |
EnumType | DESC |
endTimeMS | Field description: the point in time in milliseconds for ending music playback. 0 indicates that playback continues till the end of the music track. |
id | Field description: music IDNote the SDK supports playing multiple music tracks. IDs are used to distinguish different music tracks and control their start, end, volume, etc. |
isShortFile | Field description: whether the music played is a short music track Valid values: true : short music track that needs to be looped; false (default): normal-length music track |
loopCount | Field description: number of times the music track is looped Valid values: 0 or any positive integer. 0 (default) indicates that the music is played once, 1 twice, and so on. |
path | Field description: absolute path of the music file or url.the mp3,aac,m4a,wav supported. |
publish | Field description: whether to send the music to remote users Valid values: true : remote users can hear the music played locally; false (default): only the local user can hear the music. |
startTimeMS | Field description: the point in time in milliseconds for starting music playback |
Was this page helpful?