tencent cloud

All product documents
User Generated Short Video SDK
Last updated: 2025-04-01 17:14:08
Android
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);




Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon