When an examination takes place in a criminal action before a magistrate, the state or the defendant may have the deposition of any witness taken by any officer authorized by this chapter. The state or the defendant may not use the deposition for any purpose unless that party first acknowledges that the entire evidence or statement of the witness may be used for or against the defendant on the trial of the case, subject to all legal objections. The deposition of a witness duly taken before an examining trial or a jury of inquest and reduced to writing or recorded and then certified according to law, provided that the defendant and the defendant's attorney were present when that testimony was taken and that the defendant had the privilege afforded of cross-examining the witness, or taken at any prior trial of the defendant for the same offense, may be used by either the state or the defendant in the trial of the defendant's criminal case under the following circumstances:
When oath is made by the party using the deposition that the witness resides outside the state; or that since the witness's testimony was taken, the witness has died, or has removed beyond the limits of the state, or has been prevented from attending the court through the act or agency of the other party, or by the act or agency of any person whose object was to deprive the state or the defendant of the benefit of the testimony; or that by reason of age or bodily infirmity, that witness cannot attend; or that the witness is a Medicaid or Medicare recipient or a caregiver or guardian of the recipient, and the recipient's Medicaid or Medicare account was charged for a product or service that was not provided or rendered to the recipient. When the testimony is sought to be used by the state, the oath may be made by any credible person. When sought to be used by the defendant, the oath must be made by the defendant in person.
Tex. Code Crim. Proc. § 39.01