Section 73. Any person in the commonwealth kept in confinement awaiting trial for more than six months after having been indicted, and finally acquitted or discharged without trial, if the delay in trial was not at his request or with his consent, or at the request or with the consent of his attorney of record, may receive compensation for the period of his confinement after the lapse of said six months and until his acquittal or discharge; provided, that the payment of compensation is approved by the justice who presided at the trial, or in the case of a discharge without trial, by a justice of the superior court sitting at a session for criminal business in and for the county where the indictment was found. Such compensation shall be paid by the commonwealth and shall be equivalent to the amount which the indicted person earned or received from his regular employment for any period of equal length during the two years immediately preceding his confinement; and if he had no employment, the compensation shall be such reasonable sum as shall be determined by the justice who presided at the trial, or, in the case of a discharge without trial, by a justice of the superior court sitting at a session for criminal business in and for the county where the indictment was found. The justice, upon application by the person acquitted or discharged, shall give a hearing at which such person or his representative may be present, if he so desires, and the district attorney or other officer representing the commonwealth may also be present, and the person acquitted or discharged and the commonwealth may offer testimony as in any civil case. The decision of the justice shall be final.