From 986267300ba42a5c99d2802cd701803dd558e389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20M=C3=BCller?= Date: Fri, 18 Aug 2017 08:24:12 +0200 Subject: Audaspace: Moving audaspace 1.3 into extern. Deleting the old internal audaspace. Major changes from there are: - The whole library was refactored to use C++11. - Many stability and performance improvements. - Major Python API refactor: - Most requested: Play self generated sounds using numpy arrays. - For games: Sound list, random sounds and dynamic music. - Writing sounds to files. - Sequencing API. - Opening sound devices, eg. Jack. - Ability to choose different OpenAL devices in the user settings. --- .../audaspace/bindings/python/examples/siren2.py | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 extern/audaspace/bindings/python/examples/siren2.py (limited to 'extern/audaspace/bindings/python/examples/siren2.py') 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] -- cgit v1.2.3