Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2017-10-09 12:49:27 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-10-09 12:49:27 +0300
commita5b4b0f21c1ae8c96e4fea9abdcfac2fab1cf300 (patch)
tree0658d8bdfb8ec03652aa04f82ee8a4d243ec6370 /extern/audaspace/bindings/python/examples/siren2.py
parentd68f698cf0321477c0734474150eb4bc43c4e85f (diff)
parentabcda06934aba054de8540b66b13c2bbc5f8f515 (diff)
Merge branch '28' into custom-manipulatorscustom-manipulators
Diffstat (limited to 'extern/audaspace/bindings/python/examples/siren2.py')
-rw-r--r--extern/audaspace/bindings/python/examples/siren2.py23
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]