Leila
Leila

Reputation: 328

How to play mp3 file in loop in WP7

I'm implementing a game for WP7, and I need that a mp3 file plays in background, while I navigate through some screens. How can I do this? Thanks in advance.

Upvotes: 0

Views: 903

Answers (2)

Roman Golenok
Roman Golenok

Reputation: 1417

Hm.. what about global MediaPLayer instance? See this link

Upvotes: 1

Santhu
Santhu

Reputation: 1525

Use background Audio agent for this purpose to play , even when user navigate between pages.

Also you can achieve the continuous playback by 2 ways 1. set the repeat option to play continuously or 2. start play back again upon receiving the stop message, this can be achieved by putting code for starting playback again in Application Background player state handler upon receiving "PlayState.Stopped" message.

Please refer this link "How to: Play Background Audio for Windows Phone" for more details.

Upvotes: 2

Related Questions