gpt4 book ai didi

api - SoundCloud Widget API setVolume 方法坏了?

转载 作者:行者123 更新时间:2023-12-01 09:59:32 24 4
gpt4 key购买 nike

我成功地使用了 Soundcloud 的小部件 API,除了 setVolume() 方法被破坏了:(

首先,我喜欢这个小部件,但令我震惊的是,在完成了如此惊人的工作之后却没有可用的音量控制!当人们听到 100% 的音频时,他们会立即“后退按钮”退出我的网站,而我无法使用 setVolume() 改变它...我必须让它工作或拉动它:(

这是正在发生的事情,我有一个名为“widget”的实例(它在页面上加载和播放良好)。

widget.bind(SC.Widget.Events.READY, function() {
$('#audioIndictments').removeClass('remove'); // This disables a CSS rule, making the soundCloud iframe visible

widget.setVolume(10); // This should set the volume to 10% but doesn't :(
widget.getVolume(function(vol){
console.log(vol); // This outputs 0.1 in the console :/
console.log(widget); // This outputs the object in the console and I don't see anything out of whack :|
});

widget.play(); // This successfully fires up the widget and the audio begins playing :)
widget.setVolume(10); // Just to see if it makes a difference, after the play() method, I ran setVolume again after the play() method and still no change :(

widget.getVolume(function(vol){
console.log(vol); // This still outputs 0.1 in the console :/
});
});

奇怪的结果。我找到了另一个问过类似问题的博主,但没有得到满意的答案。这是怎么回事?我没有看到什么?

感谢您抽出宝贵时间:)

最佳答案

尝试使用 0 到 1 之间的音量。这对我来说已经解决了。

0.25 = 25% 体积

关于api - SoundCloud Widget API setVolume 方法坏了?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18329013/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com