If the accused desires to make a voluntary statement, he may do so before the examination of any witness, but not afterward. His statement shall be reduced to writing by or under the direction of the magistrate, or by the accused or his counsel, and shall be signed by the accused by affixing his name or mark, but shall not be sworn to by him. The magistrate shall attest by his own certificate and signature to the execution and signing of the statement.
Tex. Code Crim. Proc. § 16.04