Audio panning

Apr 19, 2013 at 3:04 PM
Is there any way to pan the audio at playback? (programmatically, although a control to do it would also be nice).

Also is there any option to force mono audio output? (useful for people who are deaf from say one ear)

I know these can be done from the OS volume controls, but would be nice to have
Apr 19, 2013 at 3:21 PM
I see MediaElement does have Balance property, but don't see such in SMFPlayer class

so how could I get the underlying MediaElement from SMFPlayer? (for both smooth streaming and progressive download media)
Apr 19, 2013 at 3:36 PM
Seems ActiveMediaPlugin (of IMediaPlugin type) has a Balance property
    /// <summary>
    /// Gets or sets the ratio of the volume level across stereo speakers.
    /// </summary>
    /// <remarks>
    /// The value is in the range between -1 and 1. The default value of 0 signifies an equal volume between left and right stereo speakers.
    /// A value of -1 represents 100 percent volume in the speakers on the left, and a value of 1 represents 100 percent volume in the speakers on the right. 
    /// </remarks>
    double Balance { get; set; }
but it was forgotten to expose it via SMFPlayer

ActiveMediaPlugin is internal protected so descendent player classes can't access it to set the Balance, but I found at SMFPlayer class the following:
    /// <summary>
    /// Raised immediately after the MediaPlugin has been selected and created. Used for advanced purposes only where applications need access to the underlying MediaPlugin. In most cases, you should not use this event.
    /// </summary>
    public event EventHandler<CustomEventArgs<IMediaPlugin>> MediaPluginRegistered;
so I guess I can handle this event at my SMFPlayer descendent class to keep a reference to the media plugin and from my Balance dependency property set the audio balance (panning) via that cached media plugin

The question is does it call me with a null value when the media plugin is unregistered? Or will I be holding it alive unnecesserily till another plugin is registered? (unless there is no concept of media plugin unregistration at all so all is fine then)

Apr 19, 2013 at 3:39 PM