Skip to content
This repository was archived by the owner on Jul 12, 2023. It is now read-only.

feat(AudioResource): add encoder property, fix type for metadata#110

Merged
amishshah merged 7 commits into
mainfrom
feat/small-fixes
Jun 9, 2021
Merged

feat(AudioResource): add encoder property, fix type for metadata#110
amishshah merged 7 commits into
mainfrom
feat/small-fixes

Conversation

@amishshah
Copy link
Copy Markdown
Member

@amishshah amishshah commented Jun 9, 2021

Please describe the changes this PR makes and why it should be merged:

This adds the optional encoder property to an AudioResource, so you could do this for example:

resource.encoder?.setBitrate(48000);

Also simplifies the constructor of AudioResource, as well as fixes the metadata typings. Previously, this was an issue:

(resource as AudioResource<MyMetadata>).metadata // type of MyMetadata|undefined

Even though the AudioResource is given a type, metadata was incorrectly optional. This is now fixed.

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • This PR changes the library's interface (methods or parameters added)

@amishshah amishshah requested review from Gawdl3y, SpaceEEC, iCrawl, kyranet and vladfrangu and removed request for Gawdl3y June 9, 2021 08:49
@amishshah amishshah changed the title feat(AudioResource): add encoder property and simplify constructor feat(AudioResource): add encoder property, fix type for metadata Jun 9, 2021
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 9, 2021

Codecov Report

Merging #110 (9c9e8a4) into main (fe3627c) will increase coverage by 0.08%.
The diff coverage is 88.88%.

❗ Current head 9c9e8a4 differs from pull request most recent head 37baa3c. Consider uploading reports for the commit 37baa3c to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main     #110      +/-   ##
==========================================
+ Coverage   63.46%   63.55%   +0.08%     
==========================================
  Files          18       18              
  Lines         813      815       +2     
  Branches      191      193       +2     
==========================================
+ Hits          516      518       +2     
  Misses        295      295              
  Partials        2        2              
Impacted Files Coverage Δ
src/audio/AudioResource.ts 95.55% <88.88%> (+0.20%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fe3627c...37baa3c. Read the comment docs.

Comment thread src/audio/__tests__/AudioPlayer.test.ts Outdated
@amishshah amishshah merged commit 3ff2983 into main Jun 9, 2021
@amishshah amishshah deleted the feat/small-fixes branch June 9, 2021 09:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants