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

implement audio reciever [beta] #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kylerifqi
Copy link

i implemented the discord/voice code into the streamer. it can be used the same way discord/voice would be used, but not exactly the same. im not entirely sure this works as i have not done any extensive tests but it worked well for me.

i also added an example to show how to use the new reciever addition, but a tlrdr is that you basically use it by

const stream = streamer.voiceConnection.reciever.subscribe(USER_ID)
// do something with the OPUS stream

i added a set voice state fn that should not change how anything already written using this library will run:

Streamer.setVoiceState(guild_id, channel_id, { self_mute, self_deaf, self_video })
// to change mute, deafen, or video state
// note: any of self_mute, self_deaf and self_video, can be omitted and the last set state will be used.

my code editor formatted my files a little so it changed the position of the imports and removed some spaces and i dont really know how to make it not do that. it might be beneficial to add a linter like eslint or something since the files dont really have a uniform format and the tab and spaces do be coexisting with each other.

this is my first time making a PR so my bad if i messed anything up. please give feedback and i will change whatever necessary.

@kylerifqi
Copy link
Author

this is by no means finished, i did make this implementation in a day so there may be a few bugs i havent noticed.

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

Successfully merging this pull request may close these issues.

1 participant