##\example tu_004b_Realtime_Signal_viewer_customization.py
#Visualization the signal!!
#
#\n\n <small>Click on each functions for more detail </small>\n

import peaceaudio
import peacevisual
import gl
import random 

buffersize = 128
wave = []

peaceaudio.init_peaceaudio_easy(buffersize)
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.beginDraw(gl.GL_LINES)
	for i in xrange(buffersize):
		peacevisual.setColor4f(random.random(),random.random(),random.random(),0.2)
		peacevisual.drawVertex2f(-0.9,0)
		peacevisual.drawVertex2f(0.9,wave[i])
	peacevisual.endDraw()
	return 1
##\example tu_004a_Realtime_Signal_viewer.py
#Visualization the signal!!
#
#\n\n <small>Click on each functions for more detail </small>\n

import peaceaudio
import peacevisual
import gl

wave = []

peaceaudio.init_peaceaudio_easy(256)
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)
Ejemplo n.º 3
0
##\example tu_004a_Realtime_Signal_viewer.py
#Visualization the signal!!
#
#\n\n <small>Click on each functions for more detail </small>\n

import peaceaudio
import peacevisual
import gl

wave = []

peaceaudio.init_peaceaudio_easy(256)
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)
##\example tu_003a_Signal_viewer_basic_easy.py
#View generated signal, Easy!!
#
#\n\n <small>Click on each functions for more detail </small>\n

import peaceaudio
import peacevisual
import gl


peaceaudio.init_peaceaudio_easy(256)#Modify framesPerBuffer for different results

wave = []

def callback():
	peaceaudio.generate()
	peaceaudio.writeBuffer()
	return 1

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

peaceaudio.setCallback(callback)

peaceaudio.start()
raw_input("Press Enter to Continue")
wave = peaceaudio.getBufferl()#Capture signal from left channel
##\example tu_003a_Signal_viewer_basic_easy.py
#View generated signal, Easy!!
#
#\n\n <small>Click on each functions for more detail </small>\n

import peaceaudio
import peacevisual
import gl

peaceaudio.init_peaceaudio_easy(
    256)  #Modify framesPerBuffer for different results

wave = []


def callback():
    peaceaudio.generate()
    peaceaudio.writeBuffer()
    return 1


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

peaceaudio.setCallback(callback)

peaceaudio.start()
raw_input("Press Enter to Continue")
Ejemplo n.º 6
0
##\example tu_001a_makesound.py
#Easiest way to generate sound!!
#
#\n\n <small>Click on each function for more detail </small>\n

import peaceaudio

peaceaudio.init_peaceaudio_easy()
peaceaudio.beep()


##\example tu_004b_Realtime_Signal_viewer_customization.py
#Visualization the signal!!
#
#\n\n <small>Click on each functions for more detail </small>\n

import peaceaudio
import peacevisual
import gl
import random

buffersize = 128
wave = []

peaceaudio.init_peaceaudio_easy(buffersize)
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.beginDraw(gl.GL_LINES)
    for i in xrange(buffersize):
        peacevisual.setColor4f(random.random(), random.random(),
                               random.random(), 0.2)
        peacevisual.drawVertex2f(-0.9, 0)