Skip to content

Feature: Add passing pyglet encoders and/or automatic Ogg support #2049

@pushfoo

Description

@pushfoo

Enhancement request:

TL;DR: @DigiDuncan pointed out we can't really load .ogg through arcade

What should be added/changed?

  1. Add a way to pass a decoder supported by pyglet's media.load function
  2. (Optional / risky) Smart and helpful pyogg / PyOggDecoder warnings

What would passing in a decoder would it help with?

Improve arcade user experience by allowing sound loading to:

  1. take specific decoders such as pyglet's PyOggDecoder
  2. avoid subclassing Sound as in Charm's current code
  3. without having to file tickets for new formats (example: QOA)

Changes needed:

  1. Add a decoder keyword argument to arcade.sound.Sound.__init__
  2. Add a temp Decoder protocol to annotate it before upstreaming matching pyglet's codecs Use the existing MediaDecoder type
  3. Document the change
  4. Update the sound page in the programming guide

Follow-up Work

  1. Add an example
  2. Make upstream pyglet PRs to help with pyglet needs a full docstring review and cleanup pyglet/pyglet#1084:
    1. Define a Decoder Protocol type matching pyglet's pyglet's codecs
    2. Add argument and return annotations to the codecs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions