I want to play an audio file with extention .wav. when I press play I dont hear the sound. How to stop the audio
Code:
using Plugin.AudioRecorder; // you have to download from nuGetPackage
using Xamarin.Essentials;
private AudioPlayer audioPlayer = new AudioPlayer();
public NewEvent()
{
InitializeComponent();
Permissions.CheckStatusAsync<Permissions.Media>();
audioPlayer.Play("alert.wav");
}
private void StopPlay_Clicked(object sender, EventArgs e)
{
audioPlayer.Stop();
}
The problem is solved. I put audio file to "Assets" folder. And changed Build Action of my audio file in properties to AndroidAsset. Now it works