My Nexus 4's speaker failed just after a year. I replaced it with a Nexus 5, whose speaker and microphone failed after 7 months. I did a warranty exchange and the refurbished Nexus 5 now in my pocket's speaker and microphone just went out about a week ago. They share a flex cable that runs under the battery and seems to go bad somehow. I messed with the connection but it didn't fix it. I've preordered the 5x, but this time with the 2-year warranty.
Huh... bought a bunch of Nexus4's 3 years ago for family members (a mix of younger and older people). Some of them are still in use, some of them upgraded. Not a single complaint about random hardware failures (except for worsening battery life of course). Also haven't heard this particular complaint about Nexus devices on the forums etc. Are you sure this is not something specific to your use patterns?
Oh, it's not uncommon. I've commiserated over these issues with dozens of others in Android message boards. There are YouTube videos where people show how to "fix" it, mostly involving jamming things inside the case to hold the flex cable connector in place more firmly. I don't do anything with my phone except put it in my front pant pocket, hold it in my hand, or set it on a wireless charging pad.
> (except for worsening battery life of course)
Compliments of 5.0 Lollipop. It's sad they're going to leave the N4 with that abomination.
The N4 has 5.1.1, and it'll get M via community ROMs for sure.