Open githubjanson opened 6 months ago
It is interesting that you are seeing some latency. Out of interest how are you measuring this latency?
A couple of things that I would try:
@bijington, thanks for your tips! Changing to the Pressed event didn't help but made me realize that the latency is in the Button control and not related to the sound playback at all. When I press the button (and hold) there is a delay before the button "reacts". For the default MAUI button this is shown by the text turning grey. And at that exact moment, my sound plays.
So what I need is a button with shorter response time.
Regarding the latency, I have not measured it but rather estimated it by comparison. I am developing a rythmic exercise app, and I guess a latency around 50 ms would be acceptable, 25 ms would be great.
@githubjanson out of curiosity did you find a solution for this issue? If not, are you using compiled bindings or have you filed an issue in the MAUI repo?
Seems unlikely a problem with Plugin.Maui.Audio. Other MAUI elements don't seem to have a latency but I noticed a delay on button clicks as well. I have tried calling play from event triggers of pressed and clicked. Then from inside a custom button OnPressed.
I am also curious to know @githubjanson if you found a solution.
Hi @borrmann, @its-jefe,
I skipped the Button control and am using the SKCanvasView/Touch event instead. This gives me the best experience, i.e., a minimal latency beteen the tap and the sound.
In my mobile app, I need a short sound to play when I tap a button. And I need as good precision as possible, that is, as short latency between the tap and the sound as possible.
But the latency is approximately 150-200 ms when running the app on a (modern) iPhone, which is not good enough for my application. There are similar apps out there (non-MAUI), where this lag is significantly less, so it is not hardware related.
I assume that this lag is not related to the Maui.Audio plugin, but perhaps someone has a clue or workaround how to get around this issue? Do I need to switch to another platform?
Thanks.