The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Retrieve bitrate info from MPD
#1
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
Reply


Messages In This Thread
Retrieve bitrate info from MPD - by mancio61 - 07-18-2018, 10:41 AM
RE: Retrieve bitrate info from MPD - by mancio61 - 07-18-2018, 11:26 AM
RE: Retrieve bitrate info from MPD - by mancio61 - 07-25-2018, 01:49 PM

Forum Jump: