I created a program like that back in the day. In my case, I recorded my voice through the "MIC" input and played it back through the TV. A few seconds of sampled audio required the entire available memory. While I fully understood what was going on, I thought it was magical that the Spectrum could "speak with my voice".
On ZX-Spectrum? There was no "MIC" input on ZX-Spectrum, not that I know of. I was in high school at the time with only a rough understanding of the hardware but it was kinda obvious to me that whatever I plugged into the casette input port was only read as "0" or "1" by the IN <port> (forgot which) instruction. So not really possible to record voice at the time (didn't even know of PCM anyway), but I tried to decode Morse transmissions from radio. Never got anywhere with the software but my ear got good enough at some point that I could decode them myself by hearing :)