You can’t mirror screen and sound together so we’ll use two different tools to do the job. This method can be done on Linux & Windows but I am using Linux (Debian) in this case.
Scrcpy - for screen mirror
sndcpy - for sound
Sndcpy: download the latest release and extract the files
Screen with Scrcpy
First, go to your device settings and enable developer mode then, connect your Android device to your computer with your charger.
Run Scrcpy on your computer terminal
you should see your phone screen on another window like this
Sound with Sndcpy
Run the linux file from the extracted files
Now you can play anything to check everything.
I use Scrcpy with some switches like:
You can see more on their Github page @ Scrcpy
& while using Sndcpy, just reduce the volume to 0% on the phone so you don’t hear “echo”
that’s it ✌🏽