<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Le 31/01/2019 à 07:27, Stéphane
      Mottelet a écrit :<br>
    </div>
    <blockquote type="cite"
      cite="mid:1B9C57B7-5F1D-4EF6-BD68-E624D2688416@utc.fr">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div>Hello Frederico,</div>
      <div><br>
      </div>
      <div>We just fixed it for Scilab 6.0.2, see </div>
      <div><br>
      </div>
      <div><a
href="https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/codereview.scilab.org/#/c/20688/"
          moz-do-not-send="true">https://codereview.scilab.org/#/c/20688/</a></div>
      <div><br>
      </div>
      <div>S.</div>
    </blockquote>
    <p>I mean, the doc says that binary mode for writing or reading is
      the default but it was not the case under Windows, where *text*
      mode was the default, and in this mode char of hex code 1A is EOF
      (in binary EOF is just a condition not a char).</p>
    <p>S.<br>
    </p>
    <blockquote type="cite"
      cite="mid:1B9C57B7-5F1D-4EF6-BD68-E624D2688416@utc.fr">
      <div><br>
        Le 31 janv. 2019 à 01:20, Federico Miyara <<a
          href="mailto:fmiyara@fceia.unr.edu.ar" moz-do-not-send="true">fmiyara@fceia.unr.edu.ar</a>>
        a écrit :<br>
        <br>
      </div>
      <blockquote type="cite">
        <div>
          <meta content="text/html; charset=UTF-8"
            http-equiv="Content-Type">
          <br>
          <font face="Courier New, Courier, monospace">Antoine,<br>
            <br>
            Thank you VERY MUCH!<br>
            <br>
            That works. Is there a fundamental reason why not specifying
            binary fails somewhere? Some sort of EOF code that may
            present itself randomly according to file content?<br>
            <br>
            Regards,<br>
            <br>
            Federico<br>
          </font><br>
          <br>
          <div class="moz-cite-prefix">On 30/01/2019 20:07, Antoine
            ELIAS wrote:<br>
          </div>
          <blockquote
            cite="mid:ecb10972-a432-a22b-5576-d7b0514cce1a@scilab-enterprises.com"
            type="cite">
            <meta http-equiv="Content-Type" content="text/html;
              charset=UTF-8">
            Hello Frederico,<br>
            <br>
            On Windows, you should open your file in binary mode, with
            "rb".<br>
            --> fd = mopen("440Hz_0.2s.wav", "rb");<br>
            --> h = mgeti(1000, "uc", fd);<br>
            --> size(h)<br>
             ans  =<br>
               1.   1000.<br>
            <br>
            --> dec2hex(h(1:5))<br>
             ans  =<br>
            !52  49  46  46  84  !<br>
            <br>
            Regards,<br>
            Antoine<br>
            <div class="moz-cite-prefix">Le 30/01/2019 à 23:02, Federico
              Miyara a écrit :<br>
            </div>
            <blockquote type="cite"
              cite="mid:5C521F0C.6090402@fceia.unr.edu.ar">
              <meta content="text/html; charset=UTF-8"
                http-equiv="Content-Type">
              <br>
              Dear all,<br>
              <br>
              I'm trying to read data from a file (in this case a wave
              file) with the following code (Scilab 6.0.1)<br>
              <pre style="font-family:Monospaced;font-style:normal;font-size:14.0;"><span style="color:rgb(0,0,0);">fid</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(50,185,185);">mopen</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(188,143,143);">g:\Mis documentos\Ondas\440Hz_0.2s.wav</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(188,143,143);">'</span><span style="color:rgb(188,143,143);">r</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(74,85,219);">)</span>
<span style="color:rgb(50,185,185);">mseek</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">0</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(0,0,0);">fid</span><span style="color:rgb(74,85,219);">)</span>
<span style="color:rgb(0,0,0);">h</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(0,0,0);">mgeti</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">1000</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(188,143,143);">uc</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(0,0,0);">fid</span><span style="color:rgb(74,85,219);">)</span></pre>
              I should get a vector with 1000 unsigned 1 byte integer
              components but I end with only 164 entries. Viewing the
              file with an hex viewer, the last correctly read data are<br>
              <br>
              34 3E 34 3E <br>
              <br>
              (decimal 52 62 52 62)<br>
              <br>
              Then the following data and further data<br>
              <br>
              1A 3D 1A 3D  ...<br>
              <br>
              are not read at all. No warning like having reached EOF.
              By the way, the repeated pairs are because it is a stereo
              file with identical left and right channels.<br>
              <br>
              The same happens changing the way the file data are to be
              decoded. Seems to get stuck when 1A or 1A 3D appears.<br>
              <br>
              Any idea of what may be going on and how to solve it?<br>
              <br>
              Federico Miyara<br>
              <div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"> <br>
                <br>
                <a href="#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"
                  width="1" height="1" moz-do-not-send="true"> </a></div>
              <br>
              <fieldset class="mimeAttachmentHeader"></fieldset>
              <pre class="moz-quote-pre" wrap="">_______________________________________________
users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
            </blockquote>
            <br>
            <br>
            <fieldset class="mimeAttachmentHeader"></fieldset>
            <br>
            <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="https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users" moz-do-not-send="true">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
          </blockquote>
          <br>
        </div>
      </blockquote>
      <blockquote type="cite">
        <div><span>_______________________________________________</span><br>
          <span>users mailing list</span><br>
          <span><a href="mailto:users@lists.scilab.org"
              moz-do-not-send="true">users@lists.scilab.org</a></span><br>
          <span><a
href="https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/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">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users">https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <p><br>
    </p>
    <pre class="moz-signature" cols="72">-- 
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
<a class="moz-txt-link-freetext" href="http://www.utc.fr/~mottelet">http://www.utc.fr/~mottelet</a></pre>
  </body>
</html>