Sound limitations or am I dumb?

Just a few questions here regarding sound:

  1. Sound doesn't play in html without user interaction (for obvious reasons). Is there a way to capture a click before firing up the scene?
  2. Sound doesn't bounce when outputted in the video?
  3. Sound doesn't play in the timeline in Hype Studio when I click the play button?

At first glance, it seems I'm having a hard time understanding why sound is in there at all when it seemingly doesn't work anywhere but the output video feature?

2 and 3 is yes.
1.) there has to be a 'real' userinteraction

1, I can appreciate the limitations of browser security causing 1. 2 and 3 seem like glaring omissions from the program, which is otherwise really incredible and I'm super stoked to work with. This leaves me scratching my head quite a bit.

1, without knowing what's under the hood, I guess a simple click action will bubble up to play the audio to be triggered. I'll play with that and see how to get it going. Regarding how audio is triggered, is there somewhere in the output where the time stamps might be stored, because...
2, if I write an FFMPEG export script I can conceivably solve #2 by layering audio after the fact to video.

Still impressed by this program. Wish I'd found it ages ago.

1 Like

and share this to the forum :slight_smile: :wink:

1 Like

I'm well more than happy to do that TBH. If anyone has directions of how to pull the timecode out at export, etc., it's potentially a simple thing that would streamline the whole process.

These are definitely areas where Hype can improve and we acknowledge it as a present weakness. In general it is more that audio is unfinished and there's more to do - these two items have some technical challenges in merging a web stack with a native app stack, which is why they weren't implemented when audio was first introduced into Hype.

Assume you'd want an output of the format 'timecode : audiofile', I'm not sure there would be a good way to do this and get all the info you need. Brainstorming, I would probably do something like:

  • Uncheck "Use low latency Web Audio API" in the Document Inspector so that Hype uses <audio> tags
  • See if I can wrap/override audio element's .play() prototype or whenever an audio element is created add an event listener to its play event. This is the magic part :slight_smile:.
  • On that callback, get the src attribute for the audio element and then examine the hypeDocument.currentTimeInTimelineNamed(timelineName), assuming that you get the hypeDocument (probably Object.values(HYPE.documents)[0]) and timelineName is known (probably "Main Timeline").
1 Like