Voicetronix Programming Guide
<<< Previous |  |

# Function Reference

## `vpb_start()`

Synopsis

    int WINAPI vpb_start(int num_cards, int *bases, char *firmware_file, int model)

Function

Initialises the API software (boots DSPs etc) when operating in "bayonne" mode. Calling this function before vpb_open() starts the driver in "bayonne" mode. If vpb_open() is called without calling this function first, the driver is started in "regular" mode. The major feature of bayonne mode is that the user must set up a thread to periodically call (poll) the vpb_get_event_async_bayonne() function. Without this thread the driver will not function. This has certain advantages where the user whishes to control the number of threads in the system, and was specifically written for the bayonne package (www.bayonne.cx). See the unittest tvpb.cpp for an example of a program implemented using bayonne mode. In regular mode, the driver sets up all sorts of polling threads which leads to generally simpler application code. In other words the choice of bayonne vs regular mode is the usual choice of flexibility vs complexity :-). Most of the programs in the unittest directory use regular mode. Note: bayonne mode was originally supported by the 2.0.x series vpb drivers, and regular mode by the 1.x.y series of drivers.

## `vpb_open()`

Synopsis

    int WINAPI vpb_open(unsigned int board, unsigned int channel)

Function

Opens a VPB device (channel), and returns a handle to that device. See also vpb_start().

## `vpb_close()`

Synopsis

    int WINAPI vpb_close(int devhandle)

Function

Closes a device. If this is the last device remaining, then the API is closed down (memory free-ed, DSP stopped etc).

## `vpb_stop()`

Synopsis

    int WINAPI vpb_stop()

Function

API is closed down (memory free-ed, DSP stopped etc). Only used for "bayonne" mode.

## `vpb_get_event_async_bayonne ()`

Synopsis

    int WINAPI vpb_get_event_async_bayonne(
     			int board,    // VPB board number: 1,2,3..
    			VPB_EVENT *ev // event
    )

Function

Note: This function is only used in "bayonne" mode. Please do not call in "regular" mode - see also vpb_start() This function returns an event from the specified VPB card. If an event is available it returns VPB_OK, otherwise it returns VPB_NO_EVENTS. When this function returns, it should be called again as soon as possible in a tight polling loop, as it is responsible for sequencing several time-sensitive operations (e.g. playing DTMF tones). Avoid placing blocking functions in the polling loop that calls this function, to ensure it is called regularly. Once every 20ms is recommended. IMPORTANT: This function must be called regularly, as the driver uses this function to service time critical tasks in the driver. This function must be polled regularly, even if no events are required for the program. Without it, other functions, such as play/record, will not work.

## `vpb_set_event_callback()`

Synopsis

    int WINAPI vpb_set_event_callback(int handle, void (WINAPI *event_callback)(VPB_EVENT *e, void *context), void *context)

Function

Sets the event callback function for each channel. By default no event callback functions are set, in this case events are posted to the API event Q. If this function has been called with a non-null function pointer, the event callback funcion is called with the event as an argument rather than posting the event to the API Q. The user defined event callback function should be of the form: void event_callback(VPB_EVENT *e); To disable the event callback, call this function with a NULL pointer for the function argument.

## `vpb_set_event_mask()`

Synopsis

    int WINAPI vpb_set_event_mask(int handle, unsigned short mask)

Function

Function to set the event mask for each device. Each call to this function overwrites the previous event mask.

## `vpb_get_event_mask()`

Synopsis

    int WINAPI vpb_get_event_mask(int handle)

Function

Function to return the current event mask for a given device.

## `vpb_enable_event()`

Synopsis

    int WINAPI vpb_enable_event(int handle, unsigned short mask)

Function

Function to unmask (enable) only the specified events while leaving the rest of the event masks unchanged.

## `vpb_disable_event()`

Synopsis

    int WINAPI vpb_disable_event(int handle, unsigned short mask)

Function

Function to mask out (disable) specified events only, while leaving the rest of the event masks unchanged.

## `vpb_put_event()`

Synopsis

    int WINAPI vpb_put_event(VPB_EVENT *e)

Function

Function to place an event on the API event queue exported API version.

## `vpb_get_event_async()`

Synopsis

    int WINAPI vpb_get_event_async(VPB_EVENT *e)

Function

Function to get an event from the API event queue. Returns VPB_OK if an event available, other wise VPB_NO_EVENTS if Q empty.

## `vpb_get_event_sync()`

Synopsis

    int WINAPI vpb_get_event_sync(VPB_EVENT *e, unsigned int time_out)

Function

This function waits until an event is available on the API Q, then returns. The thread is put to sleep until the event becomes available. Function returns VPB_OK if event returned, else VPB_TIME_OUT if sync function times out. Use tme_out = 0 for no timeout.

## `vpb_get_event_ch_sync()`

Synopsis

    int WINAPI vpb_get_event_ch_sync(int h, VPB_EVENT *e, unsigned int time_out)

Function

This function waits until an event is available on the API Q, then returns. The thread is put to sleep until the event becomes available. This version only returns events from a specified channel.

## `vpb_get_event_ch_async()`

Synopsis

    int WINAPI vpb_get_event_ch_async(int h, VPB_EVENT *e)

Function

This reads an event on a channels event queue if available.

## `vpb_sethook_async()`

Synopsis

    int WINAPI vpb_sethook_async(int chdev, int hookstate)

Function

Function to set the hook status of a particular chnnel device. This version returns immediately.

## `vpb_sethook_sync()`

Synopsis

    int WINAPI vpb_sethook_sync(int chdev, int hookstate)

Function

Function to set the hook status of a particular chnnel device. This version returns after the hook status has been changed.

## `vpb_set_station_sync()`

Synopsis

    int WINAPI vpb_set_station_sync(int chdev, int state)

Function

Function to set the status (on or off) of a station port channel device. This version returns after the status has been changed. NOTE: DR 22/8/02 - this function is not normally required, as hook detector logic has been modified to automatically turn off/on station audio with hook switch.

## `vpb_ring_station_async()`

Synopsis

    int WINAPI vpb_ring_station_async(int chdev, int state)

Function

Function to start/stop a station port ringing. This version rings stations with a pre-defined cadence.

## `vpb_ring_station_sync()`

Synopsis

    int WINAPI vpb_ring_station_sync(int chdev, int state)

Function

Function to start/stop a station port ringing.

## `vpb_user_ring_station_sync()`

Synopsis

    int WINAPI vpb_user_ring_station_sync(int chdev, int state)

Function

Function to start/stop a station port ringing. This version allows the caller (user) to define the cadence. Station will ring continuously when called with state==1, until called with state==0. Care should be taken to ring no more than that 4 stations at any one time, to prevent overloading the OpenSwitch12 ring generator. Excess load of the ring generator will not result in permanent damage, however the station power supply to shut down, requiring a power down of the OpenSwitch12 (ie switching the PC off) to reset. This function should not be used in conjunction with vpb_ring_station_sync, the cadenced ring generator function, as the driver will get confused!

## `vpb_sleep()`

Synopsis

    void WINAPI vpb_sleep(long time)

Function

Function to put the current thread to sleep for a certain time in ms. Used during testing to reduce the amount of time program spends in main polling loop so that the computational load of the timer callback can be measured.

## `vpb_adpcm_open()`

Synopsis

    int WINAPI vpb_adpcm_open(void **pv)

Function

Sets up the state variables for ADPCM opertaions. Must be called before any other ADPCM functions.

## `vpb_adpcm_close()`

Synopsis

    void WINAPI vpb_adpcm_close(void *pv)

Function

Closes down the ADPCM state variables, freeing memory. Call after all ADPCM operations have finished.

## `vpb_adpcm_reset()`

Synopsis

    void WINAPI vpb_adpcm_reset(void *pv)

Function

Resets the ADPCM state variables.

## `vpb_adpcm_decode()`

Synopsis

    int WINAPI vpb_adpcm_decode(
    	void			*pv,	   // ADPCM state variables
    	short			linear[],  // linear output samples
    	unsigned short  *size_lin,	   // number of 16 bit samples out
    	char			adpcm[],   // packed ADPCM samples
    	unsigned short	size_adpcm	   // number of bytes in (must be even)

Function

Converts a buffer of compressed OKI ADPCM samples to a buffer of 16 bit linear samples.

## `vpb_adpcm_encode()`

Synopsis

    int WINAPI vpb_adpcm_encode(
    	void		*pv,	     // ADPCM state variables
    	char		adpcm[],     // output packed ADPCM samples
    	unsigned short	*size_adpcm, // number of bytes out
    	short		linear[],    // linear input samples
    	unsigned short  size_linear  // number of 16 bit samples in
    )

Function

Converts a buffer of 16 bit linear samples to a buffer of compressed OKI ADPCM samples.

## `vpb_comp_load()`

Synopsis

    int WINAPI vpb_comp_load(unsigned short board)

Function

Interrogates the DSP to determine the computational loading. Causes a comp load statement to be printed if mprintf's are enabled. Dont expose the function to the punters, keep it as undocumented for our use only.

## `vpb_echo_canc_force_adapt_on()`

Synopsis

    int WINAPI vpb_echo_canc_force_adapt_on()

Function

Forces the echo cancellers to adapt all of the time, ie switches off near end speech detector. Used to determine maximum computational load.

## `vpb_echo_canc_force_adapt_off()`

Synopsis

    int WINAPI vpb_echo_canc_force_adapt_off()

Function

Stops forced adaptation.

## `vpb_echo_canc_enable()`

Synopsis

    int WINAPI vpb_echo_canc_enable()

Function

Enables the echo cancellers.

## `vpb_echo_canc_disable()`

Synopsis

    int WINAPI vpb_echo_canc_disable()

Function

Disables the echo cancellers, but keeps adaptation on.

## `vpb_echo_canc_get_sup_thresh()`

Synopsis

    int WINAPI vpb_echo_canc_get_sup_thresh(short *thresh)

Function

Gets the current echo suppressor threshold. This threshold is the same for all channels on all cards.

## `vpb_echo_canc_set_sup_thresh()`

Synopsis

    int WINAPI vpb_echo_canc_set_sup_thresh(short *thresh)

Function

Sets the current echo suppressor threshold. This threshold is the same for all channels on all cards. 0x1000 (4096) -18dB 0x800 (2048) -24dB 0 0 no supressor

## `vpb_get_model()`

Synopsis

    int WINAPI vpb_get_model(char *s) {

Function

Returns a string containing the VPB model, driver should be started first by at least one call to vpb_open().

## `vpb_get_ports_per_card()`

Synopsis

    int WINAPI vpb_get_ports_per_card() {

Function

Returns the number of ports on each card.

## `vpb_set_codec_reg()`

Synopsis

    void WINAPI vpb_set_codec_reg(int chdev,    // channel handle
    		              USHORT addr,  // 8-bit address of codec register
    		              USHORT data   // 8-bit data to write to register
    )

Function

Used to set a register of the TS5070 codecs, allows driver-level config of codec, rather than hard-coding in DSP firmware.

## `vpb_get_num_cards()`

Synopsis

    int WINAPI vpb_get_num_cards()

Function

Returns the number of cards in the system. In current implemention need to call vpb_open() or vpb_start() before calling this function. This means e.g. one channel should be opened before determining how many cards there are! This is very silly and should be fixed some time!

## `vpb_bridge()`

Synopsis

    int WINAPI vpb_bridge(
    		       int h1,      // handle of first channel
    		       int h2,      // handle of second channel
    		       int mode,    // VPB_BRIDGE_ON | VPB_BRIDGE_OFF
    		       int resource // bridge resource 1 or 2 (V4PCI only)

Function

Bridges two ports using the driver, to allow 2-way conferencing. The bridging is implemented at a low level (firmware and/or hardware) by the driver to ensure a low delay connection between the ports. Note that only ports on the same physical card can be bridged using this method. Two bridging resources are available on the V4PCI (1 & 2). For 3 or more way conferencing (or bridging between ports on different cards) use "software bridging" using the play and record buf API functions. This results in a higher delay (20ms or so), however this does not cause a problem due to the echo canceller on each VPB port.

## `vpb_watchdog_enable()`

Synopsis

    int WINAPI vpb_watchdog_enable(int h, int enable) {

Function

Enables (enable == 1), or disables (enable == 0) V12PCI watchdog timer. There is one watchdog timer per board, so only one call per board is required, any handle h from that board can be used. Once enabled, it must be reset at least once every 8 seconds by vpb_watchdog_reset. If it is not reset the watchdog timer will fire. Once fired, the hardware will assume the PC has crashed, and the first 4 station ports will be connected to the first 4 loop ports to preserve basic phone functionality. Use of the watchdog timer assumes a mixed station/loop configuration. Do not use the watchdog timer when the card is configured as all loop or all station cards.

## `vpb_watchdog_reset()`

Synopsis

    int WINAPI vpb_watchdog_reset(int h) {

Function

Resets watchdog timer. Call at least once every 8 seconds to prevent watchdog timer firing. Does nothing when watchdog timer is disabled. There is one watchdog timer per board, so only one call per board is required, any handle h from that board can be used.

## `vpb_card_data()`

Synopsis

    int WINAPI vpb_get_card_info(
    			int 		board,	// Board number
    	       		VPB_CARD_INFO 	*detail // Card Info Structure to fill.
    )

Function

Returns the card details in a structure VPB_CARD_INFO. Includes: Model name, Serial number, Revision number, Manufacture Date All strings are null terminated. Note: Only supported under Linux at this time!

## `vpb_strerror()`

Synopsis

    char * WINAPI vpb_strerror(int code)

Function

Converts a numeric error code to a human-readable error description. Passes back a pointer to a string which describes the error code.

## `vpb_seterrormode()`

Synopsis

    int WINAPI vpb_seterrormode(
    			    int mode
    )

Function

Helper function that determines the way errors are handled in the RunTimeError function below. See RunTimeError() for more info.

## `vpb_throw_exception()`

Synopsis

    void WINAPI vpb_throw_exception(int c, char trans[], char api_function[])

Function

Helper function that throws a VpbException.

## `vpb_translate_event()`

Synopsis

    void WINAPI vpb_translate_event(VPB_EVENT *e, char s[])

Function

Function to translate the current event into a string.

## `vpb_cid_set()`

Synopsis

    int WINAPI vpb_cid_set(VPB_CID *cid_struct, int type, void *value)

Function

VPBAPI function to load valid data of 'type' and 'value' into the passed CID structure. Loading some fields will set associated fields to NULL automaticly as the fiedls are exclusive Return: Error if invalid type of value out of range, else OK

## `vpb_cid_compose_dlp ()`

Synopsis

    int WINAPI vpb_cid_compose_dlp(VPB_CID *MESG, char *dlp)

Function

Build the message dlp from the VPB_CID structure.

## `vpb_cid_compose_wav ()`

Synopsis

    int WINAPI vpb_cid_compose_wav(char *DLP, int DLP_LEN, short *BUFF_WAV,
    			       int *BUFF_PTR)

Function

Encodes the Data Link Packet recived into a CP-FSK wave including CSS & MSS bit headers. Returns *BUFF_WAV containing *BUFF_PTR samples.

## `vpb_wave_open_write()`

Synopsis

    int WINAPI vpb_wave_open_write(void **ppv, char filename[], int mode)

Function

Opens a RIFF Wave file.

## `vpb_wave_open_read()`

Synopsis

    int WINAPI vpb_wave_open_read(void **ppv, char filename[])

Function

Opens a RIFF Wave file for reading.

## `vpb_wave_close_write()`

Synopsis

    void WINAPI vpb_wave_close_write(void *wv)

Function

Closes a RIFF Wave file after writing.

## `vpb_wave_close_read()`

Synopsis

    void WINAPI vpb_wave_close_read(void *wv)

Function

Closes a RIFF Wave file after reading.

## `vpb_wave_write()`

Synopsis

    int WINAPI vpb_wave_write(void *wv, char buf[], long n)

Function

Writes a block of speech samples to a RIFF Wave file.

## `vpb_wave_read()`

Synopsis

    int WINAPI vpb_wave_read(void *wv, char buf[], long n)

Function

Reads a block of speech samples from a RIFF Wave file. Returns the number of bytes read.

## `vpb_wave_seek()`

Synopsis

    int WINAPI vpb_wave_seek(void *wv, long offset)

Function

Moves wave pointer to a specified location in samples, with respect to the beginning of the file.

## `vpb_wave_set_sample_rate()`

Synopsis

    void WINAPI vpb_wave_set_sample_rate(void *wv, unsigned short rate)

Function

Changes the sample rate of a wave file.

## `vpb_wave_get_mode()`

Synopsis

    int WINAPI vpb_wave_get_mode(void *wv, unsigned short *mode)

Function

Determines the compression mode of a wave file.

## `vpb_config()`

Synopsis

    int WINAPI vpb_config(int num_cards, int *bases, char *firmware_file, int model) {

Function

Set installation specific config info, call before vpb_open(). If this function is called, it overrides any other settings (for example compile-time defaults or env vars).

## `vpb_cid_debug_on()`

Synopsis

    void WINAPI vpb_cid_debug_on(char debug_file_name[]) {

Function

Call this function to enable debugging of the CID module. Causes lots of debug info to be written to the text file "debug_file_name".

## `vpb_cid_decode()`

Synopsis

    int WINAPI vpb_cid_decode(
    		          char  *number,
    			  short *in,
    			  int   n
    			  )

Function

As per cid-demodulate() but parse out all CID fields.

## `vpb_cid_demodulate()`

Synopsis

    int WINAPI vpb_cid_demodulate(char* number, int* nChars, short* in, int n)

Function

Attempts to decode CID information from an array of samples. Throws various exceptions should an error occur. Returns the caller number in "number". Will return a null-str in "number" if no caller number supplied.

## `vpb_setagc()`

Synopsis

    int WINAPI vpb_setagc(int handle, VPB_AGC *agc)

Function

Sets the agc parameters for a specified channel.

## `vpb_getagc()`

Synopsis

    int WINAPI vpb_getagc(int handle, VPB_AGC *agc)

Function

Gets the agc parameters for a specified channel.

## `vpb_timer_open()`

Synopsis

    int WINAPI vpb_timer_open
    (
     void **ppv,          // ptr to timer state variables
     int chdev,           // channel device handle
     int timer_id,        // Optional ID for this timer
     unsigned long period // period in ms before posting event
    )

Function

Initialises a timer object for the specified channel device.

## `vpb_timer_close()`

Synopsis

    int WINAPI vpb_timer_close
    (
     void *timer // ptr to timer state variables
    )

Function

Deletes a timer object.

## `vpb_timer_start()`

Synopsis

    int WINAPI vpb_timer_start
    (
     void *pv // ptr to timer state variables
    )

Function

Starts a timer. When the period specified in vpb_timer_open expires, and event for this channel device is generated. If timer is already active, this function throws a wobbly.

## `vpb_timer_restart()`

Synopsis

    int WINAPI vpb_timer_restart
    (
     void *pv // ptr to timer state variables
    )

Function

ReStarts an already active timer.

## `vpb_timer_stop()`

Synopsis

    int WINAPI vpb_timer_stop
    (
     void *pv // ptr to timer state variables
    )

Function

Stops an active timer by removing it from the active list. This function allows the timer to be stopped from the API.

## `vpb_timer_change_period()`

Synopsis

    int WINAPI vpb_timer_change_period
    (
     void *pv,              // ptr to timer state variables
    unsigned long newperiod // period in ms before posting event
    )

Function

Changes the time out value of a timer that has already been initialised.

## `vpb_timer_get_unique_timer_id()`

Synopsis

    int WINAPI vpb_timer_get_unique_timer_id() {

Function

Allows the timer module to generate unique IDs for all of the VPB timer objects in the system.

## `vpb_setvox()`

Synopsis

    int WINAPI vpb_setvox(int handle, VPB_VOX *vox)

Function

Sets the vox parameters for a specified channel.

## `vpb_getvox()`

Synopsis

    int WINAPI vpb_getvox(int handle, VPB_VOX *vox)

Function

Gets the vox parameters for a specified channel.

## `vpb_settonedet()`

Synopsis

    int WINAPI vpb_settonedet(int chdev, VPB_DETECT *d)

Function

Enables user to set a user programmed tone, or replace an exisiting tone. Performs translation of user parameters to VPB message. The tones are defined on a per channel basis. This version (for the API), stops the config mamanger before download- ing a tone to prevent computational overoad probs.

## `vpb_gettonedet()`

Synopsis

    int WINAPI vpb_gettonedet(int chdev, int id, VPB_DETECT *d)

Function

Enables user to extract a tone detectors parameters.

## `vpb_debug_tonedet()`

Synopsis

    int WINAPI vpb_debug_tonedet(int chdev, int id, char file_name[], int sec)

Function

Instructs API to produce a debug file of tone detector parameters for one channel.

## `vpb_set_call()`

Synopsis

    int WINAPI vpb_set_call(int handle, VPB_CALL *vpb_call)

Function

Function to set call progress parameters.

## `vpb_get_call()`

Synopsis

    int WINAPI vpb_get_call(int handle, VPB_CALL *vpb_call)

Function

Function to get current call progress parameters.

## `vpb_call_sync()`

Synopsis

    int WINAPI vpb_call_sync(int handle, char *dialstr)

Function

Place a call using call progress algorithm. Note: when this function is called, make sure dial tone has not been detected yet.

## `vpb_call_async()`

Synopsis

    int WINAPI vpb_call_async(int handle, char *dialstr)

Function

Place a call using call progress algorithm, async version. Note: when this function is called, make sure dial tone has not been detected yet.

## `vpb_get_digits_async()`

Synopsis

    int WINAPI vpb_get_digits_async(int handle, VPB_DIGITS *newdig, char *buf)

Function

Gets a buffer of digits based on the conditions passed to the function. Returns immediately, and posts a comletetion event when the buffer has been obtained. If this function is called while already collecting digits (by a prvious call to this function), the digit collection is reset, and digits collected so far are discarded.

## `vpb_get_digits_sync()`

Synopsis

    int WINAPI vpb_get_digits_sync(int handle, VPB_DIGITS *newdig, char *buf)

Function

Gets a buffer of digits based on the conditions passed to the function. Returns when digit buffer has been obtained, with appropriate VPB_DIGIT_XXX return code.

## `vpb_flush_digits()`

Synopsis

    int WINAPI vpb_flush_digits(int handle)

Function

Clears the internal digit buffer, often called before vpb_get_digits_xxxx.

## `vpb_dial_async()`

Synopsis

    int WINAPI vpb_dial_async(
    			  int  chdev,      // handle
    			  char *dialstring // string to dial
    )

Function

Sends a DTMF string down a channel device, accepts the following characters by default, plus user defined chars if defined: 0 1 2 3 4 5 6 7 8 9 0 * # A B C D and: & (hook flash) , (pause)

## `vpb_dial_sync()`

Synopsis

    int WINAPI vpb_dial_sync(
    			 int  chdev,      // handle
    			 char *dialstring // string to dial
    )

Function

Sends a DTMF string down a channel device, accepts the following characters by default, plus user defined chars if defined: 0 1 2 3 4 5 6 7 8 9 0 * # A B C D and: & (hook flash) , (pause)

## `vpb_settone()`

Synopsis

    int WINAPI vpb_settone(
    		       char ident, // single char that identifies tone
    		       VPB_TONE *t // structure containing tone parameters
    )

Function

Enables user to set a user programmed tone, or replace an existing tone. Performs translation of user parameters to VPB message.

## `vpb_gettone()`

Synopsis

    int WINAPI vpb_gettone(
    		       char ident, // single char that identifies tone
    		       VPB_TONE *t // structure containing tone parameters
    )

Function

Enables user to retrieve the parameters of a tone. Performs translation of user parameters from VPB message.

## `vpb_playtone_async()`

Synopsis

    int WINAPI vpb_playtone_async(int handle, VPB_TONE *vpb_tone)

Function

Plays a user defined tone immediately, API version.

## `vpb_playtone_sync()`

Synopsis

    int WINAPI vpb_playtone_sync(int handle, VPB_TONE *vpb_tone)

Function

Plays a user defined tone immediately, API version.

## `vpb_tone_terminate()`

Synopsis

    int WINAPI vpb_tone_terminate(int handle)

Function

Terminates playing of tones (programmable or DTMFs).

## `vpb_play_set()`

Synopsis

    int WINAPI vpb_play_set(int handle, VPB_PLAY *vpb_play)

Function

Sets play parameters or this channel.

## `vpb_play_buf_start()`

Synopsis

    int WINAPI vpb_play_buf_start(int handle, unsigned short mode)

Function

API callable version of play_buf_start.

## `vpb_play_buf_sync()`

Synopsis

    int WINAPI vpb_play_buf_sync(int handle, char *buf, unsigned short length)

Function

API version of play_buf_sync(). Returns VPB_FINISH if playing should finish, else returns VPB_OK.

## `vpb_play_buf_finish()`

Synopsis

    int WINAPI vpb_play_buf_finish(int handle)

Function

Completes the playing of a channel.

## `vpb_play_file_sync()`

Synopsis

    int WINAPI vpb_play_file_sync(int handle, char file_name[])

Function

Utility function to play a file to a channel. Function returns when playing is finished.

## `vpb_play_voxfile_sync()`

Synopsis

    int WINAPI vpb_play_voxfile_sync(int handle, char file_name[],
    				 unsigned short mode)

Function

Function to play a vox file to a channel. Function returns when playing is finished.

## `vpb_play_file_async()`

Synopsis

    int WINAPI vpb_play_file_async(int handle, char file_name[], int data)

Function

Utility function to play a file to a channel. Function returns as soon as playing has started, and places an event on the API Q when playing has finished.

## `vpb_play_voxfile_async()`

Synopsis

    int WINAPI vpb_play_voxfile_async(int handle, char file_name[],
    				  unsigned short mode,int data)

Function

Utility function to play a vox file to a channel. Function returns as soon as playing has started, and places an event on the API Q when playing has finished.

## `vpb_play_terminate()`

Synopsis

    int WINAPI vpb_play_terminate(int handle)

Function

Stops playing immediately. Does nothing if we are not playing. NOTE: this doesnt have to be in the same thread context as vpb_play_buf_xxxx

## `vpb_record_set()`

Synopsis

    int WINAPI vpb_record_set(int handle, VPB_RECORD *vpb_record)

Function

Sets record parameters or this channel.

## `vpb_record_buf_start()`

Synopsis

    int WINAPI vpb_record_buf_start(int handle, unsigned short mode)

Function

API callable version of record_buf_start. NOTE: All vpb_record_buf_xxxx functions for a given channel must be executed in the same thread context.

## `vpb_record_buf_sync()`

Synopsis

    int WINAPI vpb_record_buf_sync(int handle, char *buf, unsigned short length)

Function

API version of record_buf_sync(). NOTE: All vpb_record_buf_xxxx functions for a given channel must be executed in the same thread context.

## `vpb_record_buf_finish()`

Synopsis

    int WINAPI vpb_record_buf_finish(int handle)

Function

Completes the recording of a channel. NOTE: All vpb_record_buf_xxxx functions for a given channel must be executed in the same thread context.

## `vpb_record_file_sync()`

Synopsis

    int WINAPI vpb_record_file_sync(int handle, char file_name[], unsigned short mode)

Function

Utility function to record a file to a channel. Function returns when recording is finished.

## `vpb_record_voxfile_sync()`

Synopsis

    int WINAPI vpb_record_voxfile_sync(int handle, char file_name[], unsigned short mode)

Function

Utility function to record a vox file to a channel. Function returns when recording is finished.

## `vpb_record_file_async()`

Synopsis

    int WINAPI vpb_record_file_async(int handle, char file_name[],
    				 unsigned short mode)

Function

Utility function to record a file from a channel. Function returns as soon as recording has started, and places an event on the API Q when recording has finished.

## `vpb_record_voxfile_async()`

Synopsis

    int WINAPI vpb_record_voxfile_async(int handle, char file_name[],
    				    unsigned short mode)

Function

Utility function to record a vox file from a channel. Function returns as soon as recording has started, and places an event on the API Q when recording has finished.

## `vpb_record_terminate()`

Synopsis

    int WINAPI vpb_record_terminate(int handle)

Function

Stops recording immediately. Does nothing if we are not recording. NOTE: this doesnt have to be in the same thread context as vpb_record_buf_xxxx

## `vpb_play_set_gain()`

Synopsis

    int WINAPI vpb_play_set_gain(int handle, float gain)

Function

Sets the gain of the play channel, using the hardware gain of the TS5070 codec on the VPB4. JK: 9/4/02 Modified to only set software gain and not the hardware gain of the TS5050 codec.

## `vpb_play_set_hw_gain()`

Synopsis

    int WINAPI vpb_play_set_hw_gain(int handle, float gain)

Function

Externally accessible wrapper around play_set_hw_gain.

## `vpb_play_get_gain()`

Synopsis

    int WINAPI vpb_play_get_gain(int handle, float *gain)

Function

Gets the total gain of the play channel. It comprising of a softare and hardware component (TS5070 codec) on the VPB4/V4PCI.

## `vpb_record_get_gain()`

Synopsis

    int WINAPI vpb_record_get_gain(int handle, float *gain)

Function

Gets the total gain of the play channel. It comprising of a softare and hardware component (TS5070 codec) on the VPB4/V4PCI.

## `vpb_record_set_gain()`

Synopsis

    int WINAPI vpb_record_set_gain(int handle, float gain)

Function

Sets the total gain of the record channel. The total gain is comprised of a software and hardware component (TS5070 codec). Previously it only comprised of the hardware component. JK 9/4/02 Modified to only set sofware record gain. Disabled hardware configured record gain.

## `vpb_record_set_hw_gain()`

Synopsis

    int WINAPI vpb_record_set_hw_gain(int handle, float gain)

Function

Externally accessible wrapper around record_set_hw_gain.

## `vpb_reset_record_fifo_alarm()`

Synopsis

    int WINAPI vpb_reset_record_fifo_alarm(int handle)

Function

Resets the latch that detects record DSP buffer overflows. After calling this function another event may be generated if the buffer overflows.

## `vpb_reset_play_fifo_alarm()`

Synopsis

    int WINAPI vpb_reset_play_fifo_alarm(int handle)

Function

Resets the latch that detects record DSP buffer underflows. After calling this function another event may be generated if the buffer underflows.

## `vpb_set_pip()`

Synopsis

    int WINAPI vpb_set_pip(VPB_PIP *vpb_pip)

Function

Sets the pip parameters for all channels.

## `vpb_set_pip_ch()`

Synopsis

    int WINAPI vpb_set_pip_ch(int handle, VPB_PIP *vpb_pip)

Function

Sets the pip parameters for a specifed channel.

## `vpb_get_pip()`

Synopsis

    int WINAPI vpb_get_pip(VPB_PIP *vpb_pip)

Function

Gets the pip parameters for the first channel.

## `vpb_get_pip_ch()`

Synopsis

    int WINAPI vpb_get_pip_ch(int handle, VPB_PIP *vpb_pip)

Function

Gets the pip parameters for the specified channel.

## `vpb_pip_on()`

Synopsis

    int WINAPI vpb_pip_on(int handle)

Function

Enables pip generation for a channel.

## `vpb_pip_off()`

Synopsis

    int WINAPI vpb_pip_off(int handle)

Function

Disables pip generation for a channel.

<<< Previous | Home |
Miscellaneous Functions |  |