Add record and playback sound feature

I am working on a project that requires a feature of record and playback
voice. Does anyone have a good suggestion of approaches? The length of
voice recorded is less than ten seconds.

Thanks

Z