I want to generate a short voice messege using AT89C2051 microcontroller. But I don't have any idea of doing this such as where and How to store the messege? How to generate it using speaker? Please sort me out..
A simple voice message can be made using a PWM output to a low pass filter/amplifier and a speaker. Voice alone needs 8kHz sample rate, and 8 bits per sample is plenty.
So you need a place to store 8,000 bytes for every second of your message(s), plus a way to read them at 8,000 bytes a second.
I don't use Atmel products so I have no details there.
option 2 requires more effort, you need to integrate an MP3 codec and choose storage (EEPROM or SD card for example) which adds to complexity of the project.
option 3 is similar to the option 2 in terms of development but rather than playing back pre-recorded audio messages, it can synthesize voice from a text / string. just make sure to pick correct chip (unless you like non-English accent for example). one such example appeared few years ago as a contest entry for Zilog z8 Encore!
While this is a different platform, it is still very interesting read and it will give you an idea of what can be done and what it takes to get there. Check out included audio file. I had to convert writeup report from Word document to PDF to get around AAC attachment size (.doc was over 8Mb).