locked
Axwindowsmediaplayer question RRS feed

  • Question

  • Hello! I created a radio/tv automation software that actually in the background the player is an Axwindowsmediaplayer. How can I implement in my software 2 VUMeters (2 vertical progresses bars) that indicate the audio level from Axwindowsmediaplayer for LEFT and RIGHT audio channels?
    Thank you!
    Here is a program that indicate the audio levels L/R from the audio soundcard and the master level is L+R in one vertical progres bar:





    Wednesday, December 31, 2014 12:18 PM

Answers

  • Hi,

     I am not sure if you can do this using any of the Axwindowsmediaplayer`s methods or properties but, another option you might be able to use is the Core Audio API`s. I have not played with them much because my system is to old but, you might be able to get the Audio Session and read the Left and Right volume levels separately.

     There is a C# example of making a VU meter for the master volume at the CodeProject link below. You can try converting the code from the downloadable project to VB using one of the free online C# to VB converters.

    Vista Core Audio API Master Volume Control

     You will also want to read through the msdn documents to get some knowledge of what you can do with the Core Audio API`s.

    Core Audio APIs


    If you say it can`t be done then i`ll try it

    • Marked as answer by Carl Cai Wednesday, January 7, 2015 9:41 AM
    Wednesday, December 31, 2014 12:46 PM
  • Get an IWMPSettings interface

           http://msdn.microsoft.com/en-us/library/windows/desktop/dd562464(v=vs.85).aspx

    that expose the "Volume" property

           http://msdn.microsoft.com/en-us/library/windows/desktop/dd563683(v=vs.85).aspx


    • Edited by Crazypennie Wednesday, December 31, 2014 1:10 PM
    • Marked as answer by Carl Cai Wednesday, January 7, 2015 9:41 AM
    Wednesday, December 31, 2014 1:10 PM
  • I would guess you would get the IWMPSettings::volume property and the IWMPSettings::balance property to set your vu meters volume and balance levels.

    Supposing the colors your VU meters display as the colors for Volume and Balance are semi transparent in some form then if you wanted to display audio output, like the colors below the slider in the image below or like a graphics equalizer does, you would need to get that information directly from some hardware resource along the path which AxWindowsMediaPlayer is probably sending a digital data stream to some codec which will convert that to analog for output via your sound system according to AxWindowsMediaPlayers volume and balance settings and draw the levels as they occur.

    I believe you display horizontal and not vertical progress bars.


    La vida loca


    • Edited by Mr. Monkeyboy Wednesday, December 31, 2014 4:43 PM
    • Marked as answer by Carl Cai Wednesday, January 7, 2015 9:41 AM
    Wednesday, December 31, 2014 4:40 PM

All replies

  • Hi,

     I am not sure if you can do this using any of the Axwindowsmediaplayer`s methods or properties but, another option you might be able to use is the Core Audio API`s. I have not played with them much because my system is to old but, you might be able to get the Audio Session and read the Left and Right volume levels separately.

     There is a C# example of making a VU meter for the master volume at the CodeProject link below. You can try converting the code from the downloadable project to VB using one of the free online C# to VB converters.

    Vista Core Audio API Master Volume Control

     You will also want to read through the msdn documents to get some knowledge of what you can do with the Core Audio API`s.

    Core Audio APIs


    If you say it can`t be done then i`ll try it

    • Marked as answer by Carl Cai Wednesday, January 7, 2015 9:41 AM
    Wednesday, December 31, 2014 12:46 PM
  • Get an IWMPSettings interface

           http://msdn.microsoft.com/en-us/library/windows/desktop/dd562464(v=vs.85).aspx

    that expose the "Volume" property

           http://msdn.microsoft.com/en-us/library/windows/desktop/dd563683(v=vs.85).aspx


    • Edited by Crazypennie Wednesday, December 31, 2014 1:10 PM
    • Marked as answer by Carl Cai Wednesday, January 7, 2015 9:41 AM
    Wednesday, December 31, 2014 1:10 PM
  • I would guess you would get the IWMPSettings::volume property and the IWMPSettings::balance property to set your vu meters volume and balance levels.

    Supposing the colors your VU meters display as the colors for Volume and Balance are semi transparent in some form then if you wanted to display audio output, like the colors below the slider in the image below or like a graphics equalizer does, you would need to get that information directly from some hardware resource along the path which AxWindowsMediaPlayer is probably sending a digital data stream to some codec which will convert that to analog for output via your sound system according to AxWindowsMediaPlayers volume and balance settings and draw the levels as they occur.

    I believe you display horizontal and not vertical progress bars.


    La vida loca


    • Edited by Mr. Monkeyboy Wednesday, December 31, 2014 4:43 PM
    • Marked as answer by Carl Cai Wednesday, January 7, 2015 9:41 AM
    Wednesday, December 31, 2014 4:40 PM