I was about to return my year old Nokia N95 8GB for repair because audio kept dropping out when using in handset mode (not in loudspeaker nor handsfree). I had tried to undelete most software, but was really convinced that this was a hardware problem.
However, a couple of days ago I updated the phone's firmware to version V31.0.015 and guess what; the sound is working again.
I still think it's a crappy phone. Go figure.