|
56 | 56 |
|
57 | 57 | <body> |
58 | 58 | <header> |
59 | | - <aside>March 2, 2025</aside> |
| 59 | + <aside>March 3, 2025</aside> |
60 | 60 | <a href="https://gto76.github.io" rel="author">Jure Šorn</a> |
61 | 61 | </header> |
62 | 62 |
|
@@ -1721,7 +1721,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment |
1721 | 1721 | <array> = array(<span class="hljs-string">'<typecode>'</span>, <mview>) <span class="hljs-comment"># Treats memoryview as a sequence of numbers.</span> |
1722 | 1722 | <file>.write(<mview>) <span class="hljs-comment"># Writes `bytes(<mview>)` to the binary file.</span> |
1723 | 1723 | </code></pre> |
1724 | | -<pre><code class="python language-python hljs"><list> = list(<mview>) <span class="hljs-comment"># Returns a list of ints, floats, or bytes.</span> |
| 1724 | +<pre><code class="python language-python hljs"><list> = list(<mview>) <span class="hljs-comment"># Returns a list of ints, floats or bytes.</span> |
1725 | 1725 | <str> = str(<mview>, <span class="hljs-string">'utf-8'</span>) <span class="hljs-comment"># Treats memoryview as a bytes object.</span> |
1726 | 1726 | <str> = <mview>.hex() <span class="hljs-comment"># Returns hex pairs. Accepts `sep=<str>`.</span> |
1727 | 1727 | </code></pre> |
@@ -2409,7 +2409,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment |
2409 | 2409 | <div><h4 id="addsnoisetothewavfile">Adds noise to the WAV file:</h4><pre><code class="python language-python hljs"><span class="hljs-keyword">from</span> random <span class="hljs-keyword">import</span> uniform |
2410 | 2410 | samples_f, params = read_wav_file(<span class="hljs-string">'test.wav'</span>) |
2411 | 2411 | samples_f = (f + uniform(<span class="hljs-number">-0.05</span>, <span class="hljs-number">0.05</span>) <span class="hljs-keyword">for</span> f <span class="hljs-keyword">in</span> samples_f) |
2412 | | -write_to_wav_file(<span class="hljs-string">'test.wav'</span>, samples_f, params) |
| 2412 | +write_to_wav_file(<span class="hljs-string">'test.wav'</span>, samples_f, p=params) |
2413 | 2413 | </code></pre></div> |
2414 | 2414 |
|
2415 | 2415 | <div><h4 id="playsthewavfile">Plays the WAV file:</h4><pre><code class="python language-python hljs"><span class="hljs-comment"># $ pip3 install simpleaudio</span> |
@@ -2942,7 +2942,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment |
2942 | 2942 |
|
2943 | 2943 |
|
2944 | 2944 | <footer> |
2945 | | - <aside>March 2, 2025</aside> |
| 2945 | + <aside>March 3, 2025</aside> |
2946 | 2946 | <a href="https://gto76.github.io" rel="author">Jure Šorn</a> |
2947 | 2947 | </footer> |
2948 | 2948 |
|
|
0 commit comments