HomeDocs
Skip to main content

stopAudioEffect

Introduction

Stop audio playback.

Parameters

ParameterTypeRequiredDescription
idStringtrueThe unique identifier for task.

Example

Page({
data: {
id: '1',
},
onReady() {
this.setAudioEffectOption({ src: 'xxxx/xxx.mp3' }).then((res) => {
this.stop().then((res) => {
console.log('stopAudioEffect===', 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);
},
});
});
},
stop() {
return new Promise((resolve, reject) => {
dlt.stopAudioEffect({
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.