Problem with Audio Player Extension Taifun (resolved)

The application slows down and then crashes after playing some songs followed by the extension.

If I hear a single song, everything happens well, but if I go passing the songs then the error happens, slowness and then complete locking the App.

If the sounds are small, and they pass automatically this happens too.

Does anyone know how I can solve it?
I’m using the extension because I need the duration of the aids.

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

use Logcat to find out more about the runtime error…


See this small sample application with the extension.

If I put it to play, after a few times the App starts to get slow, soon after it hangs.

See this GIF:


Notice that I put a counter to see the moment the locking begins

Thanks for the quick return.

You do not set TaifunPlayer.Source in the Completed event? So only the first file is playing… Is this correct? How did you set the TaifunPlayer.Loop property?
Probably an issue with wav files? Did you try mp3 or ogg?
also how large is that file? It seems to be a very short sound file? less than 1 sec?

I did have the intention to set the TainfunPalyer.Source, but in this case the same error persists. When I play sounds followed by changing the TainfunPalyer.Source, about the fifth time it slows down and then hangs up. The files have more than 1 second, are small. I’ve also tried using mp3 file formats, the problem persists.

I did this other test. Even being the same file, the simple fact of defining a new TainfunPalyer.Source causes this to occur.

Using the loop function it repeats itself endlessly without crashing, but I need to change the source to change the song. I think the problem lies in changing the source.

which device / Android version do you use for your tests?
did you try another device?

Please prepare an example as small as possible, which demonstrates this issue and add the project (aia file) into this thread together with exact instructions for how to elicit the error, so I can take a look


The tests were done in:
Moto G3, Android 6.0, where it crashed between the sixth and twentieth time it played the sound.
Emulator BlueStaks 3 where it caught between the twenty-thirtieth time.

Exemple aia: TaiFun_Player_Exemplo.aia (30.6 KB)

Just touch the play button and wait.

try this:

The problem lies with this exchange of TainfunPalyer.Source. With some changes and the App hangs.
Try to see the new example that I sent, my problem is not in a logic to change the TainfunPalyer.Source and yes because it hangs if I change a few times in a row.

1 Like

your sound file is only 2 seconds long
please use the Sound component for short sound snippets and the Player component or Player extension for sound files > 5 seconds…

alternatively if you want to loop only one snippet, set loop to true like this
siberteky.aia (30.9 KB)

1 Like

But I need a block that returns me the size in milliseconds of the sound that is running, this functionality I only found in its extension. Can your extension not accept small sounds? Can you tell me how I can achieve this? Anything I can do?

you always can maintain a list of the length of each sound file manually

did you test the Player component? does the same issue occur there?
it looks like the workaround I’m using is not able to work with small sound snippets…

The extension is a copy of the MIT Player component and fixes a Loop issue, which occurs for Android versions API 22 and newer using this workaround. Thank you moonzai!


I did not understand. How could I get the length of the sounds without using an extension? There are several sounds that need to get the compression in my App.

Is there no way to make the extension work with smaller sounds?

you are playing sounds uploaded into the assets of your app, so you can use any application for example on your desktop to find out its length and store the length of each file inside your app in a list

btw. you forgot to answer this quesiton

did you test the Player component? does the same issue occur there?


Wow! What a quick response.

I understood, but in my actual application the sounds are discovered by users, searched on the device.

Sorry for not responding, I just tested, the player component does not hang, I put the same block logic.


I probably will look into this one day, but it’s low priority currently…

Can I do anything?

Maybe sponsor the resolution of this problem?

Could I sponsor? I need a lot of this working, it’s a function in my App that has more than three thousand users.

I sent you an updated extension 3 days ago via PM, but unfortunately did not receive and feedback from you up to now…

Sorry for the delay, I really took some time off.

WOW !! Yes, the problem was solved, thank you !!! It’s working perfectly now.

Thank you very much!