Skip to content

Do less things: remove base64 stuff #40

Description

@jimmywarting

You got a couple of ways to load wav files...

  • fromBase64
  • fromDataURI
  • fromBuffer

and also exporting them:

  • toBuffer
  • toBase64
  • toDataURI

Base64 isn't a good container cuz it takes up way more space, a Uint8Array is way better.

  • if the intention is to play something in a <audio src=""> element then it's better to create a Object URL from a blob
  • if the intention is to upload stuff via a api using json, then don't there are better ways to send of binary data + json

encourage base64 today isn't so good.
it's better to just have one way to solve it so that less code can be shipped and bundled.

also don't know how i feel about the name toBuffer and fromBuffer the name mostly implies that it is dealing with NodeJS buffers. how about to/fromUint8array ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions