If speaker, earpiece and microphone all fail together, the audio IC on the board may be faulty.
1. Test each speaker and mic with known good parts first.
2. Check if recording a video has sound.
3. Check the phone isn't stuck in headphone mode (headphone icon with nothing plugged in).
4. Look for corrosion around the audio circuit.
5. Some iPhones are known for audio IC faults after drops. The phone may also be slow to start and have greyed out voice memos.
Audio IC repair needs hot air and good board skills. Confirm the diagnosis before quoting.