Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to play sound file in a Windows 8 Metro app using WinRT?

The WinRT API surface in Windows 8 seems to have the ability to load and save Playlists, and capture audio. What I'm looking for is somewhat simpler: does WinRT have the ability to play audio from a file? If not, what's the recommended API for native code (C++) to play audio from a file in a Windows 8 metro app?

like image 290
Zach Avatar asked Oct 10 '11 23:10

Zach


1 Answers

If you're in a WWA, you want to use the HTML tag to play audio. In xaml, you want to use a MediaElement.

If you're using low level C++, you want to use the MediaFoundation APIs.

like image 75
ReinstateMonica Larry Osterman Avatar answered Oct 22 '22 08:10

ReinstateMonica Larry Osterman