Skip to content

Commit

Permalink
Update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ideoforms committed Nov 7, 2024
1 parent 7d17ab1 commit 1edeb89
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 6 additions & 1 deletion examples/audio-through-example.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@


def main():
print("Audio playthrough: Plays the microphone input through the default output")
print("Listen through headphones to avoid feedback")

graph = AudioGraph()

#--------------------------------------------------------------------------------
Expand All @@ -18,12 +21,14 @@ def main():
# [audio]
# input_device_name = "My Device"
#--------------------------------------------------------------------------------
audio_in = AudioIn(1)
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)
Expand Down
7 changes: 4 additions & 3 deletions examples/granulation-example.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ def main():
#------------------------------------------------------------------------
# Load an audio buffer.
#------------------------------------------------------------------------
audio_path = os.path.join(os.path.dirname(__file__), "audio", "gliss.aif")
audio_path = os.path.join(os.path.dirname(__file__), "audio", "stereo-count.wav")
buf = Buffer(audio_path)
clock = RandomImpulse(50)
grain_frequency = WhiteNoise(frequency=2, min=1, max=50)
clock = RandomImpulse(grain_frequency)
granulator = Granulator(buffer=buf,
clock=clock,
pan=RandomUniform(-1, 1, clock=clock),
Expand All @@ -35,4 +36,4 @@ def main():
graph.wait()

if __name__ == "__main__":
main()
main()

0 comments on commit 1edeb89

Please sign in to comment.