Im very new to WP development…
using following code to play an audio
<MediaElement x:Name="MediaSound" HorizontalAlignment="Left" Height="100" Margin="76,60,0,0" VerticalAlignment="Top" Width="100" Visibility="Collapsed" Source="/sounds/build.wav" />
I need to change the source of media element dynamically.. Lets assume i have 10 audio file and i want to play it one after another…
For that i want to know when the audio is stopped . Is there any listener available like in android OnCompletionListener…
I want some thing like this…
private void genarateSound(){
MediaSound.Source = new Uri(audioPath[counter], UriKind.Relative);
MediaSound.Play();
//Just to say
MediaSound.Oncomplete+ = new OnComplete(AudioPlayComplete); //listen to audio Complete *Somthing like this*
}
//Code segment to execute when audio is stopped
AudioPlayComplete
{
counter++;
genarateSound();
}
Any help is much appriciated.. TIA.
The
MediaEndedevent will fire when the media reaches the end.