Skip to main content

Microsoft Silverlight

Sound gets quiet after first playRSS Feed

(0)

kaseg
kaseg

Member

Member

26 points

15 Posts

Sound gets quiet after first play

I have a canvas with a mouse click, here's the code on the back:


         MediaElement _mediaElement;
        public void Page_Loaded(object o, EventArgs e)
        {
            _mediaElement = new MediaElement();
            _mediaElement.AutoPlay = false;
            _mediaElement.Source = new Uri("Media/click.mp3", UriKind.Relative);
            _mediaElement.MediaEnded += new EventHandler(_mediaElement_MediaEnded);
            Children.Add(_mediaElement);                       
        }

        void MouseClick(object sender, MouseEventArgs me)
        {
            _mediaElement.Stop();            
            _mediaElement.Play();            
        }

 

The first time, the sound plays fine...every time thereafter, it plays really quietly. The volume property only seems to effect the first play. If you click often, you'll get a mix of loud and quiet sounds. 

seemar
seemar

Member

Member

128 points

39 Posts

Microsoft

Re: Sound gets quiet after first play

we'll take a peek, thx!

Seema Ramchandani
Silverlight
Program Manager, Microsoft
http://blogs.msdn.com/seema

y_makram
y_makram

Contributor

Contributor

6172 points

1,233 Posts

Re: Sound gets quiet after first play

I have the same issue, and I am using Silverlight 1.0, and JavaScript. I use the same technique of stopping the media element then playing it. There is no specific pattern for the sound volume, sometimes it is up, and sometimes down.

Thanks
Yasser Makram
http://www.silverlightrecipes.com
_____
Dont forget to click "Mark as Answer" on the post that helped you. If your question has not been answered, please post a followup question.

seemar
seemar

Member

Member

128 points

39 Posts

Microsoft

Re: Sound gets quiet after first play

Thank you for reporting.

 Can someone please share their application out? We would like to drill in

-Seema
(email works: seemar@microsoft) [msft]

Seema Ramchandani
Silverlight
Program Manager, Microsoft
http://blogs.msdn.com/seema
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities