Log in or register to post comments

Adding Audio to Image target

January 28, 2015 - 5:02am #1

Guys,

I need help in playing audio clip when an image target is located. How can I do this?

I tried the steps mentioned in below link but its not working for me.

https://developer.vuforia.com/forum/faq/unity-how-can-i-play-audio-when-targets-get-detected

Please help.

TIA

Guru

Adding Audio to Image target

August 29, 2018 - 10:52pm #7

I've just added "using Vuforia;" to the script.

The missing 'ITrackableEventHandler ' is found now.

However, It says " `MonoBehaviour' could not be found."

Adding Audio to Image target

December 30, 2015 - 11:34pm #6

Ok, that worked!

 

 

Adding Audio to Image target

December 30, 2015 - 11:29pm #5

Same problem here,

did you solve this by adding 'using Vuforia;' in your script?

 

Thank you in advance!

Adding Audio to Image target

March 9, 2015 - 1:14pm #4

Are you using Vuforia 4.0 ?

Just add this line at the top of the script:

using Vuforia;

 

Adding Audio to Image target

March 9, 2015 - 1:05pm #3
Good Morning, I followed step by step the following link, but I encounter an error:
 
The type or namespace'ITrackableEventHandler 'could not be found
 
if I could help, I'd be very grateful.
AttachmentSize
Image icon muestra.png43.09 KB

Adding Audio to Image target

February 1, 2015 - 8:55am #2

The steps in here should work (as we have verified them):

https://developer.vuforia.com/forum/faq/unity-how-can-i-play-audio-when-targets-get-detected

If that does not work, i.e. you don't hear the Audio, first check if the Targets are really detected by adding some Logs in the OnTrackableStateChanged method;   this will tell you if the Audio.Play is actually being called.

If it is not, then this means your targets are not detected (but that would be a different problem, for example you have not Loaded or Activated your Datasets).

On the other hand, if the Audio.Play function is called, but you don't hear the sound, then you may want to check your Volume Rolloff settings and 3D Sound Settings (in particular the Max Distance), as those should be tuned to be compatible with the expected distance between the Camera and the Target.

Last but not least, check that you have really attached an AudioSource to the Target, and that the Camera has an AudioListener component.

See more here:

 http://docs.unity3d.com/Documentation/ScriptReference/AudioSource.html)

 

Log in or register to post comments