Peace Synthesizer Framework
0.02
Cross Platform Scriptable Real-Time Visualization & Sound !!
Main Page
Related Pages
Packages
Classes
Examples
tu_005a_NES_Famicom_sound_emulation.py
Play sequence data of NES (famicom) sound emulation
Click on each functions for more detail
1
##\example tu_005a_NES_Famicom_sound_emulation.py
2
#Play sequence data of NES (famicom) sound emulation
3
#
4
#\n\n <small>Click on each functions for more detail </small>\n
5
#
6
7
import
peaceaudio
8
import
song.nes.sidepocket_test
as
demosong
9
10
buffersize = 128
11
peaceaudio.init_peaceaudio
(sample_rate = 44100, inch = 0, outch=2, framesPerBuffer = buffersize)
12
peaceaudio.openStream
()
13
14
track =
peaceaudio.createNESTrack
()
15
16
def
callback():
17
peaceaudio.generate
()
18
peaceaudio.writeBuffer
()
19
return
1
20
21
22
23
mixer =
peaceaudio.createMixer
()
24
mixer.addTrack(track)
25
26
peaceaudio.setMixer
(mixer)
27
peaceaudio.setCallback
(callback)
28
peaceaudio.start
()
29
30
peaceaudio.playNESFromString
(track,demosong.text)
31
peaceaudio.stop
()
32
print
"exit"
http://peacedeveloper.appspot.com
http://peacedev.wordpress.com