Playing a sound

0
Hello good people of the forum.   I'm working on something for myself and I want to integrate some sounds into my app. I can't seem to find much information about it and I was hoping someone could help point me in the right direction to figure it out. For now I would just like to integrate one sound but later I would like quite a large database of sounds.   Thanks in advance for the help!
asked
2 answers
0

Hi Alexander,

 

You can use the solutions given in the Forum post mentioned by Armand. An alternative is with some JavaScript and a Nanoflow. Your sounds can then be stored as (specializations of) FileDocuments in your database. The Nanoflow would look like this:

You need to point to the url where the file can be found. The JavaScript looks like this:

// BEGIN USER CODE
	var audio = new Audio(applicationURL + '/file?target=window&guid=' + entityGUID);
	audio.play();
// END USER CODE

My example worked in Mx8, I'm not sure if Mx9 still has this absolute path to filedocuments based on GUID. If not, you could also create your own urls using deeplink for example. 

 

Documentation about the Audio object can be found here. Hope this helps!

answered
0

Hi Alexander!

In https://marketplace.mendix.com/ there are extra plugins for your Mendix projects maybe you can find anything you are looking for in there. https://forum.mendix.com/link/questions/91358 gives a good example of using a html snippet to play music.

Good luck!

answered