File: comb.py

package info (click to toggle)
sndobj 2.6.7%2Bds1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 4,904 kB
  • sloc: ansic: 55,663; cpp: 21,625; python: 391; makefile: 130; java: 22; sh: 21
file content (31 lines) | stat: -rw-r--r-- 677 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/python
###################################
# Stereo echo demonstrating the SndRTThread class
#
#  VL, 01/07

from sndobj import *
import time
import sys

if len(sys.argv) > 1:
    dur = sys.argv[1]
else:
    dur = 60

# SndRTThread object has its own IO objects
# by the default it is created wth 2 channels
t = SndRTThread(2)
# Echo objects take input from SndRTThread inputs
comb_left =  Comb(0.48, 0.6, t.GetInput(1))
comb_right = Comb(0.52, 0.6, t.GetInput(1))
# We add the echo objects to the output channels
t.AddOutput(1, comb_left)
t.AddOutput(2, comb_right)
t.Direct(1)
t.Direct(2)
# Processing
t.ProcOn()
time.sleep(float(dur))
t.ProcOff()
time.sleep(0.1)