How to trigger the audio after the image target is detected


#1

hi, when I used to scan the image, a 3d model gets trigger at the same time my audio should get trigger too, when I disabled image target my 3d object also gets disappear and my audio should work on the same way, thank you


#2

Hi @vinod,

Target images emit seen and notseen events when the image enters and exits the camera view.

If you set up event handlers for these events in a script, you can call the start and pause functions on your audio node when the target image is seen and notseen, respectively.

Hope this helps.

All the best,
Seb


#3

thank you so much it’s working @Seb


#4

Is, there any way to delay audio for some fractions of seconds like 5 sec, thank you


#5

Hi @vinod,

You could use Z.after(…) or Timeline Labels to start a function at a specific time.

Z.after runs a function after a specified time (in msilliseconds) has passed. This may occur some number of ms beyond the specified interval due to variable frame times, so is not always accurate.

To get a more accurate time, you could use a label along a timeline.

Hope this helps.

George