tencent cloud

User Generated Short Video SDK

動態と公告
Release Notes
The “startPlay” API of the UGSV SDK Renamed
製品紹介
Overview
Features
Use Cases
Concepts
購入ガイド
Pricing Overview
Refund Policy
License ガイド
Adding and Renewing a License
Configuring and Viewing a License
SDKのダウンロード
SDK Download
Release Notes (App)
UI 統合ソリューションを含む
UGSV Demo App
Source Code Description (iOS)
Source Code Description (Android)
UI 統合ソリューションを含まない
SDK Integration
Capturing and Shoot
Preview, Clipping, and Splicing
Upload and Playback
Tencent Effect SDK
Advanced Features and Special Effects
API ドキュメント
Editing
Shooting
テクニカルサポート
Error Codes
Feature FAQs
よくある質問
Upload
Android Compilation
Android
iOS
License
UGSV ポリシー
プライバシーポリシー
データ処理とセキュリティ契約

iOS

PDF
フォーカスモード
フォントサイズ
最終更新日: 2025-04-01 17:14:08

Adding Background Music During Shooting

// Get the recorder instance
TXUGCRecord *recorder = [TXUGCRecord shareInstance];

// Set BGM file path
[recorder setBGMAsset:path];

// Set BGM using AVAsset loaded from the system media library
[recorder setBGMAsset:asset];

// Play BGM
[recorder playBGMFromTime:beginTime
toTime:endTime
withBeginNotify:^(NSInteger errCode) {
// Playback start callback. errCode 0: success, others: failure
} withProgressNotify:^(NSInteger progressMS, NSInteger durationMS) {
// progressMS: elapsed time (ms), durationMS: total duration (ms)
} andCompleteNotify:^(NSInteger errCode) {
// Playback complete callback. errCode 0: success, others: failure
}];

// Stop BGM playback
[recorder stopBGM];

// Pause BGM playback
[recorder pauseBGM];

// Resume BGM playback
[recorder resumeBGM];

// Set microphone volume (used during BGM mixing)
// volume: 1.0 is normal volume. Recommended range: 0-2. Higher values allowed for amplification.
[recorder setMicVolume:1.0];

// Set BGM volume (used during BGM mixing)
// volume: 1.0 is normal volume. Recommended range: 0-2. Higher values allowed for amplification.
[recorder setBGMVolume:1.0];

ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック