O'Reilly logo

Windows® Phone 8 Unleashed by Daniel Vaughan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using a MediaStreamSource to Play Back an Assembly Resource

The built-in streaming and decoding system on the phone only supports playback of local audio files when they are located in isolated storage. This section looks at enabling the direct playback of audio files located within an app assembly.

The code for this section resides in the AssemblyAudioStreamingAgent class of the WPUnleashed.BackgroundAudio project in the downloadable sample code. AssemblyAudioStreamingAgent is a subclass of AudioStreamingAgent and overrides the base type’s OnBeginStreaming method (see Listing 34.2). The custom IsolatedStorageUtility is used to retrieve the byte stream for an audio file, whose location is specified by the AudioTrack.Tag property. An Mp3MediaStreamSource ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required