xtra AVMedia -- v0.30 (c) 2017 Valentin Schmidt -- CONSTRUCTOR new object me -- AUDIO audioOpen object me, any pathOrURLOrData, *allowRateChange, fileTypeHint audioClose object me audioPlay object me audioPause object me audioGetDuration object me audioGetCurrentTime object me audioSetCurrentTime object me, float timeSec audioGetPan object me audioSetPan object me, float pan audioGetRate object me audioSetRate object me, float rate audioGetVolume object me audioSetVolume object me, float volume audioFileConvert object me, any inputFile, string outputFile, string outputFileType, string outputFormat, float outputSampleRate, *floatStartTimeSec, floatStopTimeSec -- VIDEO videoOpen object me, string pathOrURL, object rect, *stayOnTop, windowMask, overlayFlag, windowTitle videoClose object me -- get parameters videoGetCurrentTime object me, *timeScale videoGetDuration object me videoGetFPS object me videoGetImage object me, *timeMS -- returns image as bytearray with JPG data videoGetNaturalSize object me videoGetRate object me videoGetReadyForDisplay object me videoGetRect object me videoGetTimeScale object me videoGetTrackList object me videoGetVolume object me -- set parameter videoSetCurrentTime object me, integer timeMS, *timeScale, zeroToleranceBefore, zeroToleranceAfter videoSetLoop object me, integer loopFlag videoSetOverlay object me, any overlayImageOrFile videoSetOverlayVisibility object me, integer visibilityFlag videoSetParentWindow object me, integer movieNum videoSetRate object me, float rate, *time, atHostTime, timeScale videoSetRect object me, object rect videoSetTrackEnabled object me, integer trackNum, integer enabledFlag videoSetVolume object me, float volume videoSetWindowOrder object me, integer movieNum, integer orderingMode videoStepByCount object me, integer stepCount videoSyncToAudio object me videoToggleFullScreen object me -- set callbacks videoSetDoubleClickCallback object me, *cbHandler, cbTarget videoSetMouseDownCallback object me, *cbHandler, cbTarget videoSetReadyStatusChangeCallback object me, *cbHandler, cbTarget videoSetWindowClosedCallback object me, *cbHandler, cbTarget -- conversion videoFileConvert object me, any inputFile, string outputFile, string preset, *intStartTimeMS, intStopTimeMS videoSetFileConvertCallback object me, *cbHandler, cbTarget STRING CONSTANTS ================ 1.) Audio Conversion: File Types (=container formats) Supported 4-letter-strings for parameter 'outputFileType' of function audioFileConvert() (in OS X 10.11 El Capitan, other OS versions might differ). Notice: case sensitive! - kAudioFileAIFFType = "AIFF" - kAudioFileAIFCType = "AIFC" - kAudioFileWAVEType = "WAVE" - kAudioFileSoundDesigner2Type = "Sd2f" - kAudioFileNextType = "NeXT" - kAudioFileMP3Type = "MPG3" // mpeg layer 3 - kAudioFileMP2Type = "MPG2" // mpeg layer 2 - kAudioFileMP1Type = "MPG1" // mpeg layer 1 - kAudioFileAC3Type = "ac-3" - kAudioFileAAC_ADTSType = "adts" - kAudioFileMPEG4Type = "mp4f" - kAudioFileM4AType = "m4af" // aac - kAudioFileM4BType = "m4bf" - kAudioFileCAFType = "caff" - kAudioFile3GPType = "3gpp" - kAudioFile3GP2Type = "3gp2" - kAudioFileAMRType = "amrf" 2.) Audio Conversion: File Formats (=encoding formats) Supported 4-letter-strings for parameter 'outputFormat' of function audioFileConvert() (in OS X 10.11 El Capitan, other OS versions might differ). Notice: case sensitive! Notice 2: file type (container) and file format (encoding) must fit together, each container only supports a specific subset of the available encodings. E.g. to convert to an uncompressed WAV file, specify "WAVE" as 'outputFileType' parameter and "lpcm" as 'outputFormat'. - kAudioFormatLinearPCM = "lpcm" - kAudioFormatAC3 = "ac-3" - kAudioFormat60958AC3 = "cac3" - kAudioFormatAppleIMA4 = "ima4" - kAudioFormatMPEG4AAC = "aac " - kAudioFormatMPEG4CELP = "celp" - kAudioFormatMPEG4HVXC = "hvxc" - kAudioFormatMPEG4TwinVQ = "twvq" - kAudioFormatMACE3 = "MAC3" - kAudioFormatMACE6 = "MAC6" - kAudioFormatULaw = "ulaw" - kAudioFormatALaw = "alaw" - kAudioFormatQDesign = "QDMC" - kAudioFormatQDesign2 = "QDM2" - kAudioFormatQUALCOMM = "Qclp" - kAudioFormatMPEGLayer1 = ".mp1" - kAudioFormatMPEGLayer2 = ".mp2" - kAudioFormatMPEGLayer3 = ".mp3" - kAudioFormatTimeCode = "time" - kAudioFormatMIDIStream = "midi" - kAudioFormatParameterValueStream = "apvs" - kAudioFormatAppleLossless = "alac" - kAudioFormatMPEG4AAC_HE = "aach" - kAudioFormatMPEG4AAC_LD = "aacl" - kAudioFormatMPEG4AAC_ELD = "aace" - kAudioFormatMPEG4AAC_ELD_SBR = "aacf" - kAudioFormatMPEG4AAC_ELD_V2 = "aacg" - kAudioFormatMPEG4AAC_HE_V2 = "aacp" - kAudioFormatMPEG4AAC_Spatial = "aacs" - kAudioFormatAMR = "samr" - kAudioFormatAMR_WB = "sawb" - kAudioFormatAudible = "AUDB" - kAudioFormatiLBC = "ilbc" //- kAudioFormatDVIIntelIMA = 0x6D730011 //- kAudioFormatMicrosoftGSM = 0x6D730031 - kAudioFormatAES3 = "aes3" - kAudioFormatEnhancedAC3 = "ec-3" 3.) Video Conversion: Presets Supported strings for parameter 'preset' of function videoFileConvert() (in OS X 10.11 El Capitan, other OS versions might differ). - "AVAssetExportPresetAppleM4VAppleTV" - "AVAssetExportPresetMediumQuality" - "AVAssetExportPreset640x480" - "AVAssetExportPresetAppleM4V1080pHD" - "AVAssetExportPresetHighestQuality" - "AVAssetExportPresetAppleM4VWiFi" - "AVAssetExportPresetLowQuality_16x9" - "AVAssetExportPresetAppleM4ViPod" - "AVAssetExportPresetAppleProRes422LPCM" - "AVAssetExportPresetAppleM4V480pSD" - "AVAssetExportPresetAppleM4V720pHD" - "AVAssetExportPreset960x540" - "AVAssetExportPreset3840x2160" - "AVAssetExportPreset1280x720" - "AVAssetExportPreset1920x1080" - "AVAssetExportPresetLowQuality" - "AVAssetExportPresetAppleM4VCellular" - "AVAssetExportPresetAppleM4A" - "AVAssetExportPresetMediumQuality_16x9" 4.) File Format UTIs Supported strings for optional parameter 'fileTypeHint' of function audioOpen(). E.g. for MP3 data passed as bytearray, you would specify "public.mp3". If you don't specify such 'fileTypeHint 'string, the system tries to detect the format (which usually works fine as well). - "com.apple.quicktime-movie" UTI for the QuickTime movie file format. Files are identified with the .mov and .qt extensions. Supported since OS X 10.7 - "public.mpeg-4" UTI for the MPEG-4 file format. Files are identified with the .mp4 extension. Supported since OS X 10.7 - "com.apple.m4v-video" Files are identified with the .m4v extension. Supported since OS X 10.7 - "com.apple.m4a-audio" Files are identified with the .m4a extension. Supported since OS X 10.7 - "public.3gpp" UTI for the 3GPP file format. Files are identified with the .3gp, .3gpp, and .sdv extensions. Supported since OS X 10.11 - "public.3gpp2" UTI for the 3GPP file format. Files are identified with the .3g2, .3gp2 extensions. Supported since OS X 10.11 - "com.apple.coreaudio-format" UTI for the CoreAudio file format. Files are identified with the .caf extension. Supported since OS X 10.7 - "com.microsoft.waveform-audio" UTI for the WAVE audio file format. Files are identified with the .wav, .wave, and .bwf extensions. Supported since OS X 10.7 - "public.aiff-audio" UTI for the AIFF audio file format. Files are identified with the .aif and .aiff extensions. Supported since OS X 10.7 - "public.aifc-audio" UTI for the AIFC audio file format. Files are identified with the .aifc and .cdda extensions. Supported since OS X 10.7 - "org.3gpp.adaptive-multi-rate-audio" UTI for the adaptive multi-rate audio file format. Files are identified with the .amr extension. Supported since OS X 10.7 - "public.mp3" UTI for the MPEG layer 3 audio file format. Files are identified with the .mp3 extension. Supported since OS X 10.9 - "public.au-audio" UTI for the Sun/NeXT audio file format. Files are identified with the .au and .snd extensions. Supported since OS X 10.9 - "public.ac3-audio" UTI for the AC-3 audio file format. Files are identified with the .ac3 extension. Supported since OS X 10.9 - "public.enhanced-ac3-audio" UTI for the enhanced AC-3 audio file format. Files are identified with the .eac3 extension. Supported since OS X 10.11 - "com.apple.streamingkeydelivery.contentkey" UTI for streaming key delivery content keys Supported since OS X 10.11 - "com.apple.streamingkeydelivery.persistentcontentkey" UTI for persistent streaming key delivery content keys Supported since OS X 10.11