== Medussa Usage Examples ==

{{{
import medussa

# Try out the blocking functions. These block, so be careful with long durations!
# Read a soundfile into a numpy array
buff,fs = medussa.read_file('/path/to/shortfile.wav')
# Now play it on the default output device
medussa.play_array(buff, fs)
# Stream the same file from disk
medussa.play_file('/path/to/shortfile.wav')

# Work directly with devices and streams.
# Open default audio device
d = medussa.open_default_device()

# Create a 500-Hz tone stream
s1 = d.create_tone(500)
s1.mix_mat *= .1 # turn the volume down
s1.play()

# Pink noise in right channel
s2 = d.create_pink()
s2.mix_mat[0] = 0 # turn off left channel
s2.mix_mat[1] = .1 # turn on right channel
s2.is_playing = True # Same as s2.play()
s2.is_muted = True # mute. (Also s2.mute(True))

# Stream a flac file, show off fading:
s3 = medussa.open_file('/path/to/file.flac')
s3.mix_mat_fade_duration = 1. # Set fade to 1 sec
s3.play()
s3.mix_mat = s3.mix_mat[::-1] # Swap left and right channels

# Load a sound file into memory, then play it looped:
data,fs = medussa.read_file('/path/to/file2.wav')
s4 = d.open_array(data,fs)
s4.is_looping = True
s4.play()
}}}

