M
M
Maxim K2020-05-13 12:09:32
C++ / C#
Maxim K, 2020-05-13 12:09:32

How to display bitrate using bass.dll?

Hello. Why does this code not want to display the normal bitrate of the stream?

public static int stream;
        public static double time;
        public static long len;
        public static int bitrate;

stream = Bass.BASS_StreamCreateURL(URL, 0, BASSFlag.BASS_DEFAULT, null, IntPtr.Zero);
            time = Bass.BASS_ChannelBytes2Seconds(stream, Bass.BASS_ChannelGetLength(.stream));
            len = Bass.BASS_StreamGetFilePosition(stream, BASSStreamFilePosition.BASS_FILEPOS_END);
            bitrate = (int)((((double)len) / (125.0 * time)) + 0.5);
            bitrateLabel.Text = bitrate.ToString();


More precisely, a set of numbers is displayed, but this is clearly not a bitrate (((, on delphi, a similar code and a mathematical form work well.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question