Voicetronix Programming Guide
<<< Previous |  | Next >>>

# Programming

## Introduction

The Voicetronix cards are programmed via the VPB Application Programmer Interface (VPBAPI, or just API). This is a set of C callable functions. The following sections describe the VPBAPI in detail, and also include examples of the API functions in action. It is recommended that the user browse the header file vpbapi.h to gain an overview of the API.

## Compiling with the VPBAPI

### Linux and FreeBSD

Simply link `libvpb.a` with your application:

`$` `gcc test.cpp -o test -Wall -g -lvpb -pthread -lm`

### Windows

1. Create a new project (e.g. Win32 Console Application) and insert your source files.

2. Project-Settings-C/C++:

   - set "Category" to "Code Generation"

   - set "Use run-time library:" to "Debug Multithreaded"

3. Project-Settings-Link:

   - To the "Object/library modules" add `../debug/libvpb.lib` (you might need to change the path to `libvpb.lib`, depending on where you create your project).

4. Build your project.

5. Make sure `libvpb.dll` and `plxapi.dll` are in your path before running. One way is to set the Project-Settings-Debug-Working Directory to a directory containing the DLL, or place the DLL in a directory in your path (e.g. `c:\winnt\system32`)

6. Set the path for the firmware. The firmware is called `vpbmain_pci.out`, and is in `vpb-driver/firmware/`. There are two ways to set the path:

   - Modify `vpbreg.cpp`, change the `#define FIRMWARE_FILE_PCI` to your path and recompile `libvpb.dll` (see `Readme.Win32.txt` for information on how to recompile the driver).

   - Set an environment variable `VPB_FIRMWARE` to the path to the firmware file. Under NT go to control panel-system-environment. After setting the env. variable, you will need to restart MSVC before running so that the new env. variable is available to MSVC.

7. You should now be able to run your program from MSVC.

<<< Previous | Home | Next >>>
Voicetronix Programming Guide |  | Initialization and Shutdown