cleaned up audio function