Closed JPhilipp closed 7 months ago
The TalkingHead class has two audio sources, one for speech and one for background. The speech source is connected to a speech gain node, and background to a background gain node. Both gain nodes are then connected to a reverb node, which is connected to the destination. Gain values can be set with the setMixerGain(speech, background)
method.
The background audio can be played with playBackgroundAudio(url)
, but (as far as I know) you can simply use your own background music setup and only control the speech gain, if needed, e.g. head.setMixerGain(0.5,null)
.
Cool, thanks!
Is there maybe an "onFinishedAudio" type event one can hook into to set one's own background music volume etc.?
Sure, once you have called speakAudio
, you can add a new marker to the speech queue with speakMarker(onmarker)
. The callback function onmarker
gets called when the audio has finished playing. Alternatively, you can embed timed markers into the speakAudio
itself by using arrays markers
and mtimes
as shown in the mp3.html
example.
Thanks!
I'm exclusively using the non-TTS speakAudio with a transcript file (works great!). Is there any way to set the volume? Cheers!
On a side note, what I'd really want is for the background music to smoothly get a lowpass filter and lower its gain while the avatar speaks, in order to better hear them. The approach I used so far for that is below. It sounds epic when the audio fades back in after the speech, and I'd love to wire this up to the avatar.