2 Replies Latest reply on Jun 5, 2017 11:45 AM by awgovers

    Premiere Pro SDK Audio Buffers

    awgovers Level 1

      Hi all! I'm trying to work with my audio channels and buffers using the PrSDKAudioSuite, which tells me this:


      // All audio calls to and from Premiere use arrays of buffers of 32-bit
      // floats to pass audio. Therefore all audio is not interleaved by channel.
      // So stereo audio looks like this:
      // float* audio[2];
      // where audio[0] is the address of a buffer N samples long and audio[1]
      // is the address of a second buffer N samples long. audio[0] contains
      // the left channel and audio[1] contains the right channel. N is called
      // the number of "sample frames" in the buffer. N will be the same no matter
      // how many channels of audio are present in the buffer.
      // Because we use 32-bit floats for each audio sample, we can represent
      // values above 0 dB during mixing. 0 dB corresponds to +/- 1.0 in the floating
      // point. For symmetry in the int <--> float conversions, it is recommended
      // you use the utility functions below.  For example if you want to convert
      // a single float to a 16-bit signed int, use ConvertAndInterleaveTo16BitInteger()
      // with 1 channel and one sample frame.


      I do have the buffers as the float, but they all seem to stay NULL. Is there something i'm missing or doing wrong? Hope somebody can point me into the right direction.


      Thank you,

        • 1. Re: Premiere Pro SDK Audio Buffers
          Zac Lam Adobe Employee

          Hi Bas,


          Are you developing an exporter?  What does your timeline look like?  Code snippets?

          • 2. Re: Premiere Pro SDK Audio Buffers
            awgovers Level 1

            Hi Zac, thanks for your reply!


            We're working on a transmitter actually, and we started working from the provided Transmitter Example. Various data is being sent to the hardware device we're working on, like the project- and sequence settings for example. We're not sending actual video frames.


            The timeline is pretty basic and for testing purposes only: a layer of video and a stereo audio track.


            As for the code snippets, we started out with the provided example which creates the buffers here



            for (int i = 0; i < AUDIO_BUFFER_MAX_CHANNELS; i++) {      mAudioBuffers[i] = new float[AUDIO_BUFFER_SIZE]; }


            This should create the buffers of 32-bit floats we're looking for as stated in PrSDKAudioSuite.h. We've acquired the PrSDKAudioSuite to interleave the data but the floats in mAudioBuffers don't seem to update when the playhead is moving and all float data stays at 0. I'm also trying to use the getAudio in PrSDKSequenceAudioSuite.h but i can't quite seem to get it to work.



            // Audio is returned as arrays of uninterleaved floats. InBuffer must point to n buffers of floats   // inFrameCount long, where n is the number of channels. This always returns the next contiguous   // chunk of audio sample frames.   prSuiteError (*GetAudio)(   csSDK_uint32 inAudioRenderID,   csSDK_uint32 inFrameCount,   float** inBuffer,   char inClipAudio);


            I hope this helps, hopefully i'm overlooking something.


            Thanks again,