1.16.0 VU meter code - possible error? (1 Viewer)

hwahrmann

Development Group
  • Team MediaPortal
  • September 15, 2004
    4,633
    2,457
    Vienna, Austria
    Home Country
    Austria Austria
    As i said, i have no time to work on it.
    I am totally occupied by work and other private things.

    But iirc, i am using this function to show the VUMeter. and there it works correctly, so i can't see a reason why it wouldn't work with your try,
    Tough i don't now exactly what you want to achieve.
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    15,640
    10,578
    Kyiv
    Home Country
    Ukraine Ukraine
    But iirc, i am using this function to show the VUMeter. and there it works correctly, so i can't see a reason why it wouldn't work with your try,
    It seems to me that the function's work has changed. Earlier, I saw the maximum picture (VU15). Now there is no. @JimCatMP also confirms this problem.
    I decided to see how this function works. I read the documentation. And if I understood correctly (described above).
    That function can not display the full range of levels (VU10..VU15 not show).
    I just want to know if I understood correctly. Or I'm wrong.
    Thanks! :)
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    15,640
    10,578
    Kyiv
    Home Country
    Ukraine Ukraine
    @hwahrmann
    I try log min and max dB returned by MP RMS Function MediaPortal-1/BassAudioEngine.cs at master · MediaPortal/MediaPortal-1 · GitHub
    And get:
    Code:
    24-Jun-2017 14:04:25 Debug [     SpectrumHandler]: OnPlayBackStarted: MediaType: Music LastFM: False - M:\Music\MP3\ACDC\2008 - Black Ice\01 - Rock N' Roll Train.mp3
    24-Jun-2017 14:05:21 Debug [     SpectrumHandler]: Spectrum timer done.
    24-Jun-2017 14:05:21 Debug [     SpectrumHandler]: VU Meter Min L:-47.3863054484606 R:-44.4416150677965 Max L-6.02046737611064 R-6.02046737611064
    ...
    24-Jun-2017 14:05:23 Debug [     SpectrumHandler]: OnPlayBackStarted: MediaType: Music LastFM: False - M:\Music\MP3\ACDC\2008 - Black Ice\02 - Skies On Fire.mp3
    24-Jun-2017 14:05:46 Debug [     SpectrumHandler]: Spectrum timer done.
    24-Jun-2017 14:05:46 Debug [     SpectrumHandler]: VU Meter Min L:-67.3863054484606 R:-72.2470664221865 Max L-6.02046737611064 R-6.02046737611064
    ...
    24-Jun-2017 14:05:47 Debug [     SpectrumHandler]: OnPlayBackStarted: MediaType: Music LastFM: False - M:\Music\MP3\ACDC\2008 - Black Ice\03 - Big Jack.mp3
    24-Jun-2017 14:06:04 Debug [     SpectrumHandler]: Spectrum timer done.
    24-Jun-2017 14:06:04 Debug [     SpectrumHandler]: VU Meter Min L:-71.2240159732389 R:-70.3088661620254 Max L-6.02046737611064 R-6.02046737611064
    -6.02046737611064 is Max, Then in MP VuMeter images VU10..VU15 not shown :(
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    15,640
    10,578
    Kyiv
    Home Country
    Ukraine Ukraine
    From @JimCatMP log file:
    Code:
    26-Jun-2017 10:45:57 Debug [     SpectrumHandler]: OnPlayBackStarted: MediaType: Music LastFM: False - C:\Users\pw\Music\07. Toccata in D.mp3
    26-Jun-2017 10:50:35 Debug [     SpectrumHandler]: VU Meter Min L:-65.4481051882995 R:-66.7870409809118 Max L-6.26591388694379 R-6.43830452162335
    ...
    26-Jun-2017 10:50:35 Debug [     SpectrumHandler]: OnPlayBackStarted: MediaType: Music LastFM: False - C:\Users\pw\Music\H50.mp3
    26-Jun-2017 10:50:51 Debug [     SpectrumHandler]: VU Meter Min L:-74.7458411543525 R:-80.7664410676321 Max L-6.66171456673472 R-6.707496144001
    Max -6.26591388694379 ... :):whistle::coffee:
     

    hwahrmann

    Development Group
  • Team MediaPortal
  • September 15, 2004
    4,633
    2,457
    Vienna, Austria
    Home Country
    Austria Austria
    ok, have a look at the attached code.
    it is in line 206ff, where i am getting the level of the stream.

    Code:
         Stream stream = GetCurrentStream();
          int level = Bass.BASS_ChannelGetLevel(stream.ID);
    
          int peakL = Utils.LowWord32(level); // the left level
          int peakR = Utils.HighWord32(level); // the right level
    
          double dbLeft = Utils.LevelToDB(peakL, 32768);
          double dbRight = Utils.LevelToDB(peakR, 32768);

    upload_2017-6-26_17-19-50.png
     

    Attachments

    • BassMixerRMS.zip
      438.7 KB

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    15,640
    10,578
    Kyiv
    Home Country
    Ukraine Ukraine
    • double dbLeft = Utils.LevelToDB(peakL, 32768);
    • double dbRight = Utils.LevelToDB(peakR, 32768);
    In MP Code MediaPortal-1/BassAudioEngine.cs at master · MediaPortal/MediaPortal-1 · GitHub
    dbLeft = Un4seen.Bass.Utils.LevelToDB(peakL, 65535);
    dbRight = Un4seen.Bass.Utils.LevelToDB(peakR, 65535);

    On your screenshot max value -2.23 I wonder how this gets, I think different code you have in the test program and in the MP.
    Max: 32768 -> -6.020461 -> -6.020461+(6.020461*0.5) -> -3.010231
     

    hwahrmann

    Development Group
  • Team MediaPortal
  • September 15, 2004
    4,633
    2,457
    Vienna, Austria
    Home Country
    Austria Austria
    Please have a look at the code, which i sent you.
    Compile it or use the exe in the Debug folder and try on your own MP3.

    Don't reference always some examples. Have a look at the code, which i sent you and use this one please. :)
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    15,640
    10,578
    Kyiv
    Home Country
    Ukraine Ukraine
    Code:
    Подробная информация об использовании оперативной
    (JIT) отладки вместо данного диалогового
    окна содержится в конце этого сообщения.
    
    ************** Текст исключения **************
    System.ArgumentOutOfRangeException: Индекс за пределами диапазона. Индекс должен быть положительным числом, а его размер не должен превышать размер коллекции.
    Имя параметра: index
       в System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
       в System.Collections.Generic.List`1.set_Item(Int32 index, T value)
       в BassMixer.Main.HandleNextSong() в d:\Documents\Source\Bass\BassMixerRMS\BassMixer\Main.cs:строка 148
       в BassMixer.Main.btStart_Click(Object sender, EventArgs e) в d:\Documents\Source\Bass\BassMixerRMS\BassMixer\Main.cs:строка 116
       в System.Windows.Forms.Control.OnClick(EventArgs e)
       в System.Windows.Forms.Button.OnClick(EventArgs e)
       в System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       в System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       в System.Windows.Forms.Control.WndProc(Message& m)
       в System.Windows.Forms.ButtonBase.WndProc(Message& m)
       в System.Windows.Forms.Button.WndProc(Message& m)
       в System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       в System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       в System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
     

    Users who are viewing this thread

    Top Bottom