Re: can we change the block size?

On Mon, Dec 31, 2012 at 2:00 PM, Robert O'Callahan <robert@ocallahan.org>wrote:

> On Tue, Jan 1, 2013 at 12:11 AM, Robert O'Callahan <robert@ocallahan.org>wrote:
>
>> The spec requires block processing with 128 sample-frames per block. This
>> can be a bit inconvenient when interfacing with other code. For example,
>> the code at http://www.webrtc.org/ wants to capture, send and receive
>> audio in chunks of exactly 10ms. So when using Web Audio with that WebRTC
>> code, it would be nice to have 10ms be a whole number of Web Audio blocks.
>> Unfortunately that means choosing a sample rate which is a multiple of
>> 128*100, which common sample rates aren't.
>>
>
> Actually we can deal with this in other ways, so it's not that important.
> But I'm still curious what the requirements are around the block size.
>

We decided to settle on a standard block-size so we can get more uniform
behavior across implementations.  To some extent the exact block-size is
arbitrary, but it's good to have a size which is not too small and not too
large.  Smaller buffer sizes can give better results with k-rate parameters
and can potentially help improve latency, but very small sizes are less
efficient.  It also helps if it's a power-of-two because some of the
algorithms use FFTs which are based on power-of-two sizes, and the
buffering works out easier this way.  Power-of-two sizes have been
traditionally used in computer music systems.  For example, I believe Pure
Data and SuperCollider use a block-size of 64.  128 is also a reasonable
choice, which is what we have right now.  If we wanted to get really fancy,
we could have this size be settable when the context is setup, but I don't
think we need to worry about that at this stage.



>
> Thanks,
> Rob
> --
> Jesus called them together and said, “You know that the rulers of the
> Gentiles lord it over them, and their high officials exercise authority
> over them. Not so with you. Instead, whoever wants to become great among
> you must be your servant, and whoever wants to be first must be your
> slave — just as the Son of Man did not come to be served, but to serve,
> and to give his life as a ransom for many.” [Matthew 20:25-28]
>

Received on Wednesday, 2 January 2013 20:40:27 UTC