Viacheslav Smityukh
Viacheslav Smityukh

Reputation: 5843

How to repeat a single sound without pause by the background audio player?

I need background player to play a single track in a cycle without a pause between end and beginning. How could I implement it?

I have tried to implement it by AudioPlayerAgent but it is not able to remove pause which is short but stay here.

Upvotes: 6

Views: 803

Answers (2)

MarcD
MarcD

Reputation: 312

Maybe you should look at the BackgroudAudioPlayer.

More informations and some examples are available right here =>

http://msdn.microsoft.com/en-us/windowsphonetrainingcourse_musicplayerlab_topic2.aspx

Maybe you could use the event PlayStateChanged to launch again the same music.

Hope it helps :)

Upvotes: 3

Berni
Berni

Reputation: 510

What about using XNA Library?

Song song = Content.Load<Song>("BackgroundMusic");
MediaPlayer.Play(song);
MediaPlayer.Volume = 0.5f;
MediaPlayer.IsRepeating = true;

I am not sure it works as you want though.

Upvotes: 0

Related Questions