In [1]:
import pyAudioGraph as ag
In [2]:
# choose a wav file on your pc
wav_file = 'AudioFile.wav' # only signed 16/32 bit supported
In [3]:
world = ag.World(nchannels=2, buf_len=512)
# create the diskInUnit
audioStream = ag.AudioStreamWaveFile(wav_file)
diskInNode = ag.Nodes.DiskInNode(world, audioStream)
# create the output Unit
outNode = ag.Nodes.OutNode(world)
In [4]:
for i in range(diskInNode.nchannels):
diskInNode.w_out[i].plug_into(outNode.w_in[i])
In [5]:
world.append(outNode)
world.sort()
In [6]:
import time
world.start()
time.sleep(20)
world.stop()