Start a new topic

Include Sound in Html Page or Javascript in Andorid

Include Sound in Html Page or Javascript in Andorid


good morning

You can see an example of how to insert a sound media within a point of interest? After creating the function that pre-loads the file as you can place it within a point of detail?

thanks

greetings

Please have a look at the JS API Reference.

Basically you don't have to "place it wihtin" a point of detail. It is unrelated to a particular point, like an AR.ImageResource. You can play/pause the sound at any time, e.g. when a POI is clicked or a certain event occurs.

In the simplest form a sound is played like this:

var sound = new AR.Sound("http://www.myuri.com/sound.mp3");
sound.play();

 

Thanks for the reply.

So it is not possible to associate a specific different sound  for each point of interest?

I'm interested in the reason why you want to associating a sound with a point of interest? What do you want to accomplish?

It is possible to associate a specific sound with a point of interest but it depends on what you want to do and doing the association is up to the developer.

In the API we don't directly offer the possibility to e.g. play a sound when the poi is clicked. But this can easily be done by the developer utilizing e.g. the onClick trigger and playing the sound.
Login or Signup to post a comment