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

Create the units


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)

Connect the units


In [4]:
for i in range(diskInNode.nchannels):
    diskInNode.w_out[i].plug_into(outNode.w_in[i])

Append the nodes and then sort the graph


In [5]:
world.append(outNode)
world.sort()

Run


In [6]:
import time
world.start()
time.sleep(20)
world.stop()