script – Getting audio information using MediaInfo

So if I have a file with audio with the following properties:

Language: English

Bitrate: 1509 kb/s

Sampling Rate: 48.0 kHz

Bit Depth: 24 bits

Channels: 6

Format: DTS

I have wrote the following to extract this information:

MediaInfo "--Output=Audio;%Language/String%, $if(%BitRate%, %BitRate%/1000 kb/s), $if(%SamplingRate%, %SamplingRate% kHz), $if(%BitDepth%, %BitDepth% bits), $if(%"Channel(s)"%, %"Channel(s)"% channels), %Format%" File.mkv

This is the output I get:

English,  1509000/1000 kb/s,  48000 kHz,  24 bits, %, 6 channels), DTS

So I can see 3 main issues here. It’s showing in bits rather than kilobits. How can I get it to divide by 1000? Issue 2: Same for kHz need to divide by 1000. Third issue is after the bit depth I have a random % and ) left over which I assume is to do with the “channel(s)” thing already including brackets.

If anyone could help me solve this I would greatly appreciate it. This is my first time using a CLI tool so I am not great.