-
Good day! The new version requires updating the SDK and revising the dependencies of my entire application. That's why I don't update the version. How is this dealt with in new versions? With freezing after exiting hibernation mode with the application open. OS Windows 10 64-bit How to load the library correctly during initialization so that it doesn't freeze? Only Windows version. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
Can you verify that the current example has this behavior with the latest flutter, too? You should be able to run your code, even if you upgrade flutter. Maybe the problem was fixed in Flutter itself (?) |
Beta Was this translation helpful? Give feedback.
-
I just checked: with the Windows version of AudioPlayers 3.1.0 everything is the same: if you don’t give the library some time to recover after exiting hibernation, the application freezes (like in a white fog and the processor load increases). But only when you press the Play button. I also have functions for playing samples when you press the keys. They work immediately after exiting hibernation mode. It’s enough to wait about ten seconds, and if you don’t press Play right away, then there’s no problem at all. That is, I need to look: the initialization of what specifically does not have time to complete when exiting hibernation. It’s strange, because when you press Play, nothing actually happens other than traversing the array in a loop. Maybe this is state control: the application is in the background or active. I use a state controller on all platforms. If you run a second copy of the application on Windows, the same thing happens: samples from the keys are played on both copies that are open at the same time. And only the copy that was opened first plays from the Play button. Something happens when the cycle starts. We'll have to figure it out. I haven't tried to run your example yet. I was testing my program for now. |
Beta Was this translation helpful? Give feedback.
-
It seems that the reason really was not in the Audio Players, but in the SDK Flutter itself. I should have updated sooner. With the new SDK, even the duration of the musical measure became correct. This has something to do with the mechanism for restructuring the widget itself. Everything is fine with you! |
Beta Was this translation helpful? Give feedback.
-
No, I was wrong. This is Not SDK. The Windows version still freezes if you do not give it approximately 20 seconds to recover after Hibernate exit. You can play one note at a time. No freeze. But if you press Play and the entire array with the hash table of audio players begins to be traversed, then with a 20% probability it may freeze in a white fog. I still use a hash table of many audio players for many notes instead of an audio cache. And caching happens right during playback, and even hash table sorting happens during playback. The duration of the tact depends more on the restructuring of the widget (i use Value Listenable Builder). Therefore there is not much difference. Latency is minimal, chords sound (tonic, dominant, subdominant), your audio players work great! No clicks or extraneous sounds! Everything is fine! The result, I think, is the same. And I don’t use Dispose at all. It is unnecessary, this Dispose , and even harmful. I don’t want to check your example; everything is probably complicated there. I'm already confused in my code. All this applies only to the Windows version. I don't have a commercial project. I just do it for fun. |
Beta Was this translation helpful? Give feedback.
Plz try with the current environment (newest Flutter, Library and Example App). That ensures that we don't run after a bug, that's already fixed 😅