When an issue of fact shall be joined upon any indictment, the court in which the same is pending may, on application of the defendant, grant a commission to examine any material witnesses residing out of this state, in the same manner as in civil cases.
MCL 767.77