Adapted to web audio api changes