I guess the code above one is backend and lower one is front-end. Are you able to get the response in the streaming from the openai? Bcz in python function call look like this:
def aduioTextStream(text):
with client.audio.speech.with_streaming_response.create(
model="tts-1", voice="alloy", input=text, response_format="pcm"
) as response:
for chunk in response.iter_bytes(chunk_size=1024):
yield chunk
And yes I am facing the same issue in front-end side. the chunks are streaming to front-end but when make it audible and decoding it the content-type show the "octet-stream". I am backend dev. and i don't have enough knowledge in the front-end. Let me know it you know the answer how i can handle it.