audio rewrite, works on iOS, to be tested