An alleged ice addict accused of murdering his pregnant wife by stabbing her 49 times is claiming he was mentally ill at the time.

Joshua Homann is facing trial in the NSW Supreme Court after pleading not guilty to murdering Kirralee Paepaerei at their western Sydney townhouse in September 2015.

The jury heard the expectant mother died of multiple injuries including at least 28 incision and stab wounds to her neck and 21 stab wounds to her chest.

Her unborn child with Homann didn't survive.

Scroll down for video

Joshua Homann (right) is facing trial in the NSW Supreme Court after pleading not guilty to murdering Kirralee Paepaerei (left) at their western Sydney townhouse in September 2015

A young relative told the court Ms Paepaerei and Homann were yelling when he left the house earlier in the evening.

After he returned about midnight, the relative, who can't be named for legal reasons, heard a big bang and smashing glass.

Homann's car alarm sounded and the relative went outside to see it take off down the street.

He said he went upstairs to tell Ms Paepaerei and Homann the car had been stolen but found her on the ground.

'I thought it was a joke at first ... I was just telling her to wake up,' the relative told the court.

Crown prosecutor Sean Hughes in his opening address said he expected the jury would hear evidence Homann showed up at a nearby police station six minutes after his car left his home.

The jury heard the expectant mother died of multiple injuries including at least 28 incision and stab wounds to her neck and 21 stab wounds to her chest

Homann claimed to have driven there straight away after being attacked by an intruder at home.

'Someone broke into my house and tried to stab me,' Homann allegedly said.

'My partner's at home. You need to make sure she's okay.'

Mr Hughes said the prosecution alleged Homann's intruder story was a lie.

He expected the jury would hear evidence Homann told psychiatrists he'd been a heavy ice user and had previously suffered hallucinations.

Defence barrister Peter Lange said Homann wasn't suggesting he didn't cause Ms Paepaerei's death or that he wasn't responsible.

The barrister said the issue at trial would be what was going on in Homann's mind that night.

He said the case ultimately wasn't about domestic violence or drug use but 'the power of mental illness'.

The trial continues.