When any witness in any criminal case, imprisoned in default of giving bond for his appearance, shall wish to have his testimony taken and to be enlarged, he shall apply to the judge of the court in which such prosecution is pending to have his testimony taken in writing; and thereupon the judge shall order said testimony to be taken in writing before him in court or in chambers or before any officer authorized by law to administer oaths, after giving forty-eight hours personal notice to the accused and to the district attorney to be present at the time and place of the taking of said testimony; provided, that with the consent of the district attorney and of the accused any and all delays for the taking of said testimony may be waived. If the accused is in jail, the sheriff shall be notified and shall produce the accused at the time and place designated to be confronted with the witness. The testimony when so taken shall be sworn to and signed by the witness if he knows how to write, if not, by his ordinary mark attested by the officer taking the testimony; and the said testimony so certified to shall be without delay returned by the officer taking the same into the court in which said prosecution is pending, together with the said notice and the officer's return of service annexed thereto, and thereupon the said witness shall be discharged from custody.
The taking of this testimony shall be without expense to the witness, but shall be taxed as a part of the costs of the prosecution.
La. R.S. § 15:258