Docs: Clarity on default values for playdate.sound.fileplayer.new(...)

In the SDK, the function call for playdate.sound.fileplayer.new(..) does not state what the buffersize defaults to if not specified.

The nearest thing to this is that in the description for playdate.sound.fileplayer:play(...) it mentions "creating and filling a 1/4 second playback buffer if a buffer size hasn’t been set yet". If this is in fact the default, it would be nice to have it stated in the description of new()... ie:

If given, buffersize specifies the size in seconds of the fileplayer’s data buffer, or else an 0.25 second buffer will be used.

This sounds like a good improvement. Thanks for the suggestion!

1 Like

This would apply to other functions where there's an optional argument for a value, where there is a default value used, namely:

  • playdate.graphics.setDitherPattern
  • playdate.graphics.perlin (octave/persistence used if not specified)
  • playdate.graphics.perlinArray
  • playdate.graphics.drawSineWave (I assume the offset is 0?)
  • playdate.graphics.animation.loop.new() (doesn't say what omitting imageTable does)
  • playdate.graphics.animator.new (default easing function?)

(some others, possibly... I just searched the doc for ", [" :wink:

Most of the functions in the doc already have defaults in place... eg: playdate.graphics.sprite:setStencilPattern(), playdate.datastore.write() and the playdate.file functions, or the meaning is obvious in context ('flip', and 'tile' for example)

1 Like