Jump to content

Stats for nerds for audio


Recommended Posts

Posted

After I was trying to get some information on an audio track today, it reminded me of something that's been missing from Emby: a "stats for nerds" for audio tracks (or just some way to view the data that I could get by running ffprobe on an audio track). As of now, I don't see any way to get information regarding an audio track (bitrate, channels, etc). Is there a way to do this that I just completely skipped over?

  • Like 4
  • Agree 1
Posted

Hi, there's currently no way, but it's not a bad idea.

  • Like 1
  • 2 years later...
Posted

I kind of assume if you enable direct play on Emby for audio, then you are a nerd. In the web audio play, would love to see "FLAC" replaced with a one liner wtih more of that 'nerd stat'. Aren't we all nerds? Alright, wishful thinking. THanks.

 

image.png.84539ddb7a964f2a9b421d8a65c93268.png

image.png.7dcaebce6b52ec735af759f26164aa47.png

  • Agree 1
Posted

Hi, yes we could probably fit a little more there. Thanks for the feedback.

FrostByte
Posted (edited)

I'm sure this has been asked before, but my ninja search skills aren't working right now.

I would add bit depth 16/24 next to Hz in SFN for those with HD audio and replace the mbps which is there 3 times for some reason.

image.jpeg.90aa9d7334f752a02cf1b379c4f75879.jpeg

Edited by FrostByte
  • Like 2
  • Agree 4
  • Thanks 1
  • 3 years later...
Posted

Adding the audio basic info on the front of player will be perfect like file format, bitrate, bit depth and sample rate (eg. FLAC - 1592kbps 24bit/44.1khz). 

image.jpeg

  • Like 3
  • Thanks 2
  • 9 months later...
Posted (edited)
On 9/4/2022 at 2:25 AM, mostynL said:

In the web audio play, would love to see "FLAC" replaced with a one liner wtih more of that 'nerd stat'.

Yes, I’ve been wanting something like this for a while too. I suppose seeing just (e.g.) MP3 or FLAC is a good minimal approach for many, but all my music is FLAC. I therefore also want to see (e.g.) 16/44 or 24/96, at a glance, without having to open “Stats for Nerds” or leave that visible the whole time. Even then, this doesn’t show bit-depth in the available info.

On 10/12/2025 at 11:06 PM, Daniel_Yee said:

Adding the audio basic info on the front of player will be perfect like file format, bitrate, bit depth and sample rate (eg. FLAC - 1592kbps 24bit/44.1khz). 

I also similarly want to see more relevant info like this, but don’t need to see “everything” to be able to easily determine if the track is “standard” or “hi-res”. So, rather than just waiting for Emby to implement something, I had a friendly AI conversation and ended up with this (full screen):

image.png.28db87faa33f8670c26ead7755e0697e.png

Here’s the JavaScript code for anyone interested in experimenting with it, for the web player (at your own risk):

(function() {

    async function updateAudioInfo() {
        try {
            const sessions = await window.ApiClient.getSessions();
            const session = sessions?.find(s => s.NowPlayingItem);
            if (!session) return;

            const item = session.NowPlayingItem;
            const audio = item.MediaStreams?.find(s => s.Type === "Audio");
            if (!audio) return;

            const codec = (audio.Codec || "").toUpperCase();
            const bitDepth = audio.BitDepth || "";
            const sampleRate = audio.SampleRate ? (audio.SampleRate / 1000).toFixed(1) : "";

            const el = document.querySelector('.videoOsd-audioInfo .mediaInfoItem');
            if (el) el.textContent = `${codec}  ${bitDepth}-bit  ${sampleRate} kHz`;

        } catch (e) {
            console.error("Error:", e);
        }
    }

    const obs = new MutationObserver(updateAudioInfo);
    obs.observe(document.body, { childList: true, subtree: true });

})();

I have no idea if this is optimum code, but it seems to work ok for me. Alter this line to change the format of the displayed data:

if (el) el.textContent = `${codec}  ${bitDepth}-bit  ${sampleRate} kHz`;

To show other data will require more extensive changes, of course.

Depending upon screen size, aspect ratio, screen view, font-size, etc., some CSS finessing may also be required to adjust any misalignment due to the extra space that the additional info takes up. I found that the text-centering may not align well and the time-remaining may wrap to the next line, but it seems fine, with no tweaking, for a landscape view., on my set-up.

While this won't help for all the client apps, perhaps it's still useful to some, as an interim approach, for the web player? 

Edited by user24

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...