OLYMPIA, Wash. — The state Supreme Court on Wednesday reinstated the attempted murder conviction of a Vancouver man who accidentally recorded himself beating and threatening to kill his wife.

John Garrett Smith argued that the recording shouldn’t have been admitted at his trial because it violated his privacy. He made the recording when he called his cellphone from his land line before the 2013 attack; he didn’t hang up, and his cellphone recorded the beating.

Under state law, all parties must consent to a conversation being recorded, but one-party consent recordings are admissible in court if there is an explicit private threat of bodily harm.

Smith’s case raised questions about whether the beating and threats he recorded constituted a “conversation” under the law, and also whether his accidental recording of the attack was made with his own “consent.”

The state Court of Appeals threw out his attempted murder conviction, saying the recording contained a private conversation that was recorded without the couple’s consent.

But the Supreme Court disagreed. The justices split on whether the threats and his wife’s response to them constituted a “conversation,” but it effectively didn’t matter, because they unanimously determined that Smith gave his consent when he made the recording. He knew when he called his cellphone that its voicemail might pick up and start recording, they said.

“John Smith has no right to challenge the admissibility of a recording made in violation of the privacy act that he himself made,” Justice Steven Gonzalez wrote.

Aaron Bartlett, the deputy prosecuting attorney in Clark County, said that while four of the justices differed on what constituted a “conversation” in such scenarios, there were clear on the consent issue: “You can’t record your own crime accidentally or purposefully and somehow use that to escape conviction.”

Smith was sentenced to 12 years after his 2014 conviction for attempted murder and assault; his assault conviction was never overturned. Bartlett said that Smith is being held at Stafford Creek Corrections Center. He is not currently represented by an attorney.