diff options
Diffstat (limited to 'extern/audaspace/bindings/python/examples/siren.py')
-rw-r--r-- | extern/audaspace/bindings/python/examples/siren.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/extern/audaspace/bindings/python/examples/siren.py b/extern/audaspace/bindings/python/examples/siren.py new file mode 100644 index 00000000000..071279b162d --- /dev/null +++ b/extern/audaspace/bindings/python/examples/siren.py @@ -0,0 +1,19 @@ +#!/usr/bin/python +import aud, math, time +length = 0.5 +fadelength = 0.05 + +device = aud.Device() +high = aud.Sound.sine(880).limit(0, length).fadein(0, fadelength).fadeout(length - fadelength, length) +low = aud.Sound.sine(700).limit(0, length).fadein(0, fadelength).fadeout(length - fadelength, length).volume(0.6) +sound = high.join(low) +handle = device.play(sound) +handle.loop_count = -1 + +start = time.time() + +while time.time() - start < 10: + angle = time.time() - start + + handle.location = [math.sin(angle), 0, -math.cos(angle)] + |