How to play audio from database?

Have a read of that post for sound file playback.

I would look at creating a repeating group of inputs, similar to when you input a passcode or verification number on an app. then set each group to change focus when not empty.