[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [31060] branches/soc-2010-nexyon/intern/ audaspace/Python/doc/examples/aud.Device.lock.py: Audaspace: Added an example.
Joerg Mueller
nexyon at gmail.com
Thu Aug 5 10:21:58 CEST 2010
Revision: 31060
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31060
Author: nexyon
Date: 2010-08-05 10:21:58 +0200 (Thu, 05 Aug 2010)
Log Message:
-----------
Audaspace: Added an example.
Added Paths:
-----------
branches/soc-2010-nexyon/intern/audaspace/Python/doc/examples/aud.Device.lock.py
Copied: branches/soc-2010-nexyon/intern/audaspace/Python/doc/examples/aud.Device.lock.py (from rev 31028, branches/soc-2010-nexyon/intern/audaspace/Python/doc/examples/aud.Factory.filter.py)
===================================================================
--- branches/soc-2010-nexyon/intern/audaspace/Python/doc/examples/aud.Device.lock.py (rev 0)
+++ branches/soc-2010-nexyon/intern/audaspace/Python/doc/examples/aud.Device.lock.py 2010-08-05 08:21:58 UTC (rev 31060)
@@ -0,0 +1,20 @@
+import aud
+import time
+
+def crossfade(device, handle, source, target, time, loop = -1):
+ device.lock()
+ position = handle.position
+ handle.stop()
+ device.play(source.limit(position, position+time).fadeout(0, time))
+ handle = device.play(target.loop(loop).fadein(0, time))
+ device.unlock()
+ return handle
+
+source = aud.Factory.sine(440)
+target = aud.Factory.sine(390)
+
+d = aud.device()
+
+h = d.play(source)
+time.sleep(5)
+h = crossfade(d, h, source, target, 5)
\ No newline at end of file
More information about the Bf-blender-cvs
mailing list