# Audaspace Game Property in Python script doesn't work as expected

So I made a little test using Audaspace lowpass filter in a python script template, modified a little by myself (I'm new in python, so it is very possible that I made a mistake). Everything are working well, except when I try to change the Lowpass filter value using a Game Propertie modified in game with logic bricks. The idea is to change the lowpass filter for an effect in a videogame (e.g. underwater, behind wall).

Does anybody have a solution, it would be really helpfull.

import bge
from bge import logic

import aud

cont = logic.getCurrentController()
own = cont.owner

logic.device = aud.device()
soundpath = logic.expandPath('//Sounds/Engine.wav')
sound = aud.Factory.file(soundpath)

handle = logic.device.play(sound.lowpass(own["Amount"]))
handle.volume = 1


Your mistake is in logic.device.play(sound.lowpass(own["Amount"])) you are missing the frequency value and the amount go from 0.0 to 1.0 (step=0.1)

From the Blender aud API:

lowpass(frequency, Q=0.5)

Creates a second order lowpass filter based on the transfer function H(s) = 1 / (s^2 + s/Q + 1)

Parameters:

frequency (float) – The cut off trequency of the lowpass.

Q (float) – Q factor of the lowpass.

Returns: The created Factory object.

Return type: Factory

Test this (i havent test it):

import bge
from bge import logic
import aud

cont = logic.getCurrentController()
own = cont.owner

logic.device = aud.device()
soundpath = logic.expandPath('//Sounds/Engine.wav')
sound = aud.Factory.file(soundpath)
fequency = 100.0 #Hz i assume
amnt = own["Amount"] * 0.1
sound = sound.lowpass(frequency,amnt)
handle = logic.device.play(sound)
handle.volume = 1
`