adrianstevens / Xamarin-Plugins

Cross-platform Plugins for Xamarin, Xamarin.Forms and Windows
https://www.nuget.org/packages/Xam.Plugin.SimpleAudioPlayer/
MIT License
132 stars 53 forks source link

Android - audio playback is double speed and glitchy #88

Closed aschaefer94 closed 2 years ago

aschaefer94 commented 2 years ago

We are playing mp3 files from byte[] data, and are having some issues only with Android. We have only tested on emulators for now, so I haven't totally ruled that out of being the issue. But I wanted to see if anyone else had run accross this same thing. Here's the code (simplified).

public void LoadAudio(byte[] audio) { _audioPlayer.Load(new MemoryStream(audio)); }

public void Play() { _audioPlayer.Play(); }

On android, the initial playback of the audio is double speed, and plays with lots of clicks and pops. After the first playback, any additional playback plays at normal speed and great quality.

adrianstevens commented 2 years ago

I have a Pixel 2, Pixel 6 and a Samsung a71 and they're all working as expected

aschaefer94 commented 2 years ago

Just now I was talking to a coworker about this since getting your response, and he told me his latest research into the issue makes it seem like it is an emulator issue.