1. An application to examine a witness conditionally may be made at any time after the defendant has been arraigned upon an accusatory instrument and before termination of the action, or of a proceeding therein or related thereto, in which the witness’s testimony is sought.2. Such application must be made to and determined by the following courts under the indicated circumstances:
(a) If the action is pending in a local criminal court as a result of an accusatory instrument filed therewith, the application must be made to and determined by such local criminal court;(b) If the defendant has been held by a local criminal court for the action of a grand jury on the basis of a felony complaint, or if an indictment has been filed against him, the application must be made to and determined by the superior court by which the grand jury was or is to be impaneled or in which the indictment is pending. If the superior court by which the grand jury is to be impaneled is the supreme court, the motion may, in the alternative, be made in the county court of the county in which the action is pending.