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:
Diffstat (limited to 'extern/audaspace/bindings/python/examples/binaural.py')
-rw-r--r--extern/audaspace/bindings/python/examples/binaural.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/extern/audaspace/bindings/python/examples/binaural.py b/extern/audaspace/bindings/python/examples/binaural.py
new file mode 100644
index 00000000000..e7a2f6cf6d9
--- /dev/null
+++ b/extern/audaspace/bindings/python/examples/binaural.py
@@ -0,0 +1,13 @@
+#!/usr/bin/python
+import aud, sys, time, multiprocessing
+device = aud.Device()
+hrtf = aud.HRTF().loadLeftHrtfSet(".wav", sys.argv[2])
+threadPool = aud.ThreadPool(multiprocessing.cpu_count())
+source = aud.Source(0, 0, 0)
+sound = aud.Sound.file(sys.argv[1]).rechannel(1).binaural(hrtf, source, threadPool)
+handle = device.play(sound)
+
+while handle.status:
+ source.azimuth += 1
+ print("Azimuth: " + str(source.azimuth))
+ time.sleep(0.1) \ No newline at end of file