How the /playsound Command Works
The full syntax is /playsound <sound> <source> <target> [pos] [volume] [pitch] [minVolume]. The source decides which volume slider in the player's settings controls it (master, music, blocks, hostile mobs, and so on). Position defaults to the executor when omitted.
Examples
Play the wither spawn sound to everyone at their own position.
Play the Pigstep music disc to the nearest player.
All 1,838 sound events are on the Sound ID list, grouped by category.