windows phone 7 - Play sound while button is pressed -


morning all,

i'm trying play sound while button pressed. not on 'click', play sound long button pressed upon , stop sound when button released.

i mated sound button in blend don't see button option in blend allows sound play while button pressed on. see available in button options 'click'.

any ideas on how can in code or blend?

thanks much.

edit - here code im trying no luck:

<mediaelement name="mp1" source="assets/media/mysound.mp3" autoplay="false" />  private void button1_mouseleftbuttondown(object sender,system.windows.input.mousebuttoneventargs e) { mp1.play(); }  private void button1_mouseleftbuttonup(object sender,system.windows.input.mousebuttoneventargs e) {  mp1.stop(); } 

you can use keydown event, , start audio.

and stop when keyup event fired.

the events can done in blend, far know can make start in blend. , not stop. if , paste code 2 events , start music can rest you.


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

c# - Unity IoC Lifetime per HttpRequest for UserStore -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -