-
-
Notifications
You must be signed in to change notification settings - Fork 932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
repetitive sound not playing randomly #8
Comments
Hi, @matejthetree! Thanks for your feedback :) This is an interesting problem, probably with the audioplayers lib. What version of flame/audioplayers are you using? On version 0.5.0 of the latter, there was a big refactoring (theoretically improving performance); maybe check out versions 0.4.1 and 0.5.0 and see if the problem persists, or which one performs better? Indeed I hadn't tested firing sounds that quickly. What I suspect is happening is that the audioplayer is failing to update in 500 ms. and the second call overwrites the first. One workaround might be to create a couple of instances and alternate then (fire one every second or so). If it works, it might give us more insight on what's the problem and how to fix it. I will try to perform these tests myself soon, but right now I'm a bit overwhelmed with other activities. |
Hello,
overwhelmed here as well :)) I am not in a rush for this project as it is a personal one, so I will try to do this tests in a few day and update you. I am using latest pub version of both packages
|
I got some time, so I will try now. As I remember, your lib was creating new instance of audio player when used directly from Flame, so we can rule that one out. I will check now 0.4.1, and I will compare iOS and Android versions. |
Ok, I made a mistake :) So creating new Audioplayer each time works. Now just to sort out some performance issues. Sound playing is lagging, and I am making metronome. The first time it is played it lagging and then later now and then it lags again. I wonder why playing sounds perform so bad? It should be basic stuff to play audio :) I think we can close this issue. I report back after I profile the app to see what exactly is clogging it. |
It works, but it's not ideal; it should work with the same instance. So I'll try to take a look at this on audioplayers to see if there is a performance hit or concurrence problem of some sort. The first time it takes longer because it has to load the audio; you can pre-load the audios beforehand, as per instructed here. The others occasional lag spikes are a problem though, and it might be because of audioplayers being slow or because other stuff you might be doing in your game. I will close this and then open an issue on audiplayers to see about the performance of using audioplayers (one or many instances) too quickly. Thank you so much for your help! |
Thank you, let me know If I should help or test.
I preload the audio beforehand with flame audio library. Still get performance spike on the first one.
|
Hello,
I have been using Audio file from flame to play sounds.
Now, the issue I get is that the file sometimes get played and sometimes it doesnt.
I even tried to create one instance of AudioPlayer, to see if the issue is in multiple creation of AudioPlayer or async checking of cache. Same problem.
Every 0.5 Second I play one
.wav
file, just a FX tick. Same error with.m4a
metronome.wav.zip
And on emulator first second and fourth tick stop working and later it works with ocasional skip.
On old android phone almost every second tick doesnt work.
When audio file gets skipped, I get no message in console, and when it does play I get
D/MediaPlayer(10220): setSubtitleAnchor in MediaPlayer
Can you point me in the direction where should I be looking for?
Thank you
The text was updated successfully, but these errors were encountered: