Skip to content

"Expected 1 channels in audio block, got 2" when encoding a sample #24

Answered by AlexTMjugador
Niedzwiedzw asked this question in Q&A
Discussion options

You must be logged in to vote

I'm happy to hear you've figured out a solution to your problem!

As you may have already noticed, vorbis_rs, like the C APIs it wraps and as stated in its documentation, expects audio sample blocks to be provided in planar format, which means the samples are structured as an array of arrays: the outer array represents the channels, and each inner array contains the consecutive samples for a channel.

For instance, [[a, b, c], [d, e, f]] would be a representation of a planar audio sample buffer for two channels, where the first channel would have samples [a, b, c], and the second channel samples [d, e, f].

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by AlexTMjugador
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #23 on January 17, 2025 10:28.