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