PlaySound with applets on GeogebraTube

zerbinetta shared this question 4 months ago
Answered

Hello,

I know that the PlaySound-Command isn't working on Geogebra Tube - or at least I read it in some threads that are now about five years old. Is there any chance that this might change in the (near) future? At least playing midi-sound would be a very nice feature.

I created an applet to train the ability to recognize music intervals:

https://www.geogebra.org/m/sk45tcp9

But without the sound it is rather useless.

I would be happy to hear (positive) comments on that.

Thanks a lot!

Doro

Comments (13)

photo
1

midi is java based, which was typical for GG5 and one has discarded java because of the evolution of browsers en the choice for html5 universally. That makes that midi-features and codes still (but only) work offline in GG5. You can regret this and I do with you, but nobody can neglect the banning of java by browsers and the shift for htm5 either.

photo
1

Hi, example of using PlaySound in html5:https://www.geogebra.org/m/Z3ZMP9Qw

photo
1

Indeed you can use it in html5, but not with the possibilities of midi to use instruments etc. You can find the syntaxes ant midi remarks in the wiki https://wiki.geogebra.org/e...

photo
1

Thank you for your answers and your support.

I don't know much about programming and web-standards but I read something about web-midi as an alternative to the old midi standard. Is this something that could apply to GeogebraTube in the near future?

Doro

photo
1

Sorry, no. The browsers won't support it

photo
photo
1

Hi,

I'm sorry to come up with this again, but PlaySound is still keeping me puzzled.

I have two questions:

First: I am trying to link to mp3-files that I uploaded to GeogebraTube as described here: https://wiki.geogebra.org/e...

The first example I got working in this file: https://www.geogebra.org/cl... (It is the button "Welcome to Geogebra."


The second example is not working (It is the button "Welcome to Geogebra (2)". ) Therefore also the buttons "Spiel MP3" and "Spiele MP3 (2.Versuch)" are not doing what they are supposed to do.

Am I getting anything wrong with the syntax?


Second problem: I used the PlaySound-command for this applet: https://www.geogebra.org/m/agvmg24s


When I start the applet and hit one of the many buttons I get an error displayed like "Error in script at line 2 from object a0. UnknownCommand: Playsound."

Then: if I stay in the same browser-tab, open the activity that I mentioned above (https://www.geogebra.org/cl...), play the first button (which gives me a sinus-tone), then go back to the interval-activity, then the buttons work correctly.

I was able to reproduce this bug (?) with different browsers (Firefox, Chrome, Edge) and also on my android phone (using firefox there as well).

Do you have any idea, what the problem could be?


Thank you in advance!

Doro

photo
1

Ok, I found the answer to the first question myself:

This thread gave me the final hint: https://help.geogebra.org/t...- and the link to this activity: https://www.geogebra.org/m/ZzsuMJnd .

It is a little bit annoying to look for the proper URL of the uploaded mp3. But once I've found it I only had to insert it in the PlaySound-command as described in the tutorial.


But I am still wondering about the second problem, so I would be happy to get advice on that.


Doro

photo
1

do you mean that https://www.geogebra.org/m/agvmg24s

does not work but https://www.geogebra.org/cl...

works being both agvmg24s material?

I supossed both was opened with classic version

I do not understand

photo
1

Hi mathmagic,

I mean this problem:

/hefaUI5Ffpt+wAAAABJRU5ErkJggg==

If I open it with the classic version I don't get the error.

photo
photo
1

You can play MIDI files using MIDI.js. Here's an example:


https://www.geogebra.org/m/uc4nxjzq

photo
1

Thanks a lot. I was hoping to get around JavaScript, because I am not good at scripting. But I will try to figure it out over Christmas. There isn't much else I can do in these days anyways...

Bye

Doro

photo
photo
1

Vaya, ahora que había encontrado el error

espero que se me entienda

abre https://www.geogebra.org/cl... (se abrirá con classic )

abre settings --->script--->onclick de una de las teclas de piano entonces clic sobre Playsound(). él cambia a PlaySound(). entonces presiona tabulador clic sobre Playsound() y así para todas. el problema es S . guarda y arreglado

you had the answer in title of your first post

photo
1

Muchas grazias!

I simply didn't know that the commands for GeoGebra-script are case sensitive!. That really solved my problem - thank's a lot for the advice!

Have a merry Christmas!

Doro

photo
© 2021 International GeoGebra Institute