<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>As a quick fix, would it work to use a temporary file for the
      data you want to append?  Something like this<br>
    </p>
    <p>wavwrite(wavdata_24,'temp')<br>
    </p>
    <p>f1=mopen('temp.wav'.,'rb')</p>
    <p>wavdata_bytes=mget(n_bytes,'c',f1)</p>
    <p>f2=mopen('main.wav','ab')</p>
    <p>mput(wavdata_bytes(45:n_bytes),'c',f2)<br>
    </p>
    Brgds
    <p>Jan<br>
    </p>
    <p>On 2019-12-18 5:37 AM, Federico Miyara wrote:<br>
    </p>
    <blockquote type="cite"
      cite="mid:5511a09b-6aa2-669f-bf5d-d2bee2795d0f@fceia.unr.edu.ar">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <br>
      <font face="Courier New">Stéphane,<br>
        <br>
        Sorry for having explained myself so poorly. The problem with
        the macros already available is that in order to save a wavfile
        in a single operation, I need to have the whole signal loaded in
        a variable. I'm not sure whether it is possible to handle a
        variable with about 2 gigasamples (the maximum 16 bit mono file
        that Windows allows --a total file size of 4 GB--). This would
        demand 16 GB just for a single variable.<br>
        <br>
        I'm pretty sure that problems would arise even with an audio
        variable much smaller than that.<br>
        <br>
        This is the reason why I need to be able to append new audio
        data to an existing wave file, so that much less information is
        handled </font><font face="Courier New">at a time. Of course
        this requires to edit the header to update the file size after
        the append, but this is quite easy.<br>
        <br>
        The tough part is to save three byte numbers, since the existing
        mput command supports 1, 2, 4 and 8 byte formats, but not the 3
        byte used for 24 bit audio. If there were a native macro or
        primitive capable of formatting numbers as 3 byte, it would be
        helpful. <br>
        <br>
        Thanks,<br>
        <br>
        Federico Miyara  </font><font face="Courier New"><br>
        <br>
        <br>
      </font><br>
      <div class="moz-cite-prefix">On 17/12/2019 18:37, Federico Miyara
        wrote:<br>
      </div>
      <blockquote type="cite"
        cite="mid:881003e6-26bc-ecd6-44de-88f1f53db11a@fceia.unr.edu.ar">
        <meta http-equiv="Content-Type" content="text/html;
          charset=UTF-8">
        <br>
        <font face="Courier New">Stéphane,<br>
          <br>
          wavewrite also supports 3 bytes, but as I commented, I cannot
          save, not evem generate huge files, so i must create them by
          successive appending, so i needto be able to save 3 byte
          numbers directly.<br>
          <br>
          Thanks anyway.<br>
          <br>
          Regards,<br>
          <br>
          Federico Miyara <br>
        </font><br>
        <div class="moz-cite-prefix">On 17/12/2019 17:15, Stéphane
          Mottelet wrote:<br>
        </div>
        <blockquote type="cite"
          cite="mid:EF0A02A6-D417-489B-907C-7994F6B60FDF@utc.fr">
          <meta http-equiv="content-type" content="text/html;
            charset=UTF-8">
          <div dir="ltr">Hello </div>
          <div dir="ltr"><br>
          </div>
          <div dir="ltr">I think it is supported in savewave and
            loadwave. There was a pb with savewave but fixed by </div>
          <div dir="ltr"><br>
          </div>
          <div dir="ltr"><a
              href="https://codereview.scilab.org/#/c/19947/"
              moz-do-not-send="true">https://codereview.scilab.org/#/c/19947/</a></div>
          <div dir="ltr"><br>
          </div>
          <div dir="ltr">in 6.0.2</div>
          <div dir="ltr"><br>
          </div>
          <div dir="ltr">S.</div>
          <div dir="ltr"><br>
          </div>
          <div dir="ltr">
            <blockquote type="cite">Le 17 déc. 2019 à 20:09, Federico
              Miyara <a class="moz-txt-link-rfc2396E"
                href="mailto:fmiyara@fceia.unr.edu.ar"
                moz-do-not-send="true"><fmiyara@fceia.unr.edu.ar></a>
              a écrit :<br>
              <br>
            </blockquote>
          </div>
          <blockquote type="cite">
            <div dir="ltr">
              <meta http-equiv="content-type" content="text/html;
                charset=UTF-8">
              <br>
              <font face="Courier New">Dear All,<br>
                <br>
                While it is possible to create directly a wav file of
                reasonable size from Scilab, if the size is very large,
                say, 1 Gb,</font><font face="Courier New"> we will</font><font
                face="Courier New"> most likely have memory problems.
                That's why I'm trying to program a script allowing to
                append new audio data to an existing wav file.<br>
                <br>
                It is simple to save 8 bit, 16 bit and 32 bit samples to
                a file. However, 24 bit is also a popular format and
                Scilab doesn't seem to support 3 byte integer format,
                either for variables and read/write file operations. <br>
                <br>
                Is there some way to save 3 byte integers other than
                creating a specialized routine from scratch?<br>
                <br>
                Regards,<br>
                <br>
                Federico Miyara    <br>
              </font> <span>_______________________________________________</span><br>
              <span>users mailing list</span><br>
              <span><a class="moz-txt-link-abbreviated"
                  href="mailto:users@lists.scilab.org"
                  moz-do-not-send="true">users@lists.scilab.org</a></span><br>
              <span><a class="moz-txt-link-freetext"
href="https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users"
                  moz-do-not-send="true">https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users</a></span><br>
            </div>
          </blockquote>
          <br>
          <fieldset class="mimeAttachmentHeader"></fieldset>
          <pre class="moz-quote-pre" wrap="">_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org" moz-do-not-send="true">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users" moz-do-not-send="true">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
        </blockquote>
        <br>
        <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <pre class="moz-quote-pre" wrap="">_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org" moz-do-not-send="true">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users" moz-do-not-send="true">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
      </blockquote>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
    </blockquote>
  </body>
</html>