Skip to content

Commit ae8c002

Browse files
committed
Audio
1 parent c62e8a8 commit ae8c002

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2078,7 +2078,7 @@ Memory View
20782078
```
20792079

20802080
```python
2081-
<list> = list(<mview>) # Returns a list of ints, floats, or bytes.
2081+
<list> = list(<mview>) # Returns a list of ints, floats or bytes.
20822082
<str> = str(<mview>, 'utf-8') # Treats memoryview as a bytes object.
20832083
<str> = <mview>.hex() # Returns hex pairs. Accepts `sep=<str>`.
20842084
```
@@ -2942,7 +2942,7 @@ write_to_wav_file('test.wav', samples_f)
29422942
from random import uniform
29432943
samples_f, params = read_wav_file('test.wav')
29442944
samples_f = (f + uniform(-0.05, 0.05) for f in samples_f)
2945-
write_to_wav_file('test.wav', samples_f, params)
2945+
write_to_wav_file('test.wav', samples_f, p=params)
29462946
```
29472947

29482948
#### Plays the WAV file:

index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656

5757
<body>
5858
<header>
59-
<aside>March 2, 2025</aside>
59+
<aside>March 3, 2025</aside>
6060
<a href="https://gto76.github.io" rel="author">Jure Šorn</a>
6161
</header>
6262

@@ -1721,7 +1721,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
17211721
&lt;array&gt; = array(<span class="hljs-string">'&lt;typecode&gt;'</span>, &lt;mview&gt;) <span class="hljs-comment"># Treats memoryview as a sequence of numbers.</span>
17221722
&lt;file&gt;.write(&lt;mview&gt;) <span class="hljs-comment"># Writes `bytes(&lt;mview&gt;)` to the binary file.</span>
17231723
</code></pre>
1724-
<pre><code class="python language-python hljs">&lt;list&gt; = list(&lt;mview&gt;) <span class="hljs-comment"># Returns a list of ints, floats, or bytes.</span>
1724+
<pre><code class="python language-python hljs">&lt;list&gt; = list(&lt;mview&gt;) <span class="hljs-comment"># Returns a list of ints, floats or bytes.</span>
17251725
&lt;str&gt; = str(&lt;mview&gt;, <span class="hljs-string">'utf-8'</span>) <span class="hljs-comment"># Treats memoryview as a bytes object.</span>
17261726
&lt;str&gt; = &lt;mview&gt;.hex() <span class="hljs-comment"># Returns hex pairs. Accepts `sep=&lt;str&gt;`.</span>
17271727
</code></pre>
@@ -2409,7 +2409,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
24092409
<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
24102410
samples_f, params = read_wav_file(<span class="hljs-string">'test.wav'</span>)
24112411
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)
24132413
</code></pre></div>
24142414

24152415
<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
29422942

29432943

29442944
<footer>
2945-
<aside>March 2, 2025</aside>
2945+
<aside>March 3, 2025</aside>
29462946
<a href="https://gto76.github.io" rel="author">Jure Šorn</a>
29472947
</footer>
29482948

0 commit comments

Comments
 (0)