Mute when listen or play

I am still new to the topic of rhasspy and therefore have a few teething problems.
Rhasspy runs in a docker container and I also have mopidy running on my system.

Is there a way to mute or pause the music when rhasspy listens or says something?

Not out of the box, it depends on the music source, how do you play it etc. It is possible to write small automation to do it for you, I am currently struggling with similar topic:

I am using Rhasspy on speaker which plays Snapcast stream from Home assistant / mopidy and my automation is done using Node Red. Your setup will be very likely completely different.

Thanks for the information.
I will test it via ioBroker or NodeRed.
According to the motto “when rhasspy listens --> pause” and “when command executed --> play”

I have now implemented it as a test and proceed as follows.

MQTT Topic: hermes/asr/startListening

Whenever there is a message, the music is paused.
Then I set a state in ioBroker so I know that the music is paused.
After the execution of the intent (ioBroker also takes over) I check the above mentioned state and resume the playback.

Do you get on with it? If not I try to explain it again in more detail.