Copy link to clipboard
Copied
I am currently writing an Output aex plugin. It already works with outputting videos (AddFrame) but how do i get the sound samples?
A_Err (*AEIO_AddSoundChunk)(
AEIO_BasicData *basic_dataP,
AEIO_OutSpecH outH,
const A_Time *start,
A_u_long num_samplesLu,
const void *dataPV);
How do I get the samples?
Thank you.
P.S.: The function has a different signature in the header file than in the PDF. Am I missing something?
the sound samples are in "dataPV" and there will be "num_samplesLu" starting at time "start".
you can use AEGP_GetOutSpecSoundSampleSize, AEGP_GetOutSpecSoundChannels, and AEGP_GetOutSpecSoundEncoding with outH to get the bytes per sample, number of channels, and the format the samples are in. the samples will be interleaved.
Copy link to clipboard
Copied
I bet the sample data is in dataPV. But how in what format / structure? Anybody?
Copy link to clipboard
Copied
Check the file SDK_Backwards.cpp in the included SDK examples, it is a good starting point on how to check out audio tracks, modify/process them and write them back.
Copy link to clipboard
Copied
Thanks, but the thing is that the samples are stored in:
const void *dataPV
is of type "const void*". I need to know what I need to cast it to.
Copy link to clipboard
Copied
Yes, this area is undocumented and the current headers are inconsistent (e.g. using the undefiend AEIO_SndWorldH handle). You might try just dumping the data and opening it with an audio editor to see if it is always a certain raw format or actually the compressed audio stream according to the project/export settings. Probably only Adobe can help you here...
Copy link to clipboard
Copied
Adobe admitted on twitter the documentation needs to be corrected.
I guess the data might be different depending on the number of channels, sample format,... that's why it could be a void*. But it could be just anything. Is it packed or planar?
Yes, only Adobe can help here. Everything else is just guessing.
Copy link to clipboard
Copied
I assume that the intended method was to provide a handle "AEIO_SndWorldH" in the interface that actually points to a AEIO_SndWorld structure which has more detailed description of the current format, just like with pixel data. However this neither seems to be implemented nor documented (yet).
Copy link to clipboard
Copied
the sound samples are in "dataPV" and there will be "num_samplesLu" starting at time "start".
you can use AEGP_GetOutSpecSoundSampleSize, AEGP_GetOutSpecSoundChannels, and AEGP_GetOutSpecSoundEncoding with outH to get the bytes per sample, number of channels, and the format the samples are in. the samples will be interleaved.
Copy link to clipboard
Copied
I got it working. Thank you.
Copy link to clipboard
Copied
Helpful info. Thanks.