BrainProxy
BrainProxy

Reputation: 107

BackgroundAudioPlayer won't release music file

I am using the BackgroundAudioPlayer to play audio files stored in the isolated storage.

The user may want to delete one of these files. If the file is playing, the file is locked by the BackgroundAudioPlayer. Only after the track has finished playing can the file be deleted.

Even if I call the Stop function on the BackgroundAudioPlayer, the file is still locked.

How to get the BackgroundAudioPlayer to remove its lock?

Upvotes: 3

Views: 203

Answers (2)

Kevin Gosse
Kevin Gosse

Reputation: 39007

To release the audio file, you have to call the Close method of the BackgroundAudioPlayer.

http://msdn.microsoft.com/en-us/library/microsoft.phone.backgroundaudio.backgroundaudioplayer.close(v=vs.92).aspx

Upvotes: 1

Roman Golenok
Roman Golenok

Reputation: 1417

Try set Track property to null.

Upvotes: 1

Related Questions