When you insert a disc into a jukebox, the disc will play until the song ends even if you turn music off. Turning sound off also does not stop it, only logging out and back in or waiting until the song ends does.
Linked issues
duplicates
Comments
Duplicate of MC-22 , please use the search function to see if your bug has already been submitted. Currently over 35% of tickets are being closed as duplicate.
I think minecraft checks your volume only when you insert the disk and then starts a thread for playing the soundfile.