07-18-2018, 10:41 AM
Hi
I successfully built my own network streamer, using an OLED 16x2 display to show info about artist, title track, elapsed time, etc. I show also the "audio" info, getting those info using the statements:
audio = m_status['audio'].split(':')
if len(audio) == 3:
sample = round(float(audio[0])/1000,1)
bits = audio[1]
if audio[2] == '1':
channels = 'Mono'
elif audio[2] == '2':
channels = 'Stereo'
elif int(audio[2]) > 2:
channels = 'Multi'
else:
channels = u""
if channels == u"":
tracktype = "{0} bit, {1} kHz".format(bits, sample)
else:
tracktype = "{0}, {1} bit, {2} kHz".format(channels, bits, sample)
else:
# If audio information not available just send that MPD is the source
tracktype = u"MPD"
The result on the display can be, for example, "24bits, Stereo, 192/96 kHz".
I'd like to show also the bitrate (e.g. 320 kbs), but this value is never filled up in the m_status structure (it's always = 0). I saw instead that from Moode web UI, clicking on the "Audio Info", it shows me , for example, 24 bit, 44.1 kHz, Stereo, 320 kbps. That means that in some way this info can be retrieved from MPD.
Anybody can help me how to?
thanks
Andrea
I successfully built my own network streamer, using an OLED 16x2 display to show info about artist, title track, elapsed time, etc. I show also the "audio" info, getting those info using the statements:
audio = m_status['audio'].split(':')
if len(audio) == 3:
sample = round(float(audio[0])/1000,1)
bits = audio[1]
if audio[2] == '1':
channels = 'Mono'
elif audio[2] == '2':
channels = 'Stereo'
elif int(audio[2]) > 2:
channels = 'Multi'
else:
channels = u""
if channels == u"":
tracktype = "{0} bit, {1} kHz".format(bits, sample)
else:
tracktype = "{0}, {1} bit, {2} kHz".format(channels, bits, sample)
else:
# If audio information not available just send that MPD is the source
tracktype = u"MPD"
The result on the display can be, for example, "24bits, Stereo, 192/96 kHz".
I'd like to show also the bitrate (e.g. 320 kbs), but this value is never filled up in the m_status structure (it's always = 0). I saw instead that from Moode web UI, clicking on the "Audio Info", it shows me , for example, 24 bit, 44.1 kHz, Stereo, 320 kbps. That means that in some way this info can be retrieved from MPD.
Anybody can help me how to?
thanks
Andrea