Highlighted

How to get sound samples?

Explorer ,
Jun 05, 2019

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.

TOPICS
SDK

Views

698

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

How to get sound samples?

Explorer ,
Jun 05, 2019

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.

TOPICS
SDK

Views

699

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jun 05, 2019 0
Explorer ,
Jul 04, 2019

Copy link to clipboard

Copied

I bet the sample data is in dataPV. But how in what format / structure? Anybody?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 04, 2019 0
Avatar
Jul 05, 2019

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 05, 2019 0
Explorer ,
Jul 05, 2019

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 05, 2019 0
Avatar
Jul 08, 2019

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...

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 08, 2019 0
Explorer ,
Jul 08, 2019

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 08, 2019 0
Avatar
Jul 08, 2019

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).

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 08, 2019 0
Explorer ,
Aug 08, 2019

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 08, 2019 0
Explorer ,
Aug 11, 2019

Copy link to clipboard

Copied

I got it working. Thank you.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 11, 2019 0
zcream LATEST
Explorer ,
Oct 02, 2020

Copy link to clipboard

Copied

Helpful info. Thanks.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 02, 2020 0