I have this problem too, on my iMac 24" with M1.
The iPhone, iPad and iMac 27" play perfectly, but the iMac with the M1 seemingly turns on playback, but no sound comes out.
The only solution was to reboot.
I discovered how to fix it - you need to switch playback to the internal speakers, stop playback and run the following commands in the terminal. (It's possible that the last two alone will work, I'll check the next time it breaks down).
sudo killall coreaudiod
sudo killall AirPlayUIAgent
sudo killall AirPlayXPCHelper
Topic:
App & System Services
SubTopic:
General
Tags: