My speakers are plugged via optical output. Each time my screen wake up from sleep, pusleaudio automatically switch to HDMI audio where nothing is plugged.
How can I prevent that ?
Let me know if this doesn't work for you and I'll delete my answer. I don't have your speaker system but this should work.
When signal is lost to during sleep, Pulse Audio is automatically configured to activate the default source (your HDMI). Upon resume the sound device is still on HDMI. To override this setting, tell Pulse Audio to never switch sound devices automatically:
#at the beginning of the line to disable automatic port switching
pulseaudio -kto reload configuration