Presentation is loading. Please wait.

Presentation is loading. Please wait.

TWAIN Open industry standard interface for the input devices to capture multimedia objects More and more sophisticated devies are developed to cater to.

Similar presentations


Presentation on theme: "TWAIN Open industry standard interface for the input devices to capture multimedia objects More and more sophisticated devies are developed to cater to."— Presentation transcript:

1 TWAIN Open industry standard interface for the input devices to capture multimedia objects More and more sophisticated devies are developed to cater to the needs of various applications

2 HOW THESE DEVICES ARE USED? Applications were initially written for a single device Eg. OCR reads a text and imports the file as ASCII file to the application. Less flexible and so used different appl. Program for different devices. Time consuming

3 Contd. Later, device drivers were provided with all devices to provide an interface between program and the devices Appl. program became more complex. Complicated code for supporting multiple interfaces.

4 USAGE OF TWAIN TWAIN working group created an open industry standard interface for input devices Single TWAIN interface can be used to interface different devices.

5 BENEFITS OF TWAIN Application developers can code a single TWAIN interface Device manufacturers can write device drivers with TWAIN spec. Multiple devices can be used in appl. Using “Acquire” & “Select Source”

6 OBJECTIVES Supports multiple platform Supports multiple devices Widespread acceptance with std. interface Extendibility & backward compatibility Multidata format Easy to use

7 TWAIN ARCHITECTURE

8 APPLICATION LAYER Sets up a logical connection with device No rules on the design User interface guideline to select sources Select source helps to select multiple sources Acquire helps to import data from the selected device.

9 PROTOCOL LAYER Provides interface for appl. Layer Comm. between appl. and acquisition layer Specifies services provided by a source Does not specify physical connection, control & devices info. Source Manager – heart of protocol layer

10 SOURCE MANAGER Provide std. API for all sources Selection of sources Establish logical sessions b/w appl. and sources. Regulates traffic and validate transactions Load or unload sources Maintain default source Keep track of sessions and session identities

11 ACQUISTION LAYER Contains virtual device driver Acts directly with device driver Local Remote SOURCE

12 Functions of source Control of device Acquisition of data from device Transfer of data in agreed format Control of devices by user DEVICE LAYER Receives the s/w commands and controls the device hardware accordingly

13 New WAVE RIFF file format Two mandatory subchunks fmt data Four optional subchunks fact cue points playlist associated data list RIFF STRUCTURE RIFF(‘WAVE’ [ ] )

14 FACT,CUE POINT & Playlist Fact chunk ->fact( ) Cue–point chunk struct{ DWORD dwName; DWORD dwposition; FOURCC fccChunk; DWORD dwChunkStart; DWORD dwBlockStart; DWORD dwSampleOffset; Playlist chunk Struct { DWORD dwName; DWORD dwLength; DWORD dwLoops; }

15 Associated &Inst Chunk Associated data chunk: ->LIST( ‘adtl’ ) Inst chunk: -> inst( )

16 Setting up new WAVE types Mandatory chunks fact fmt Extended waveform structure typedef struct waveformat_extended_tag { WORDwFormatTag; WORD wChannels; DWORDnSamplesPerSec; DWORD nAvgBytesPerSec; WORD nBlockAlign; WORDwBitsPerSample; WORD cbSize; }

17 Table ITEMWAVE TYPE WAVE DEFINITION 1Microsoft: unknown wave type WAVE_FORMAT_UNKNOWN 2Microsoft ADPCM wave typ WAVE_FORMAT_ADPCM 3Digispeech: CVSD wave type WAVE_FORMAT_IBM_CVSD 4Microsoft, digispeech:CCITT std. WAVE_FORMAT_ALAW 5Digispeech:OKI ADPCM wave type WAVE_FORMAT_OKI_ADPCM 6Intel: ADPCM wave type DVI_ADPCM 7digispeech wave type WAVE_FORMAT_DIGISTD 8Yamaha ADPCM wave type WAVE_FORMAT_YAMAHA_ADPCM 9Sound compreesion Sonarc type WAVE_FORMAT_SONARC 10Creative labs ADPCM WAVE_FORMAT_CREATIVE_ADPCM 11Dsp GROUP wave type WAVE_FORMAT_DSPGROUP 12Echo Speech wave type WAVE_FORMAT_ECHOSCI 13Audio File AF36 & AF10 WAVE_FORMAT_AUDIO_FILE_AF36 14Audio Processing Tech.WAVE_FORMAT_APTX 15Dolby Labs: Dolby-AC2 typeWAVE_FORMAT_DOLBY_AC2

18 Microsoft ADPCMWAVE file Typedef struct adpcmoef_tag { int iCoef1; int iCoef2; } typedef struct adpcmwaveformat_tag { EXTWAVEFORMATEXTewf; WORDnSamplesPerBlock; WORDnNumberCoef; ADPCMCOEFSETaCoeff[nNumCoef]; }ADPCMWAVEFORMAT;

19 WAVEFORMATEXT wFormatTagWAVE_FORMAT_ADPCM nChannelsNo. of channels in wave nSamplesPerSecFrequency of the sample rate nAvgBytesPerSecAvg. data rate nBlockAlignblock alignment of data in wbitsPerSampleNo. of bits per sample of ADPCM cbExtraSizesize in bytes of WAVE format chunk nSamplesPerBlockno. of samples per block nNumCoefNo. of coefficient sets in aCoef aCoefcoefficients used by wave

20 BLOCK It has 3 parts Header,data& padding typedef struct adpcmblockheader_tag { BYTEbpredictor[nChannels]; Int iDelta[nChannels]; Int iSamp1[nChannels]; Int iSamp2[nChannels]; }ADPBLOKHEADER; CCITT Standard Companded WAVE types Stores file-dependent info about the contents of Wave data Two types OF wFormatTag WAVE_FORMAT_ALAM (0X0006)USED IN U.S WAVE_FORMAT_MULAW(OX0007)USED IN EUROPE Note: Rest as in previous slide

21 DVI ADPCM WAVE DEFINED AS WAVE_FORMAT_DVI_ADPCM(OXOO11) STRUCTURE typedef struct dvi_adpcmwaveformat_tag{ WAVEFORMATEXT ewf; WORD wSamplesPerBlock; }DVIADPCMWAVEFORMAT; wFormatTag is WAVE_FORMAT_DVI_ADPCM.

22 BLOCK Block has 2 parts –Header –Data Header Typedef struct dvi_adpcmblockheader_tag{ Int iSamp0; BYTEbStepTableIndex; BYTE bReserved; }.DVI_ADPCMBLOCKHEADER;

23 Creative LabsADPCM Supports compression & decompression in real time Fact Chunk : wFormatTag is WAVE_FORMAT_CREATIVE_ADPCM(0X0200) Typedef struct creative_adpcmwaveformat_tag { WAVEFORMATEXT ewf; WORDwRevision; }CREATIVEHEADPCMWAVEFORMAT; wRevision-Revision of the algorithm

24 Dolby Labs AC-2 Wave Type Primarily used for music compression The wFormatType of the fact chunk is WAVE_FORMAT_DOLBY_AC2(0X0030) WAVEFORMATEXT STRUCTURE: nAuxBitsCode – Auxillary bits code indicating no. of aux bits per block codeno. of bits/block0 18 216 332

25 THANK YOU


Download ppt "TWAIN Open industry standard interface for the input devices to capture multimedia objects More and more sophisticated devies are developed to cater to."

Similar presentations


Ads by Google