locked
How do I Play WAV file in Silverlight? RRS feed

  • Question

  • Hi,

    I have a very urgent reuirement in my project; Playing WAV file in Silverlight application (Silverlight 4 + MVVM Framework + WCF). It's should working like a Media Player. That have a PLAY, PAUSE and STOP BUTTON as well as Seek Bar. I search and found one article Playing back Wave files in Silverlight  . I can play a wav file with WaveMediaStreamSource class. But how do I accomplish seek bar and volume control.
    I can not convert the file to MP3 or WMV. Is there any way to accomplish the requirement?
    Thanks in advance for your help.

    Wednesday, January 26, 2011 6:08 AM

Answers

All replies

  • you can change the volume by

    me.Volume=5.0;

    To change the position, get the silder value first and change the position by,

    me.Position =  new TimeSpan(0, 0, 30);

    Wednesday, January 26, 2011 10:26 AM
  • Hi

    You can use the expression encoder media player, where in you will get all features like paly, stop, asn pause butons with a seek bar.

    Add MediaPlayer.dll reference from expression encoder path.

    Wednesday, January 26, 2011 11:15 PM
  • Hi,

    Thank you for your reply.

    I'm trying to implement it through MVVM.

    Saturday, January 29, 2011 9:56 AM
  • Hi,

    I think we can design the seeking bar and the volumn control by MediaElement.

    For seeking, we can use MediaElement.CanSeek and MediaElement.Position.

    For volumn, we can use MediaElement.Volume.

    http://msdn.microsoft.com/en-us/library/system.windows.controls.mediaelement(VS.95).aspx

    Sunday, January 30, 2011 10:46 PM