peacevisual.init_peacevisual(800,600)


def callback():
	global wave
	peaceaudio.generate()
	peaceaudio.writeBuffer()
	wave = peaceaudio.getBufferl()#Capture signal from left channel
	return 1
def viewsignal_callback():
	peacevisual.drawsignal(wave)
	return 1

track = peaceaudio.createStandTrack(waveshape=peaceaudio.wavetype.noise)
mixer = peaceaudio.createMixer()
mixer.addTrack(track)
track.setvolume(0.5)
peaceaudio.setMixer(mixer)

peaceaudio.setCallback(callback)
peacevisual.setCallback(viewsignal_callback)


peacevisual.disable(gl.GL_BLEND)
peaceaudio.start()
peacevisual.start()

raw_input("Press Enter to exit")
peaceaudio.stop()

Beispiel #2
0
##\example test_visual_prism.py 
# Video
# \n
# \n@htmlonly<iframe width="640" height="360" src="http://www.youtube.com/embed/OMB93RVrFMg?feature=player_detailpage" frameborder="0" allowfullscreen></iframe>@endhtmlonly
# \n
#\n\n <small>Click on each function for more detail </small>\n
#
#

import peacevisual
import random
import gl
def callback():
	peacevisual.beginDraw(gl.GL_LINES)
	for i in xrange(200):
		peacevisual.setColor4f(random.random(),random.random(),random.random(),0.2)
		peacevisual.drawVertex2f(-0.9,0)
		peacevisual.drawVertex2f(0.9,random.uniform(-1,1))
	peacevisual.endDraw()
	return 1

peacevisual.init_peacevisual(800,600)
print peacevisual.setCallback(callback),"callback set"#Important order
peacevisual.setLineWidth(10000.0)
peacevisual.start()

Beispiel #3
0

def callback():
    global wave
    peaceaudio.generate()
    peaceaudio.writeBuffer()
    wave = peaceaudio.getBufferl()  #Capture signal from left channel
    return 1


def viewsignal_callback():
    peacevisual.drawsignal(wave)
    return 1


track = peaceaudio.createStandTrack(waveshape=peaceaudio.wavetype.noise)
mixer = peaceaudio.createMixer()
mixer.addTrack(track)
track.setvolume(0.5)
peaceaudio.setMixer(mixer)

peaceaudio.setCallback(callback)
peacevisual.setCallback(viewsignal_callback)

peacevisual.disable(gl.GL_BLEND)
peaceaudio.start()
peacevisual.start()

raw_input("Press Enter to exit")
peaceaudio.stop()
Beispiel #4
0
##\example test_visual_prism.py
# Video
# \n
# \n@htmlonly<iframe width="640" height="360" src="http://www.youtube.com/embed/OMB93RVrFMg?feature=player_detailpage" frameborder="0" allowfullscreen></iframe>@endhtmlonly
# \n
#\n\n <small>Click on each function for more detail </small>\n
#
#

import peacevisual
import random
import gl


def callback():
    peacevisual.beginDraw(gl.GL_LINES)
    for i in xrange(200):
        peacevisual.setColor4f(random.random(), random.random(),
                               random.random(), 0.2)
        peacevisual.drawVertex2f(-0.9, 0)
        peacevisual.drawVertex2f(0.9, random.uniform(-1, 1))
    peacevisual.endDraw()
    return 1


peacevisual.init_peacevisual(800, 600)
print peacevisual.setCallback(callback), "callback set"  #Important order
peacevisual.setLineWidth(10000.0)
peacevisual.start()