HomeDocs
Skip to main content

playAudioEffect

Introduction

Play an audio effect.

Parameters

ParameterTypeRequiredDescription
idStringtrueThe unique identifier for task.

Example

Page({
data: {
id: '1',
},
onReady() {
this.setAudioEffectOption({ src: 'xxxx/xxx.mp3' }).then((res) => {
this.play().then((res) => {
console.log('playAudioEffect===', res);
});
});
},
setAudioEffectOption(option) {
return new Promise((resolve, reject) => {
dlt.setAudioEffectOption({
id: this.id,
option: JSON.stringify(option),
success: (res) => {
resolve(res);
},
fail: (err) => {
reject(err);
},
});
});
},
play() {
return new Promise((resolve, reject) => {
dlt.playAudioEffect({
id: this.id,
success: (res) => {
resolve(res);
},
fail: (err) => {
reject(err);
},
});
});
},
});
Privacy agreementDeveloper agreementcontact us: developer_service.mi@transsion.com © 2024 MiniApp. All Rights Reserved.