#How to stream TTS using javascript sdk ?

1 messages · Page 1 of 1 (latest)

unborn breach
#

CC: @lusty mountain

broken prawn
#

@lusty mountain , Can you please brief me out on this query ?

broken prawn
#

@unborn breach , Can you please let me know, How can i procede with streaming ? I want on-the-fly audio playback? What approach would be followed ???

#

The docs are not much clear

#

The current way I did was receive the stream from the API and change it to mp3 using ffmepg and use res.write in next js api and then decode it on client side and play it, but the problem I am facing is the audio is breaking when being played

#

I've had issue with importing WebPlayer which got fixed, but the docs are unclear as to how to use it, They dont mention anything related to passing anybufferDuration when creating WebPlayer object, wheni follow what the docs say, it throws error that it is expecting 1 argument. Please let me know regarding this as well. I wanna use it in my project. Otherwise, I'll have to look at other alternatives.

broken prawn
#

@unique pilot Yeahh, I did the streaming thing now, It's working, but the thing is it's really complicated to get audioData from chunk, it's inside chunk, object {type:"chunk", data:audioData}, and we dont get it iside single chunk, So i had to figure out a way to create a buffer, from multiple chunks until I get stepTime which mean its end of a single audio

unborn breach
#

until I get stepTime which mean its end of a single audio
Hey @broken prawn - sorry for the delayed response here (holidays). Just wanted to clarify - every chunk will have a step time associated with it, I think what you're interested in is the done message?

broken prawn
#

Basically What I want is an easier solution to the code which I've written in Image, to get audio data from chunks... Let me know if you need explaination regarding this. @unborn breach