AudioContext cannot be resolved to a type

58 views
Skip to first unread message

Adam Jay

unread,
Jun 13, 2017, 8:47:36 AM6/13/17
to beadsproject
Hi,

I'm trying to follow along with the Evan X. Merz "Sound Synthesis in Java" book but I have already run into some issues.

The code I'm trying to run is:

package getting_started;
import net.beadsproject.beads.core.AudioContext;
import net.beadsproject.beads.data.Buffer;
import net.beadsproject.beads.ugens.WavePlayer;

public class Hello_Beads
{
  public static void main(String[] args)
  {
    AudioContext ac = new AudioContext();
    WavePlayer wp = new WavePlayer(ac, 440.0f, Buffer.SINE);
    ac.out.addInput(wp);
    ac.start();
  }
}

//But I get a few errors in the console..

Exception in thread "main" java.lang.Error: Unresolved compilation problems:
    AudioContext cannot be resolved to a type
    AudioContext cannot be resolved to a type
    WavePlayer cannot be resolved to a type
    WavePlayer cannot be resolved to a type
    Buffer cannot be resolved to a variable

    at getting_started.Hello_Beads.main(Hello_Beads.java:11)

I think I have installed the beads library? at least I can see the pakage components in the pakage area on the left, I think I am not importing them correctly for some reason.

I have attached 2 screenshots of eclipse.
I am new to this stuff so laymans terms would be appreciated.
Thanks.

problem code 1.png
problem code 2.png

Ollie Bown

unread,
Jun 13, 2017, 10:24:22 AM6/13/17
to beadsp...@googlegroups.com
Hi Adam,

this just means that you haven’t linked the library properly. The goal is to add the beads.jar file (not beads.zip) as a linked library in your Eclipse project. It’s been ages since I’ve done that in Eclipse, but if you search “how to link a jar library to a project” then you should find some good instructions. 

Ollie

--
You received this message because you are subscribed to the Google Groups "beadsproject" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beadsproject...@googlegroups.com.
To post to this group, send email to beadsp...@googlegroups.com.
Visit this group at https://groups.google.com/group/beadsproject.
For more options, visit https://groups.google.com/d/optout.
<problem code 1.png><problem code 2.png>

Adam Jay

unread,
Jun 13, 2017, 10:03:39 PM6/13/17
to beadsproject
Thank you so much.
Everything is working now after following your advice.

Mark Aitcheson

unread,
Mar 17, 2019, 7:23:42 PM3/17/19
to beadsproject
Hi Ollie, 

Sorry for dragging up an old issue but I'm having an identical problem to Adam's. 

I'm pretty sure I've installed the library correctly but there doesn't seem to be a "beads.jar" that you mention in your earlier reply. I downloaded the beads zip file from GitHub and I'm running the latest version of Eclipse on Win 10. 

I've attached a screenshot for reference, any help would be greatly appreciated.

Mark
Capture.PNG

Darin Hughes

unread,
Mar 20, 2019, 6:46:34 PM3/20/19
to beadsp...@googlegroups.com
Open up the zip file and you will find all the .jar files in the library folder.

Darin E. Hughes, PhD

Computer Science

Lake Highland Prep School

901 N. Highland Ave

Orlando, FL 32803


Reply all
Reply to author
Forward
0 new messages