Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cc4917c

Browse files
committed
Audio
1 parent 5af311b commit cc4917c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,8 +1582,7 @@ get_pause = lambda seconds: repeat(0, int(seconds * F))
15821582
get_hz = lambda note: round(16.352 * 2 ** (int(note[:2])/12))
15831583
parse_n = lambda note: (get_hz(note), 0.25 if note[2] == 'J' else 0.125)
15841584
get_note = lambda note: get_wave(*parse_n(note)) if note else get_pause(0.125)
1585-
notes_seq = f'{S1}{S1}{S2}'
1586-
samples_f = chain.from_iterable(get_note(n) for n in notes_seq.split(','))
1585+
samples_f = chain.from_iterable(get_note(n) for n in f'{S1}{S1}{S2}'.split(','))
15871586
samples_b = b''.join(struct.pack('<h', int(a * 30000)) for a in samples_f)
15881587
simpleaudio.play_buffer(samples_b, 1, 2, F)
15891588
```

0 commit comments

Comments
 (0)