Sound component error when using silent sound

Hi, guys. I created a quiz and now I am trying to allow the users to disable the sound that by default is played when user clicks any button.

I don’t understand why I am getting this error of the screenshot. Is it a bug or I am doing something wrong?

May be this error due to global variable.

What do you mean? Should I use a local variable?
Because if I do so, the value will not be recorded after the button click event, no?

1 Like

Actually global variables is always empty. It will be set after a event so you have to make little changes. Provide me aia. if you can then i will try to change & make it work…

I really don’t get what you mean but you are welcome to try.
Thanks for the helpquizdeivyson_Screen2.ais (21,8,KB)

what is ais. file?

It is the same as the aia but with one screen only

ok. Brother 2 problems are there.
1st one is your language &
2nd one is no music available in the screen thats why you are getting error of null object…

Hi @almeidapablo
If you can not share AIA publicly then PM him or create a sample AIA that produces same error.

1 Like

I got the problem & Problem is that in his music player no music is there so that’s why he is getting error againa & again

My project is open source so there is no problem.

Oh it is because .aix files don’t go with the assets related to the screen exported. I didn’t know it until now that I made a test.

But that is not the problem here on my project. The files play just fine here. The problem is when I try to disable the sound.

My guess is that this is a bug because app inventor sound component doesn’t have these method “sound silent” and I couldn’t find anyone that used it before.

But I am sending the complete aia now. If you can test again I will be thankful. The problem is on screen2quizdeivyson.aia (2,6,MB)

Try as apk and see what happens


1 Like

I am with the app installed, Boban. Same problem. I tried on my phone with android 6.0
May be this is the problem? I am currently not able to try at more recent versions.

If someone wants to test, here it is the apk:
quizdeivyson (3).apk (8,8,MB)

When screen load click on INICIAR JOGO. Then press the button of sound at the bottom of the page and see if when click any option of the quiz it will make a sound or not. In my case if I click the button the error appears and the sound continue to play when any option of the quiz is pressed.

Why not just use the Player component, something like this:

For silent mode, see also here:

1 Like

That was my first idea, but I decided to post here because I suspected there is a bug on sound component. This was reinforced by the fact that others people had the same problem and now I am almost 100% sure about it.

I gave up to use the sound component on my app besides it being most suitable than the player component for this situation. But if it is really a bug Kodular staff must know and work to correct when possible.