Multiple audio clips on a Timeline track

Hi, I’m currently working on a scene that uses the Timeline to scroll through it and have been trying to put multiple audio clips/sound effects into one track in the timeline to time it to my scroll animation. The audio plays in the Unity editor but when exported to the local server the audio doesn’t play. Is this possible as I’m not really sure what I’m missing for it to work? Thanks

Original Post on Discord

by user 717365753099059351

Hello there – we have an experimental AI bot :robot: that might be able to help you with your question. Would you like to try this out?

How it works:
Reply to the messages of the bot that end with a thread_id to interact with it and ask follow-up questions. You can also mention the bot directly in this channel to get help.

Help requested: please wait a moment…

Here is what I found for you :brain: Discord

Hello Jamiee, it is possible to handle multiple audio clips through the AudioTrackHandler component in the Needle Engine. This component can be used to preload the timeline audio, which suggests there might be additional steps you need to take when exporting to ensure that the audio plays correctly on your local server.

Make sure the audio files are correctly referenced and available on your local server. It can be helpful to preload the audio for your timeline using the loadAudio method to ensure smooth playback during your scroll animation.

If you’re still facing issues with audio playback after confirming all the steps above, you might want to look into how the audio is being handled in the export process—there could be a discrepancy in how the Unity editor handles audio compared to the Needle Engine runtime on a server.

Here’s a reference to the relevant section in the documentation:

export declare class AudioTrackHandler extends TrackHandler {
    // ... other properties and methods ...
    /** Call to load audio buffer for a specific time in the track. Can be used to preload the timeline audio */
    loadAudio(time: number, lookAhead?: number, lookBehind?: number): void;

(see the documentation).

If you need further guidance, the documentation could provide additional insights into handling audio in Needle Engine.

1 messages left GPT 4

Hi, this should work
Which format are your audio clips in? Have you checked that it is supported by browsers?

I’ve tried both mp3 and wav

by user 717365753099059351

when your timeline plays in the browser have you clicked the canvas at least once (or any element on the website) ?

And just to be sure: your tab is not muted as well right?

mp3 and wav should both work - altough I’d recommend to not use WAV because of the huge filesize

yep i’ve clicked the around in the browser and it’s not muted. tested on different browsers as well

by user 717365753099059351

Do you have a link to the website?

Which Needle Engine version are you using? And which Unity Editor version?

3.29.0 needle engine and 2022.3.12.f1 unity version

by user 717365753099059351

do i need an audio listener in the scene as I think I read somewhere on discord that it wasn’t needed

by user 717365753099059351

It should create one if it doesnt exist - but it cant hurt to try adding one to the camera

If you have a link to a live website I can check the logs if there’s any useful info

the sites not live yet but i’ll try and get something ready for you to look at soon

by user 717365753099059351

You can also try to append ?debugtimeline to your url and check the browser console - which browser are you testing on?

both microsoft edge and chrome

by user 717365753099059351

i’ll try that out

by user 717365753099059351