开发者

Playing Audio in WPF with repeat on finish

开发者 https://www.devze.com 2022-12-27 03:46 出处:网络
Hi I want to create a audio player class but having some problems like when audio is finished it is not repeating. While play开发者_开发百科ing audio some UI controls are not working.If you\'re using

Hi I want to create a audio player class but having some problems like when audio is finished it is not repeating. While play开发者_开发百科ing audio some UI controls are not working.


If you're using a MediaElement to play the audio, you can handle the MediaEnded event and call the Play method in the handler

Private Sub MediaElement_MediaEnded(ByVal sender As Object, ByVal e As RoutedEventArgs)

    Dim m As MediaElement = CType(sender, MediaElement)
    m.Play()

End Sub
0

精彩评论

暂无评论...
验证码 换一张
取 消