diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-02-01 14:11:04 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-02-01 14:22:57 +0300 |
commit | 781dd5edb5b74ecb417a16c28eab31483fc3d11a (patch) | |
tree | e5c142f2eef1cbcb1ed6dc243ec9707fe64f8d5f /extern/audaspace/bindings/python/examples/siren2.py | |
parent | cd317fab65e1b6c1652ba7a58786a8cc5bd11843 (diff) |
Fix audaspace mess in 2.8
All these files were removed since accidental commit, revert and merge in 2.8.
ea31f0ac3b877e + 0a4e170c28cec + 11f9a23a286c17f + 7b27b10fa6a6
Diffstat (limited to 'extern/audaspace/bindings/python/examples/siren2.py')
-rw-r--r-- | extern/audaspace/bindings/python/examples/siren2.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/extern/audaspace/bindings/python/examples/siren2.py b/extern/audaspace/bindings/python/examples/siren2.py new file mode 100644 index 00000000000..35e1a600581 --- /dev/null +++ b/extern/audaspace/bindings/python/examples/siren2.py @@ -0,0 +1,23 @@ +#!/usr/bin/python +import aud, math, time +length = 0.5 +fadelength = 0.05 +runtime = 10 +distance = 100 +velocity = 2 * distance / runtime + +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 + +handle.velocity = [velocity, 0, 0] + +start = time.time() + +while time.time() - start < runtime: + location = -distance + velocity * (time.time() - start) + + handle.location = [location, 10, 0] |