diff --git a/README.md b/README.md index 8614d7b..a43e495 100644 --- a/README.md +++ b/README.md @@ -2078,7 +2078,7 @@ Memory View ``` ```python -<list> = list(<mview>) # Returns a list of ints, floats, or bytes. +<list> = list(<mview>) # Returns a list of ints, floats or bytes. <str> = str(<mview>, 'utf-8') # Treats memoryview as a bytes object. <str> = <mview>.hex() # Returns hex pairs. Accepts `sep=<str>`. ``` @@ -2942,7 +2942,7 @@ write_to_wav_file('test.wav', samples_f) from random import uniform samples_f, params = read_wav_file('test.wav') samples_f = (f + uniform(-0.05, 0.05) for f in samples_f) -write_to_wav_file('test.wav', samples_f, params) +write_to_wav_file('test.wav', samples_f, p=params) ``` #### Plays the WAV file: diff --git a/index.html b/index.html index 3dac48a..ea6618c 100644 --- a/index.html +++ b/index.html @@ -56,7 +56,7 @@ <body> <header> - <aside>March 2, 2025</aside> + <aside>March 3, 2025</aside> <a href="https://gto76.github.io" rel="author">Jure Šorn</a> </header> @@ -1721,7 +1721,7 @@ CompletedProcess(args=[<span class="hljs-string">'bc'</span>, <span class="hljs- <array> = array(<span class="hljs-string">'<typecode>'</span>, <mview>) <span class="hljs-comment"># Treats memoryview as a sequence of numbers.</span> <file>.write(<mview>) <span class="hljs-comment"># Writes `bytes(<mview>)` to the binary file.</span> </code></pre> -<pre><code class="python language-python hljs"><list> = list(<mview>) <span class="hljs-comment"># Returns a list of ints, floats, or bytes.</span> +<pre><code class="python language-python hljs"><list> = list(<mview>) <span class="hljs-comment"># Returns a list of ints, floats or bytes.</span> <str> = str(<mview>, <span class="hljs-string">'utf-8'</span>) <span class="hljs-comment"># Treats memoryview as a bytes object.</span> <str> = <mview>.hex() <span class="hljs-comment"># Returns hex pairs. Accepts `sep=<str>`.</span> </code></pre> @@ -2409,7 +2409,7 @@ write_to_wav_file(<span class="hljs-string">'test.wav'</span>, samples_f) <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 samples_f, params = read_wav_file(<span class="hljs-string">'test.wav'</span>) 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) -write_to_wav_file(<span class="hljs-string">'test.wav'</span>, samples_f, params) +write_to_wav_file(<span class="hljs-string">'test.wav'</span>, samples_f, p=params) </code></pre></div> <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 @@ $ deactivate <span class="hljs-comment"># Deactivates the active <footer> - <aside>March 2, 2025</aside> + <aside>March 3, 2025</aside> <a href="https://gto76.github.io" rel="author">Jure Šorn</a> </footer>