我知道可以通过执行从 ref 获取字符串值
name = ref ""
name := "Dmitriy"
print("#{name}")
但我想从 ref 获取浮点值
freq = ref 0.0
def change_pitch()
freq := random.float(min=50.0,max=1000.0)
1.0
end
add_timeout(fast=true,1.0,change_pitch)
output.icecast(%mp3,
host = "coolgoga.hldns.ru", port = 8000,
password = "xxx", mount = "entity",
name="Entity Radio", genre="Any", description="EntityinArray's favourite
music",
sine(duration=0.1,!!!TOFLOAT_SOMEHOW(freq))
)
我想制作一个每秒都会改变音高的正弦波音调。
感谢帮助。