Browse Source

Audio

pull/27/head
Jure Šorn 6 years ago
parent
commit
4c81ed7c51
1 changed files with 1 additions and 2 deletions
  1. 3
      README.md

3
README.md

@ -1981,8 +1981,7 @@ def write_to_wav_file(filename, frames_int):
#### Saves a sine wave to a WAV file: #### Saves a sine wave to a WAV file:
```python ```python
from math import pi, sin from math import pi, sin
sin_f = lambda i: sin(i * 2 * pi * 440 / 44100)
frames_f = (sin_f(i) for i in range(100000))
frames_f = (sin(i * 2 * pi * 440 / 44100) for i in range(100000))
frames_i = (int(a * 30000) for a in frames_f) frames_i = (int(a * 30000) for a in frames_f)
write_to_wav_file('test.wav', frames_i) write_to_wav_file('test.wav', frames_i)
``` ```

Loading…
Cancel
Save