nonexistent function 'get_magnitude_for_frequency_range'

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By tshrpl

I am getting this particular runtime error

heres my audio bus layout
enter image description here

and heres my script

var definition = 6
var total_w = 400
var total_h = 200

var min_freq = 20
var max_freq = 20000

var max_db = -16
var min_db = -55

export(float) var accel = 10
var histogram = []

onready var spectrum

func _ready():

	var bgm_bus_id = AudioServer.get_bus_index('Background Music')
	spectrum = AudioServer.get_bus_effect(bgm_bus_id, 0)


func _process(delta):


	var freq = min_freq
	var interval = (max_freq - min_freq) / definition
	
	for i in range(definition):
		
		var freqrange_low = float(freq - min_freq) / float(max_freq - min_freq)
		freqrange_low = freqrange_low * freqrange_low * freqrange_low * freqrange_low
		freqrange_low = lerp(min_freq, max_freq, freqrange_low)
		
		freq += interval
		
		var freqrange_high = float(freq - min_freq) / float(max_freq - min_freq)
		freqrange_high = freqrange_high * freqrange_high * freqrange_high * freqrange_high
		freqrange_high = lerp(min_freq, max_freq, freqrange_high)
		
		var mag = spectrum.get_magnitude_for_frequency_range(freqrange_low, freqrange_high)
		mag = linear2db(mag.length())
		mag = (mag - min_db) / (max_db - min_db)
		
		mag += 0.3 * (freq - min_freq) / (max_freq - min_freq)
		mag = clamp(mag, 0.05, 1)
		
		histogram[i] = 0.1 + lerp(histogram[i], mag, accel * delta)

	print(histogram)
:bust_in_silhouette: Reply From: flurick

I don’t know the use-case for get_bus_effect() but it looks like you are trying to use get_bus_effect_instance(), which is strangely close to each other name wise.