如何在Xamarin.forms上播放声音? [英] How to play sounds on Xamarin.forms?

查看:910
本文介绍了如何在Xamarin.forms上播放声音?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Xamarin.forms为Android,iOS和Windows Phone创建一个应用程序.我的问题是如何使用Xamarin Forms播放mp3或wav?

I'm creating an app for Android, iOS and Windows Phone using Xamarin.forms. My question is how to play a mp3 or wav with Xamarin Forms?

我的业务逻辑是由Shared Project处理的,我不知道如何使用平台"MediaPlayer".

My business logic is handled by Shared Project and I don't know how to use platform specifically "MediaPlayer".

推荐答案

我刚刚为Xamarin创建了一个可在iOS,Android,UWP,Windows 8.1和Windows Phone 8.1上运行的AudioManager.如果您有兴趣,请访问 https://github.com/jcphlux/XamarinAudioManager 进行检查.有指向Nuget包的链接,也可以随时克隆该项目.

I just finished creating an AudioManager for Xamarin that works on iOS, Android, UWP, Windows 8.1, and Windows Phone 8.1. If you are interested check it out at https://github.com/jcphlux/XamarinAudioManager. There is a link to a Nuget package or feel free to clone the project.

这篇关于如何在Xamarin.forms上播放声音?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆