I know that Data has some functions that are very similar to the biological processes of humans (for example, his cooling system is similar to our own cooling system I believe), but how does Data actually speak? Does he contain an advanced Text-To-Speech module (which I expect the Enterprise's computer would use) or is a much more advanced method using vocal chords and air like we humans do (something I wouldn't put past Dr Soong)?
At first glance, Data does seem to use his mouth (i.e. lips and tongue) to speak, which suggests that he's using some kind of larynx-like expiration-based voice generation system, otherwise, his lip/tongue configuration would not modify the sound much.
However, we also know that Soong deliberately made Data superficially emulate many humanoid functions, such as blinking, breathing, hair growth, etc. to make him seem more human. So his mouth movements could simply be pantomime synchronized with a speaker-based voice box.
Some evidence that supports this include:
- Data/B4 can speak when their heads are detached.
- Data's voice has been demonstrated to change in very unnatural ways: he's able to mimic Picard's voice well enough to deceive the ship's computer's authentication system; when he and B4 are damaged, their voice exhibits a very digital/electronic quality, almost like a low quality recording or telephone line, or an audiostream that's being disrupted by network congestion. In Thine Own Self we also see Data open his mouth and briefly emit a reverb-style noise.
- Lal, who presumably shares similar construction with Data, doesn't appear to rely much on her mouth to form words when she's first constructed (she has a mouth, but it's poorly defined, and her lips don't move much).
That said, all of this is very circumstantial.
The (kinda canon, kinda not) supplement to the official Trek RPG game has a schematic of Cmdr Data's upper body. As you can see from the labelled diagram, his "speech unit" is independent of his artificial lungs. This explains why he's able to speak when his head is disconnected from his body.
The fact that Picard specifically states (in Trek : Insurrection) that Data doesn't breathe, coupled with the fact that he is able to mimic a wide range of human and machine noises all leads me to the conclusion that his voice is little more than a very advanced speaker.