blob: 4f14c4c7e0bfc57d971a19da051b3589c2a7efb6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#Copyright (c) 2010-11, Tony Forster
# This procedure is invoked when the user-definable block on the
# "extras" palette is selected.
# Usage: Import this code into a Python (user-definable) block and
# pass a frequency in Hertz to the Python block. A tone will play over
# the speaker at the specified frequency.
def myblock(tw, frequency):
''' Plays a sound at frequency frequency '''
import os
os.system('speaker-test -t sine -l 1 -f %d' % (int(frequency)))
|