Help with playing a sound

Hi,
I created an ‘oscillator’ using the sound library but it is not working.
Please help, thanks.

Here’s the code:

add_library('sound')

def setup():
    size(200,200)
    v_osc=SinOsc(this)
    v_osc.play(440,0.5)
    # v_osc.freq(440)
    # v_osc.amp(0.5)
1 Like

To clarify, the program runs but no sound is played.

It turns out that you have to close and reopen the sketch:
https://github.com/processing/processing-sound/issues/23

You might also need to add a:

def draw():
    pass
3 Likes