Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Someone help me with this: How to change audio export settings?



Hi All,

I want to know how to pro grammatically change the export settings for Sound.

I have seen code like this for video but do not know how I can do the same with audio.

I want to be able to change the output sampling frequency and number of channels while exporting to uncompressed WAV file.

Any help will be very much appreciated

MovieExportComponent movieExporter = NULL;
QTAtomContainer      exportSettings = NULL;
QTAtom               videAtom = 0,sptlAtom = 0;
SCSpatialSettings    spatialSetting;
OSErr                err = noErr;

    // Open the AVI 'spit' component
    err = OpenADefaultComponent(MovieExportType, kQTFileTypeAVI, &movieExporter);
    if (err || !movieExporter) goto bail;

    // Get the default settings
    err = MovieExportGetSettingsAsAtomContainer(movieExporter, &exportSettings);
    if (err) goto bail;

    // Find the 'vide' Atom which contains the spatial settings
    videAtom = QTFindChildByID(exportSettings, kParentAtomIsContainer,
                               kQTSettingsVideo,
                               1, NULL);
    if (0 == videAtom) { err = cannotFindAtomErr; goto bail; }

    // Find the 'sptl' Atom - Spatial Settings
    sptlAtom = QTFindChildByID(exportSettings, videAtom,
                               scSpatialSettingsType,
                               1, NULL);
    if (0 == sptlAtom) { err = cannotFindAtomErr; goto bail; }

    // Set up our settings
    spatialSetting.codecType = EndianU32_NtoB(kIndeo4CodecType); // or kWindowsRawCodecType
    spatialSetting.codec = 0;
    spatialSetting.depth = EndianU16_NtoB(24);
    spatialSetting.spatialQuality = EndianU32_NtoB(codecLosslessQuality);

For Audio:
 

OpenADefaultComponent(MovieExportType, kQTFileTypeWave, xAudioMovieExportComponent);

MovieExportGetSettingsAsAtomContainer(*xAudioMovieExportComponent, &xExportSettings);

xSoundAtom = QTFindChildByID(xExportSettings, kParentAtomIsContainer,kQTSettingsSound,

1, NULL);

and then ....................... Donnnnnnnnnnnnooo

Many Thanks.

/anita

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-api/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.