How do you set the iPhone to play music/audio while asleep?
EDIT:
In this case it sounds like we want to disable auto-lock. This can be done by opening Settings.app, going to General, then scrolling down to "Auto-Lock". Set this to "Never". 



It is possible use the speakers on iPhone to play even when the device is locked. This is possible by:


Opening Music.app
Select song/album/playlist
Lock the device. The music will continue to play.


You can also double tap the home button when the device is locked to show play/pause controls for the last-played music.

Also, other apps continue to play when the device is locked such as Voice Memos.

Note: all audio will shut off when the phone is powered off.