IBM Books

Image, Audio, and Video Extenders Administration and Programming

DBaPlay


Image Audio Video
  X  

Opens the audio player on the client and plays an audio clip. The clip can be stored in an audio column or an external file:

If the audio is stored in a column, the extender creates a temporary file and copies the content of the object from the column to the file. The extender might also create a temporary file if the audio is stored in an external file and its relative filename cannot be resolved using the values in environment variables, or if the file is not accessible on the client machine. The temporary file is created in the directory that is specified in the DB2AUDIOTEMP environment variable. The extender then plays the audio from the temporary file.

Authorization

Select authority on the user table, if playing an audio clip from a column.

Library file
OS/2 and Windows AIX, HP-UX, and Solaris
dmbaudio.lib libdmbaudio.a (AIX)

libdmbaudio.sl (HP-UX)

libdmbaudio.so (Solaris)

Include file

dmbaudio.h

Syntax

Play an audio stored in a column

long DBaPlay(
      char *playerName,
      MMDB_PLAY_HANDLE,
      DB2Audio *audioHandle,
      waitFlag
      );

Syntax

Play an audio stored as a file

long DBaPlay(
      char *playerName,
      MMDB_PLAY_FILE,
      char *fileName,
      waitFlag
      );

Parameters

playerName (in)
The name of the audio player. If set to NULL, the default audio player specified by the DB2AUDIOPLAYER environment variable is used.

MMDB_PLAY_HANDLE (in)
A constant that indicates the audio is stored as a BLOB.

MMDB_PLAY_FILE (in)
A constant that indicates the audio is stored as a file that is accessible from the client.

audioHandle (in)
The handle of the audio. This parameter must be passed when you play an audio clip in a column. If the audio handle represents an external file, the client environment variable DB2VIDEOPATH is used to resolve the file location.

fileName (in)
The name of the file that contains the audio.

waitFlag (in)
A constant that indicates whether your program waits for the user to close the player before continuing. MMDB_PLAY_WAIT runs the player in the same thread as your application. MMDB_PLAY_NO_WAIT runs the player in a separate thread.

Error codes

MMDB_SUCCESS
API call processed successfully.

MMDB_RC_NO_AUTH
Caller does not have the proper access authority.

MMDB_RC_NOT_CONNECTED
Application does not have valid connection to a database.

Examples

Play the audio that is identified by the audioHandle. Run the default player in the same thread as the application:

#include <dmbaudio.h>
 
rc = DBaPlay(NULL, MMDB_PLAY_HANDLE,
       audioHandle, MMDB_PLAY_WAIT);


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]