Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do less things: remove base64 stuff #40

Open
jimmywarting opened this issue Jul 24, 2023 · 0 comments
Open

Do less things: remove base64 stuff #40

jimmywarting opened this issue Jul 24, 2023 · 0 comments

Comments

@jimmywarting
Copy link

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant