Converting PCM data to a Movie

Discussion in 'Mac Programming' started by run2thesun, Nov 17, 2005.

  1. run2thesun macrumors newbie

    Nov 3, 2005

    I want to extract audio from a Movie and store it in another Movie.

    I have used MovieAudioExtractionFillBuffer to extract audio from a Movie. After I have stored the PCM data in a memory buffer, how can I make a new Movie out of this data? Thanks.
  2. run2thesun thread starter macrumors newbie

    Nov 3, 2005
    OK I've found a function that can do this: AddMediaSample2

    OSErr AddMediaSample2 (
    Media theMedia,
    const UInt8 *dataIn,
    ByteCount size,
    TimeValue64 decodeDurationPerSample,
    TimeValue64 displayOffset,
    SampleDescriptionHandle sampleDescriptionH,
    ItemCount numberOfSamples,
    MediaSampleFlags sampleFlags,
    TimeValue64 *sampleDecodeTimeOut );

    I have the sound data stored in two arrays (one for each channel). I need to send it in as the dataIn parameter. How can I do this? Do I send in a pointer to the sound data? Thanks.

Share This Page