MATLAB: How to synchronize audio and video data acquired from a device using Image Aquisition Toolbox 1.8 (R14SP2) and Data Acquisition Toolbox 2.6 (R14SP2)

acquisitionaudiodataData Acquisition ToolboximageImage Acquisition Toolboxsynchronizevideo

I wish to synchronize the audio and video data acquisitions from the same device using Image Aquisition Toolbox 1.8 (R14SP2) and Data Acquisition Toolbox 2.6 (R14SP2).

Best Answer

The Image Acquisition Toolbox can be used to sample video and the Data Acquisition Toolbox can be used to sample audio data. Synchronizing audio and video data acquired from a single device is possible only if the device supports hardware triggering.
Both the Data Acquisition analog input object and the Image Acquisition video input object would need to be configured for a hardware trigger in order to have the acquired data synchronized.
To determine if an analog input object supports hardware triggering, call the SET command to query the object's TriggerType property:
set(ai,'TriggerType')
where ai is the analog input object created using the Data Acquisition Toolbox. This command returns the various triggering options available for the device.
In the Image Acquisition Toolbox, you must use the TRIGGERINFO function to determine all the valid TriggerType, TriggerSource and TriggerCondition configurations of a video input object, specifying the video input object as an argument:
config = triggerinfo(vid);
To set the values of the TriggerType, TriggerSource, and TriggerCondition properties, use the TRIGGERCONFIG function to specify the value of the property as an argument to the function. For example, the following code sets the values of these properties for a hardware trigger:
triggerconfig(vid,'hardware','risingEdge','TTL')