Start with the Pinwiki: http://www.pinwiki.com/wiki/index.php?title=Bally/Stern#Squawk_.26_Talk_Sound_Board_Troubleshooting
Mr. & Mrs. Pac-Man
Given that the test works properly but during a game it's not working I would check the wiring harness. Could be the MPU isn't sending the signal (or it's being sent, but not received) to the Squawk & Talk to tell it to produce the sound.
Welcome to Pinside!