Search code examples
c#wpfwindows-store-appsmediaelementwindows-store

media element spend's time to load again


I have a BIG problem!when I play a media element in WPF using c# or windows store app using c# with looping enable it takes some time to replay after sound ended an I need to replay it fast to make helicopter's sound.how can I replay a media element faster and without having to wait to load the sound again?tnx. if(badenglish){sorry();}


Solution

  • If you dont need video perhaps you could use SoundPlayer instead as it is a lot faster when looping

    Example:

    var player = new SoundPlayer("myHelicopterSound.wav");
    player.PlayLooping();