[squeak-dev] The Inbox: Sound-tobe.67.mcz

Herbert König herbertkoenig at gmx.net
Fri Dec 27 10:10:11 UTC 2019



Am 27.12.2019 um 00:35 schrieb Levente Uzonyi:
> On Thu, 26 Dec 2019, Chris Muller wrote:
>
>> We do have variableDoubleWordSubclass:es now, is it possible and
>> would you be willing to make and instantiate a new kind of
>> SoundBuffer24 to represent them correctly?
>
> DoubleWord means 64-bit per slot, so it's an overkill, a WordArray,
> which has 32-bit per slot would be just fine.
> But I'd go for using FloatArrays as the generic sound buffers instead.
> Why?
> - FloatArrays use 32-bit per slot as well.
> - They can represent 16-bit and 24-bit wav files without loss.
> - Operations on them can keep 24 significant bits no matter what the
> actual magnitude is.
> - And, we have some primitives to do vector operations on them (see
> #*=, #+= and friends).
> So, while providing better quality than the current (simulated) 16-bit
> buffers, FloatArrays could give us better performance as well.
> I think we don't have primitives to convert them back to 16-bit for
> playback yet, but it wouldn't be too hard to add such primitive(s).
> Alternatively, a primitive to downsample a FloatArray into a
> SoundBuffer could be added.

+1

Herbert


More information about the Squeak-dev mailing list