Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6924827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:42:41+00:00 2026-05-27T10:42:41+00:00

This question is a followup to a previous question , that was resolved thanks

  • 0

This question is a followup to a previous question, that was resolved thanks to @thejh.

I’m trying to convert text to audio and serve the data to the client as ‘chunked’ data.
So far my headers look like so:

res.writeHead(200, {
  'Content-Type': 'audio/wav',
   // I tried 'audio/x-wav' as well
  'Transfer-Encoding': 'chunked'
});

And then I’m converting snippets of text to audio in a queue (which I get back as base64 encoded data), and serving them like so:

var src = Base64Audio.replace("data:audio/x-wav;base64,","");
var binAudio = new Buffer( src, 'base64');
res.write(binAudio);

All the information is being transferred and sent to the client, but for some reason the browser (I’m testing it in Firefox 7.0.1) is playing it and stopping after the first chunk. Here’s the result/demo showing the premature end of the audio, and this is the code being run on github.

Why is this? Is this because the x-wav data has meta data like an End or specified length in is header/meta-data? If so what is this meta data and is there some way of editing it so that the browser successfully concatenates the received chunks?

I’m aware of the Header 'Content-Length': Buffer.length but in this instance I don’t know how long the entire stream is going to be.

Can anyone offer suggestions. Is it possible to Edit the buffers before they’re sent such that the browser concatenates them properly?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T10:42:42+00:00Added an answer on May 27, 2026 at 10:42 am

    I think your best bet is to make this resemble an audio stream, as would be sent by icecast/shoutcast. I don’t think FireFox will handle that by default (older versions do not), which is why there are so many lovely flash plugins to play streams.

    You need to set a few more headers to resemble a stream:

    HTTP/1.0 200 OK
    Content-Type: audio/wav
    Transfer-Encoding: chunked
    icy-br: ##
    ice-audio-info:bitrate=##;samplerate=#####
    icy-description:Some Name
    icy-genre:Alternative
    icy-name:Name
    icy-pub:0
    icy-url:http://yoursite.com
    Server:Whatever you want
    Cache-Control: no-cache
    Connection: Keep-Alive
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So this is a follow-up to a previous question that I asked: Trying to
THis is a followup to my previous question Font-dependent control positioning. It's an attempt
This is a followup on the question: ASP.NET next/previous buttons to display single row
This is a follow up to my previous question . Consider that I write
Note that this is a follow-up question from my previous one: How to memorize
This is somewhat of a followup to my previous question , where people pointed
Hey guys this is a followup to my previous question . I now have
This is a follow up to a previous question that I had before about
This question is a followup to my previous one: Previous Questions . So I
This question is a follow-up question to my previous one that can be found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.