fix nullptr deref

also take mono audio into account