-
Book Overview & Buying
-
Table Of Contents
Windows Application Development Cookbook
By :
In a similar way to the case of movies, your applications can also play audio files. Such content may be really useful, for example, in the case of long descriptions that may be cumbersome for users to read. By using audio recordings, they can easily listen to them in earphones while walking or going to work by bus. Playing audio files is very simple due to availability of the MediaElement control, as you will see in this recipe.
As an example, you will create a simple page with the Play audio button. After clicking on it, the audio recording should be started or stopped, depending on its current state.
To step through this recipe, you need only the automatically generated project.
To prepare an example that plays an audio file, perform the following steps:
Audio.mp3 file to the Assets directory.MediaElement control and the Play audio button to the page by modifying the content of the MainPage.xaml file, as follows:...