How to get soundcard (play/record sound) inside a container?

You have 2 choices, I recommend second one:

one, directly play sound in container:

two, play sound through host socket: