Not any more.
In the comics, there have been stories where recordings have been used - This Quora question lists several of them. Conversely, There's been attempts by Sivana to block the magic lightning by drowning out Billy trying to speak the word by playing loud static so the gods (specifically Zeus, who was in charge of throwing the bolts) couldn't hear him.
One clever dodge (admittedly not using recordings, but too fun not to share) featured Sivana Jr. planting a suggestion in Freddy Freeman's mind, making him incapable of saying the name "Captain Marvel", so he couldn't transform. Eventually the block became so strong he couldn't even think the name. But accidentally, he realized he COULD think (and say) "Captain Marvel Jr." as it was technically a different name.
In the current continuity, Billy summons the lightning down at will, and may do so without saying the word. Similarly, he may say the word without summoning the lightning. This is useful as his name is literally "Shazam" now, and it's hard to go through a day without saying your own name. So a recording of him would have no power, as it'd just be the word, but with none of the will behind it.