2017-03-02 164 views
1

AndroidおよびIOSプロジェクトにビープ音を追加しようとしています。しかし私が試みることは失敗する。 私はthisと多くの他の記事を使用しましたが、成功しませんでした。Xamarin using Beep()

私はコードに置く場合:public static Void Beep()私はエラーが発生します。

System.Void cannot be used from C# -- use typeof(void) to get the void type object

そして

Page_BarcodeScanner.Beep() must declare a body because it is not marked abstract, extern or partial

私はすでにこだわっているので、私は、誰もが正しい方向に私をプッシュすることを願って2日間。

+0

https://github.com/xamarin/xamarin- forms-book-sa​​mples/tree/master/Chapter09/MonkeyTapWithSound – SushiHangover

答えて

0

Xamarinフォームを使用している場合は、DependencyServicesを使用してサウンドを再生する必要があると思います。

あなたはiOSの AvAudioPlayer

Play Audio Android

に見てみることができますアンドロイドで

私はこのPRJは、出発点として役立つことができると思うSimpleAudioForms