How to play a sound in a talking dog toy
Personally I'd use something like this: https://www.coolcomponents.co.uk/en/audio-fx-mini-sound-board.html (that specific one looks to be line out only but I've seen similar things with an amplifier built in to drive a small speaker) with the shake switch connected to the random playback input pin.

All you need then is a battery, the shake switch and a speaker.