Embedded Audio Media

 

MaxOmdSdk is designed to handle interchange of Omfs with embedded audio media. MaxOmfSdk can read and write standard AIFF or WAVE files for purposes of supporting client applications which maintain audio media in these formats.

 

MaxOmfSdk can :

 

* Read audio media which is embedded is a composition Omf.

* Read audio media which is embedded in a single audio media Omf

* Read audio media from external AIFF and WAVE files

* Write audio media to external AIFF and WAVE files

* Write embedded audio media into composition Omf files

 

MaxOmfSdk can handle 16 bit 44100 and 48000 sample rates. It can byteswap audio media samples to convert between AIFF (Macintosh big endian) and WAVE (Intel little endian).

 

MaxOmfSdk cannot do bit depth or sample rate conversion.

 

MaxOmfSdk is 'frame based', not sample based. Avid Omfs are frame based. Omfs from ProTools can be either sample based or frame based, and MaxOmfSdk can handle only frame based ProTools Omf files, that is, Omfs exported from Protools with the "Avid Compatible" user selection enabled.

 

Importing Embedded Omf Audio Media

 

On input (mxOmfOpenOmf(), mxOmfParseOmf(), and mxOmfCompleteOmf()), MaxOmfSdk parses an Omf's metadata into internal memory resident data structures but does not load the audio media itself - instead, it retains pointers to the media in the (open) Omf file. Thus MaxOmfSdk can access to the media data to copy it to another Omf or to an external audio media file.

 

When the Omf contains embedded audio media, mxOmfInSettings_t::m_bIsMediaAudioPresent will be set TRUE, and mxOmfInSettings_t::m_eAudioSampleRate will signal its samplerate. See the Omf In Dialog (COmfInDlg) of the demo for examples how to use these flags.

 

With the Omf open and pointers to the audio media available you have three options -

* embed (copy) the media into a new Omf file

* copy the media to external AIFF or WAVE files

* ignore the media

 

Audio media transfer is handled by creating an internal list of media objects during the traversal of the internal data and then initiating the actual transfer to the designated destination.

 

In the case of importing Omf and audio media to a client application you obtain the edit data (composition and clip metadata) by traversing the internal SDK data as demonstrated in CMaxOmfSdkDemoDoc::OnOpenDocument().

 

During this traversal, you call mxOmfAudioTransferListAppendUnique() to queue up a an audio media object for transfer. mxOmfAudioTransferListAppendUnique() takes several parameters to designate the destination, format, etc. For example, you can select MXOMF_MEDIAFORMAT_OUT_RAW_WAVE with a pre-built path for each WAVE file.

 

When the traversal is completed, a call to mxOmfTransferAllAudio() initiates the transfer of all the audio in the internal list to the designated destination.

 

In the case of exporting previously imported Omf audio data to a new Omf, that is, with SaveAs, this transfer mechanism is used automatically by mxOmfMakeOmf() when mxOmfOutSettings_t::BOOL m_bIncludeAudioMedia is set (selected) TRUE.

 

Exporting Audio Media to an Omf

 

To export audio media from a client application you must first map your edit data to MaxOmfSdk internal data as shown in CMaxOmfSdkDemoDoc::OnExportMyDataAsOmf(). During the iteration through your data, call mxOmfAudioTransferListAppendUnique(), handing it, for example, MXOMF_MEDIAFORMAT_OUT_RAW_WAVE, and the path to each audio file. When mxOmfMakeOmf() finally called, the audio is transferred from the designated files into the Omf.