Sometimes a film project is not continuous in timeline.
It’s divided into 5~6 sections, each with an IN point and an OUT point, meaning where a section starts and ends. The length of each section is not necessarily the same, and the space between last OUT and next IN is blank.
But JUCE audio plugins are based on blocks, 1024 for example, meaning the ends of audio and video are hardly the same, because the length of audio data in samples must be multiple of 1024…So If we include all video frames, the corresponding audio data have to be a bit longer, including some invalid data.
I’m doing some encoding work, so I want all valid audio data to be continuous.
Encoding is based on blocks and need valid data only, but the data in DAW go strictly with timeline, regardless of whether a sections ends or whether there’s a blank data.
For example, Section 1 ends at Sample 480,000(not multiple of 1024) and Section 2 starts at Sample 1,024,010(not multiple of 1024)
- The plugin will get 479,232~480,256(both multiple of 1024), and the last 256 samples are invalid…
- The plugin will continue getting data between Section 1 and Section 2, but all invalid.
- The audio data is not valid until the frame including the beginning of Section 2. This time the plugin get 1,024,000~1,025,024. The first 10 samples are invalid.
So the neighboring 2 audio frames will be [479,232~480,256][1,024,000~1,025,024], but actually I want all the data to be valid, namely [479,232~480,000 + 1,024,010~1,024,266](1024 total).
So is there a way to make audio data continuous when the project is divided? e.g. Can a JUCE plugin know where a section starts and ends(like getting the position of IN and OUT)?