refactored audio handling