I am trying to get the Bitrate of an encoded audio file, but I run into a little problem with a returned data type. The code example I have been given is:
But this throws an error: “Additional information: Cast from type 'UInt32' to type 'Long' is not valid.” It would seem that the return value of getItemInfoByType is a UInt32 value. The example cast it as a long which is then cast as a string "CStr(MyRate);the documentation for getItemInfoByType says it returns a string, but regardless I can't do anything with the returned value. Can someone Please shed some light on how I would go about getting and displaying this value. Thanks in advance.
VB.NET:
Dim AC As Integer
Dim MyRate As Long
AC = Player1.currentMedia.getAttributeCountByType("Bitrate", "") - 1
MyRate = Player1.currentMedia.getItemInfoByType("Bitrate", "", AC)
bitRate.Text = "Bit rate = " & CStr(MyRate) & " bits/second"
But this throws an error: “Additional information: Cast from type 'UInt32' to type 'Long' is not valid.” It would seem that the return value of getItemInfoByType is a UInt32 value. The example cast it as a long which is then cast as a string "CStr(MyRate);the documentation for getItemInfoByType says it returns a string, but regardless I can't do anything with the returned value. Can someone Please shed some light on how I would go about getting and displaying this value. Thanks in advance.