We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 61b142b commit 27ea919Copy full SHA for 27ea919
README.md
@@ -1533,13 +1533,13 @@ Audio
1533
#### Saves a list of floats with values between 0 and 1 to a WAV file:
1534
```python
1535
import wave, struct
1536
-frames = [struct.pack('h', int((a-0.5)*60000)) for a in <list>]
1537
-wf = wave.open(<filename>, 'wb')
1538
-wf.setnchannels(1)
1539
-wf.setsampwidth(4)
1540
-wf.setframerate(44100)
1541
-wf.writeframes(b''.join(frames))
1542
-wf.close()
+samples = [struct.pack('h', int((a-0.5)*60000)) for a in <list>]
+wav = wave.open(<filename>, 'wb')
+wav.setnchannels(1)
+wav.setsampwidth(4)
+wav.setframerate(44100)
+wav.writeframes(b''.join(samples))
+wav.close()
1543
```
1544
1545
0 commit comments