Sphinx-4 Setup on NetBeans |
Sphinx-4 has been built and tested on the SolarisTM Operating Environment, Mac OS X, Linux and Win32 operating systems. Running, building, testing, and debugging Sphinx-4 using NetBeans requires additional software. Before you start, you will need the following software available on your machine.
The software required for building Sphinx-4 using NetBeans are listed in the Required Software section. The following sections document one way and perhaps, the simplest way, of setting up Sphinx-4 in NetBeans. However, there are other possible ways to set up Sphinx-4 in NetBeans as well that are not covered in the following sections.
Start NetBeans
Start NetBeans by either double-clicking on the NetBeans icon or through a command line.
Getting Sphinx-4
You can get Sphinx-4 as a release package, a nightly build, or directly from the Subversion (SVN) repository. The CVS repository, even though still active, is kept mainly for regression test purposes. We recommend getting Sphinx-4 directly from the Subversion (SVN) repository.
NetBeans has built-in support for SVN. But since it still requires an SVN client installed, we will not get into details on how to use SVN from inside NetBeans. For more information about SVN support in NetBeans, please visit the NetBeans Subversion integration page. For more details about SVN, please visit the Subversion web site. For details specific to SourceForge.net, please check their SourceForge.net: Subversion page. For instructions specifically about how to download Sphinx-4, check the Sphinx-4 user guide.
This set of instructions assumes that you already downloaded the Sphinx-4 code to a location of your choice. For future reference, we will refer to this location as $SPHINX4_ROOT.
Creating Sphinx-4 as a project
New Project... from the File menu. This will pop a New Project window.
General in Categories and after choose a Java Project with Existing Ant Script.
Next button. This will pop a New Java Project with Existing Ant Script window.
Location browse to the workspace folder previously specified. If you browsed to the correct folder, all remained blank form will be filled automatically.
Set as Main Project. Click on Next button. This will show Build and Run Actions tab.
Next button. This will show Source Package Folders tab.
Add Folder... button for Source Package Folders and select lib folder. Add com and edu folder following same operations, then press OK.
Add Folder... button for Test Package Folders and select tests folder. Add demo folder following same operations, then press OK.
JDK 5 in the Source level field. Click on Next button. This will show Java Sources Classpath tab.
Finish button.
Setup JSAPI 1.0
Before you build Sphinx-4, it is important to setup your environment to support the Java Speech API (JSAPI), because a number of tests and demos rely on having JSAPI installed.
Add JSAPI 1.0 as a jar to the NetBeans Project
While the previous step sets up a jsapi.jar file in the lib directory, this steps makes jsapi.jar visible within the NetBeans Project. Note that in the instructions that follow, we assume that the project name is sphinx4. We named it while creating a project under NetBeans earlier.
Projects from the Window menu.
Properties by right-clicking on Sphinx-4 project.
Java Sources Classpath option in the left column. This will show up the Java Sources Classpath on the right hand side of the window.
Libraries tab and then, click on Add JAR/Folder... button. This will pop a browsing window.
jsapi.jar by navigating to lib directory, and then click Open button on the browsing window.
OK button. This will add jsapi.jar as a jar to the NetBeans Project.
Add Sphinx-4 specific jars as jars to the NetBeans Project
This step makes the TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz.jar, WSJ_8gau_13dCep_8k_31mel_200Hz_3500Hz.jar, and WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.jar in the lib directories visible within the NetBeans Project.
Properties from the Project menu. This will pop a Project Properties - Sphinx-4 window.
Java Sources Classpath option in the left column. This will show up the Java Sources Classpath on the right hand side of the window.
Add JAR/Folder... button. This will pop a browsing window.
TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz.jar by navigating to lib directory, and then click Open button on the browsing window.
WSJ_8gau_13dCep_8k_31mel_200Hz_3500Hz.jar by navigating to lib directory, and then click Open button on the browsing window.
WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.jar by navigating to lib directory, and then click Open button on the browsing window.
OK button on the Project Properties - Sphinx-4 window. This will add these jar files as jars to the NetBeans Project.
In this step, we provide instructions to run Sphinx-4 demos and tests using NetBeans.
Running Sphinx-4 Demos
Projects from the Window menu.
demo folder and double-click on a demo package (e.g. sphinx.helloworld).
build.xml file and select Run target-> run.
Copy and paste the build.xml file in the others demo packages and modify it, changing appropriately the parameters (e.g. location under pathelement, classname and maxmemory under java).
This is not best procedure, but the fastest I know to run other demos.
Running Sphinx-4 Tests
Projects from the Window menu.
tests folder and double-click on a test package (e.g. live).
build.xml file and select Run target-> (e.g. live to run test or live -ep to run it with endpointer).