File tree Expand file tree Collapse file tree 4 files changed +12
-8
lines changed
Expand file tree Collapse file tree 4 files changed +12
-8
lines changed Original file line number Diff line number Diff line change 1010import analogio
1111
1212SAMPLE_RATE = 44100
13+ CHANNEL_COUNT = 2
1314BUFFER_SIZE = 2048
1415
1516# what we have plugged into the breadboard or pico_test_synth
2425audio = audiobusio .I2SOut (bit_clock = i2s_bck_pin , word_select = i2s_lck_pin , data = i2s_dat_pin )
2526
2627# add a mixer to give us a buffer
27- mixer = audiomixer .Mixer (sample_rate = SAMPLE_RATE , channel_count = 2 , buffer_size = BUFFER_SIZE )
28+ mixer = audiomixer .Mixer (sample_rate = SAMPLE_RATE , channel_count = CHANNEL_COUNT , buffer_size = BUFFER_SIZE )
2829
2930# make the actual synthesizer
30- synth = synthio .Synthesizer (sample_rate = SAMPLE_RATE , channel_count = 2 )
31+ synth = synthio .Synthesizer (sample_rate = SAMPLE_RATE , channel_count = CHANNEL_COUNT )
3132
3233# plug the mixer into the audio output
3334audio .play (mixer )
Original file line number Diff line number Diff line change 1010import analogio
1111
1212SAMPLE_RATE = 44100
13+ CHANNEL_COUNT = 2
1314BUFFER_SIZE = 2048
1415
1516# what we have plugged into the breadboard or pico_test_synth
2425audio = audiobusio .I2SOut (bit_clock = i2s_bck_pin , word_select = i2s_lck_pin , data = i2s_dat_pin )
2526
2627# add a mixer to give us a buffer
27- mixer = audiomixer .Mixer (sample_rate = SAMPLE_RATE , channel_count = 2 , buffer_size = BUFFER_SIZE )
28+ mixer = audiomixer .Mixer (sample_rate = SAMPLE_RATE , channel_count = CHANNEL_COUNT , buffer_size = BUFFER_SIZE )
2829
2930# make the actual synthesizer
30- synth = synthio .Synthesizer (sample_rate = SAMPLE_RATE , channel_count = 2 )
31+ synth = synthio .Synthesizer (sample_rate = SAMPLE_RATE , channel_count = CHANNEL_COUNT )
3132
3233# plug the mixer into the audio output
3334audio .play (mixer )
Original file line number Diff line number Diff line change 1010import analogio
1111
1212SAMPLE_RATE = 44100
13+ CHANNEL_COUNT = 2
1314BUFFER_SIZE = 2048
1415
1516# what we have plugged into the breadboard or pico_test_synth
2425audio = audiobusio .I2SOut (bit_clock = i2s_bck_pin , word_select = i2s_lck_pin , data = i2s_dat_pin )
2526
2627# add a mixer to give us a buffer
27- mixer = audiomixer .Mixer (sample_rate = SAMPLE_RATE , channel_count = 2 , buffer_size = BUFFER_SIZE )
28+ mixer = audiomixer .Mixer (sample_rate = SAMPLE_RATE , channel_count = CHANNEL_COUNT , buffer_size = BUFFER_SIZE )
2829
2930# make the actual synthesizer
30- synth = synthio .Synthesizer (sample_rate = SAMPLE_RATE , channel_count = 2 )
31+ synth = synthio .Synthesizer (sample_rate = SAMPLE_RATE , channel_count = CHANNEL_COUNT )
3132
3233# plug the mixer into the audio output
3334audio .play (mixer )
Original file line number Diff line number Diff line change 1010import analogio
1111
1212SAMPLE_RATE = 44100
13+ CHANNEL_COUNT = 2
1314BUFFER_SIZE = 2048
1415
1516# what we have plugged into the breadboard or pico_test_synth
2425audio = audiobusio .I2SOut (bit_clock = i2s_bck_pin , word_select = i2s_lck_pin , data = i2s_dat_pin )
2526
2627# add a mixer to give us a buffer
27- mixer = audiomixer .Mixer (sample_rate = SAMPLE_RATE , channel_count = 2 , buffer_size = BUFFER_SIZE )
28+ mixer = audiomixer .Mixer (sample_rate = SAMPLE_RATE , channel_count = CHANNEL_COUNT , buffer_size = BUFFER_SIZE )
2829
2930# make the actual synthesizer
30- synth = synthio .Synthesizer (sample_rate = SAMPLE_RATE , channel_count = 2 )
31+ synth = synthio .Synthesizer (sample_rate = SAMPLE_RATE , channel_count = CHANNEL_COUNT )
3132
3233# plug the mixer into the audio output
3334audio .play (mixer )
You can’t perform that action at this time.
0 commit comments