-
Notifications
You must be signed in to change notification settings - Fork 16
/
audio-through-example.py
executable file
·39 lines (29 loc) · 1.25 KB
/
audio-through-example.py
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
32
33
34
35
36
37
38
39
#!/usr/bin/env python3
# --------------------------------------------------------------------------------
# Example: Audio playthrough, from input to output.
# (Listen through headphones to avoid feedback)
# --------------------------------------------------------------------------------
from signalflow import *
def main():
print("Audio playthrough: Plays the microphone input through the default output")
print("Listen through headphones to avoid feedback")
graph = AudioGraph()
#--------------------------------------------------------------------------------
# Read mono audio input.
# To specify the audio device to use, add to ~/.signalflow/config:
#
# [audio]
# input_device_name = "My Device"
#--------------------------------------------------------------------------------
audio_in = AudioIn()
audio_in = audio_in[0]
#--------------------------------------------------------------------------------
# Add some delay, and play
#--------------------------------------------------------------------------------
output = audio_in
output = output + CombDelay(output, 0.1, feedback=0.8)
stereo = StereoPanner(output)
graph.play(stereo)
graph.wait()
if __name__ == "__main__":
main()