A middle-aged software engineer accused in the 2012 shooting death of a teenager during an argument over loud rap music in Jacksonville, Fla., took the stand on Tuesday to testify in his own defence.

Michael Dunn, 47, is being tried in state court on one count of first-degree murder, three counts of attempted first-degree murder and one count of firing a deadly missile into an occupied vehicle tied to the Nov. 23, 2012 shooting that killed 17-year-old Jordan Davis.

Dunn, who has claimed self-defence, testified that prior to the shooting he feared for his life.

"I thought I was going to be killed," he said.

The incident occurred at a gas station where Dunn and his fiancée stopped to buy white wine on the way back to their hotel after attending the wedding of Dunn's son.

hi-jordan-davis-852.jpg

Witness Leland Brunson shows how Michael Dunn pulled back the slide on his weapon as he testifies in Dunn's first-degree murder trial in Jacksonville, Fla., on Feb. 7. (Bob Mack/Reuters, The Florida Times-Union)

Dunn, dressed in a white shirt, green sweater and tie, choked up during the questioning on Tuesday. He said the music from a red Dodge Durango parked at the same gas station grew "really loud" after his fiancée went into the store.

"My review mirror was shaking, my eardrums were vibrating. It was ridiculously loud," Dunn said.

"I said, 'Can you turn that down please?'" he testified. "They turned it off. I said thank you."

But Dunn said the young men in the Durango soon began using expletives and then turned the volume back up.

"I start hearing things like F-him and F-that," he said. "It was mean-spirited."

No weapon found

Dunn's attorney, Cory Strolla, told the jury in his opening statement that Dunn opened fire only after seeing what looked like the barrel of a gun or a lead pipe through the Durango's back passenger window and that he was acting in self-defence as Davis was about to get out of the car.

Police found no weapon in the Durango after the shooting.

The case has drawn comparisons with the prosecution of George Zimmerman in the death of Trayvon Martin in Florida in 2012. In both cases, the victims were black teens killed by men who said they believed their lives were in danger.

In an effort to bolster the state's claim that Davis was not acting aggressively and posed no threat, prosecutors on Monday showed the jury photos of Davis's body in what the medical examiner described as a defensive position. Assistant medical examiner Stacy Simons on Monday said Davis was leaning away from Dunn when the bullet entered his body.