1.16.0 - VU meter code - possible error? | Page 2

Discussion in 'Archive' started by JimCatMP, July 30, 2016.

  1. hwahrmann
    • Team MediaPortal

    hwahrmann Development Group

    Joined:
    September 15, 2004
    Messages:
    4,497
    Likes Received:
    1,639
    Gender:
    Male
    Location:
    Vienna, Austria
    Ratings:
    +2,266 / 1
    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.
     
    • Thank You! Thank You! x 2
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. ajs
    • Team MediaPortal

    ajs Development Group

    Joined:
    February 29, 2008
    Messages:
    8,695
    Likes Received:
    2,684
    Gender:
    Male
    Occupation:
    IT
    Location:
    Kyiv
    Ratings:
    +4,644 / 30
    Home Country:
    Ukraine Ukraine
    Show System Specs
    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! :)
     
    • Like Like x 1
  4. ajs
    • Team MediaPortal

    ajs Development Group

    Joined:
    February 29, 2008
    Messages:
    8,695
    Likes Received:
    2,684
    Gender:
    Male
    Occupation:
    IT
    Location:
    Kyiv
    Ratings:
    +4,644 / 30
    Home Country:
    Ukraine Ukraine
    Show System Specs
    @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 (Text):
    1. 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
    2. 24-Jun-2017 14:05:21 Debug [     SpectrumHandler]: Spectrum timer done.
    3. 24-Jun-2017 14:05:21 Debug [     SpectrumHandler]: VU Meter Min L:-47.3863054484606 R:-44.4416150677965 Max L-6.02046737611064 R-6.02046737611064
    4. ...
    5. 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
    6. 24-Jun-2017 14:05:46 Debug [     SpectrumHandler]: Spectrum timer done.
    7. 24-Jun-2017 14:05:46 Debug [     SpectrumHandler]: VU Meter Min L:-67.3863054484606 R:-72.2470664221865 Max L-6.02046737611064 R-6.02046737611064
    8. ...
    9. 24-Jun-2017 14:05:47 Debug [     SpectrumHandler]: OnPlayBackStarted: MediaType: Music LastFM: False - M:\Music\MP3\ACDC\2008 - Black Ice\03 - Big Jack.mp3
    10. 24-Jun-2017 14:06:04 Debug [     SpectrumHandler]: Spectrum timer done.
    11. 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 :(
     
  5. ajs
    • Team MediaPortal

    ajs Development Group

    Joined:
    February 29, 2008
    Messages:
    8,695
    Likes Received:
    2,684
    Gender:
    Male
    Occupation:
    IT
    Location:
    Kyiv
    Ratings:
    +4,644 / 30
    Home Country:
    Ukraine Ukraine
    Show System Specs
    From @JimCatMP log file:
    Code (Text):
    1. 26-Jun-2017 10:45:57 Debug [     SpectrumHandler]: OnPlayBackStarted: MediaType: Music LastFM: False - C:\Users\pw\Music\07. Toccata in D.mp3
    2. 26-Jun-2017 10:50:35 Debug [     SpectrumHandler]: VU Meter Min L:-65.4481051882995 R:-66.7870409809118 Max L-6.26591388694379 R-6.43830452162335
    3. ...
    4. 26-Jun-2017 10:50:35 Debug [     SpectrumHandler]: OnPlayBackStarted: MediaType: Music LastFM: False - C:\Users\pw\Music\H50.mp3
    5. 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:
     
  6. hwahrmann
    • Team MediaPortal

    hwahrmann Development Group

    Joined:
    September 15, 2004
    Messages:
    4,497
    Likes Received:
    1,639
    Gender:
    Male
    Location:
    Vienna, Austria
    Ratings:
    +2,266 / 1
    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 (Text):
    1.      Stream stream = GetCurrentStream();
    2.       int level = Bass.BASS_ChannelGetLevel(stream.ID);
    3.  
    4.       int peakL = Utils.LowWord32(level); // the left level
    5.       int peakR = Utils.HighWord32(level); // the right level
    6.  
    7.       double dbLeft = Utils.LevelToDB(peakL, 32768);
    8.       double dbRight = Utils.LevelToDB(peakR, 32768);
    upload_2017-6-26_17-19-50.png
     

    Attached Files:

  7. ajs
    • Team MediaPortal

    ajs Development Group

    Joined:
    February 29, 2008
    Messages:
    8,695
    Likes Received:
    2,684
    Gender:
    Male
    Occupation:
    IT
    Location:
    Kyiv
    Ratings:
    +4,644 / 30
    Home Country:
    Ukraine Ukraine
    Show System Specs
    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.
     
  8. ajs
    • Team MediaPortal

    ajs Development Group

    Joined:
    February 29, 2008
    Messages:
    8,695
    Likes Received:
    2,684
    Gender:
    Male
    Occupation:
    IT
    Location:
    Kyiv
    Ratings:
    +4,644 / 30
    Home Country:
    Ukraine Ukraine
    Show System Specs
  9. hwahrmann
    • Team MediaPortal

    hwahrmann Development Group

    Joined:
    September 15, 2004
    Messages:
    4,497
    Likes Received:
    1,639
    Gender:
    Male
    Location:
    Vienna, Austria
    Ratings:
    +2,266 / 1
    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. :)
     
    • Thank You! Thank You! x 1
  10. ajs
    • Team MediaPortal

    ajs Development Group

    Joined:
    February 29, 2008
    Messages:
    8,695
    Likes Received:
    2,684
    Gender:
    Male
    Occupation:
    IT
    Location:
    Kyiv
    Ratings:
    +4,644 / 30
    Home Country:
    Ukraine Ukraine
    Show System Specs
    upload_2017-6-26_18-51-51.png
     
  11. ajs
    • Team MediaPortal

    ajs Development Group

    Joined:
    February 29, 2008
    Messages:
    8,695
    Likes Received:
    2,684
    Gender:
    Male
    Occupation:
    IT
    Location:
    Kyiv
    Ratings:
    +4,644 / 30
    Home Country:
    Ukraine Ukraine
    Show System Specs
    Code (Text):
    1. Подробная информация об использовании оперативной
    2. (JIT) отладки вместо данного диалогового
    3. окна содержится в конце этого сообщения.
    4.  
    5. ************** Текст исключения **************
    6. System.ArgumentOutOfRangeException: Индекс за пределами диапазона. Индекс должен быть положительным числом, а его размер не должен превышать размер коллекции.
    7. Имя параметра: index
    8.    в System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
    9.    в System.Collections.Generic.List`1.set_Item(Int32 index, T value)
    10.    в BassMixer.Main.HandleNextSong() в d:\Documents\Source\Bass\BassMixerRMS\BassMixer\Main.cs:строка 148
    11.    в BassMixer.Main.btStart_Click(Object sender, EventArgs e) в d:\Documents\Source\Bass\BassMixerRMS\BassMixer\Main.cs:строка 116
    12.    в System.Windows.Forms.Control.OnClick(EventArgs e)
    13.    в System.Windows.Forms.Button.OnClick(EventArgs e)
    14.    в System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
    15.    в System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
    16.    в System.Windows.Forms.Control.WndProc(Message& m)
    17.    в System.Windows.Forms.ButtonBase.WndProc(Message& m)
    18.    в System.Windows.Forms.Button.WndProc(Message& m)
    19.    в System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
    20.    в System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    21.    в System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!