You can accomplish this using the /playsound
command. The syntax is:
/playsound <sound> <source> <player> [x] [y] [z] [volume] [pitch] [minimumVolume]
With it, you can play a record like this:
/playsound record.cat record @a
sound
is the name of the sound event to play; here's a list.
source
determines which slider on Music & Sound Options will affect the sound's volume.
player
is a selector determining who the sound will be played to.
x y z
are the coordinates of the sound's origin (louder the closer you are to it)
volume
is how loud the sound is (over 1 has no effect for this), and how far away it can be heard from.
pitch
is the pitch of the sound, between 0 and 2 (lower than 0.5 has no effect)
minimumVolume
is the volume the sound plays to for anyone who's too far away to hear the sound normally.