Sample rate is on the X-axis of an audio file. It is always int
and the value changes from 11025 to 22050 or 44100 Hz.
You are looking for the bit depth of the audio file. Older music had 8 bit. CDs have 16 bit. Floating point would be 32 bit. At first sight, it would be impossible to tell the difference between a 32 bit integer and a 32 bit float.
However, this information is given in the fmt
part, at least of a RIFF WAV file. The German Wikipedia has a list of file formats (here). 0x0003 IEEE FLOAT should be what you are looking for.
In pydub, this gives you the format info:
from pydub.utils import mediainfo_json
info = mediainfo_json('example.wav')
audio_streams = [x for x in info['streams'] if x['codec_type'] == 'audio']
print(audio_streams[0].get('sample_fmt'))
With an example file that has 32 bit floats, I get flt
as output. Your mileage may vary.