tencent cloud

User Generated Short Video SDK

Android

PDF
Focus Mode
Font Size
Last updated: 2025-04-01 17:14:08

Adding Background Music During Shooting

// Set BGM path
mTXUGCRecord.setBGM(path);

// Play BGM from startTime to endTime
mTXUGCRecord.playBGMFromTime(startTime, endTime)

// Stop BGM playback
mTXUGCRecord.stopBGM();

// Pause BGM playback
mTXUGCRecord.pauseBGM();

// Resume BGM playback
mTXUGCRecord.resumeBGM();

// Set the volume of background music (BGM). Used when playing background music mixing to control BGM volume level
// Volume value: 1 is normal volume, recommended range 0~2. For higher BGM volume, larger values can be set
mTXUGCRecord.setBGMVolume(x);

// Set the start and end positions for BGM playback. Must be called before startPlay; invalid if called while paused
mTXUGCRecord.seekBGM(startTime, endTime);





Help and Support

Was this page helpful?

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

Feedback