IBM Books

Image, Audio, and Video Extenders Administration and Programming

FindInstrument


Image Audio Video
  X  

Returns the track number of the first occurrence of a specified instrument in a MIDI audio.

Include file

dmbaudio.h

Syntax

>>-FindInstrument--(--handle--,--instrument--)-----------------><
 

Parameters (data type)

handle (DB2AUDIO)
Column name or host variable that contains the handle of the audio.

instrument (VARCHAR(255))
Name of the instrument to be searched for. The Audio Extender will look for an instrument whose name exactly matches the supplied name.

Return values (data type)

Track number that contains the first occurrence of the specified instrument name (SMALLINT); a value of -1 is returned if an instrument of the specified name is not found. NULL is returned for audio in other formats.

Examples

Find the first occurrence of PIANO in Robert Smith's MIDI audio recording stored in the sound column of the employee table:

EXEC SQL BEGIN DECLARE SECTION;
      short hvInstr;
EXEC SQL END DECLARE SECTION;
 
EXEC SQL SELECT FINDINSTRUMENT(SOUND, 'PIANO')
      INTO :hvInstr
      FROM EMPLOYEE
      WHERE NAME = 'Robert Smith';


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