title: How to concatenate/join audio buffer arrays (text-to-speech results) into one on nodejs?
body: <p>I want to convert many texts into one audio, but I'm confused how to concatenate many audios into single audio file (You can't convert a long text into an audio due to 5k chars/request limit).</p>
  <p>My current code is below. It generates multiple audio byte arrays, but fails to merge mp3 audios because it ignores head/meta information. Is it recommended to use LINEAR16 in TTS field? I'm happy to hear any suggestion. Thank you.</p>
  <pre class="lang-js prettyprint-override"><code>  const client = new textToSpeech.TextToSpeechClient();
    const promises = ['hi','world'].map(text =&gt; {
      const requestBody = {
        audioConfig: {
          audioEncoding: 'MP3'
        },
        input: {
          text: text,
        },
        voice: {
          languageCode: 'en-US',
          ssmlGender: 'NEUTRAL'
        },
      };
      return client.synthesizeSpeech(requestBody)
    })
    const responses = await Promise.all(promises)
    console.log(responses)
    const audioContents = responses.map(res =&gt; res[0].audioContent)
    const audioContent = audioContents.join() // this line has a problem
  </code></pre>
  <p>standard output</p>
  <pre><code>[
    [
      {
        audioContent: &lt;Buffer ff f3 44 c4 00 12 a0 01 24 01 40 00 01 7c 06 43 fa 7f 80 38 46 63 fe 1f 00 33 3f c7 f0 03 03 33 1f c1 f0 0c eb fa 3f 03 20 7e 63 f3 78 03 ba 64 73 e0 ... 2638 more bytes&gt;
      },
      null,
      null
    ],
    [
      {
        audioContent: &lt;Buffer ff f3 44 c4 00 12 58 05 24 01 41 00 01 1e 02 23 9e 1f e0 1f 83 83 df ef 80 e8 ff 99 f0 0c 00 e8 7f c3 68 03 cf fd f8 8f ff 0f 3c 7f 88 f8 8c 87 e0 23 ... 2926 more bytes&gt;
      },
      null,
      null
    ]
  ]
  </code></pre>