Get bitdepth info from file

Is it possible to get the bitdepth info from a file?

I try to create a special field 'AUDIOINFO' where I like to put in information like '24 bit - 88 khz'.
Now I only can find bitrate and Samplefreq. info, but not that '24 bit' info.

Players like Foobar show them but I am not sure where they get the info from.

See e.g. /t/17161/1