andersfylling / disgord

Go module for interacting with the documented Discord's bot interface; Gateway, REST requests and voice
BSD 3-Clause "New" or "Revised" License
496 stars 70 forks source link

Easy way to play audio through Voice #392

Closed ThallesP closed 3 years ago

ThallesP commented 3 years ago

Is your feature request related to a problem? Please describe. There isn't any easy way to play audio (not in the docs), this feature will be more easily for new users of the library.

Describe the solution you'd like A function in VoiceConnection to play audio. For example PlayFile("./testsound.mp3", VoiceConnection or guildID) And, if possible pause(VoiceConnection or guildID) and resume(VoiceConnection or guildID)

Describe alternatives you've considered - optional I'm planning to do this feature with this library https://github.com/jonas747/dca which requires FFmpeg, it seems to work great, If you have any other way let me know. I will try to implement this feature in a pull request If you approve.

post04 commented 3 years ago

Why just mp3? I feel like PlayFile shouldn't be limited to just mp3's based on the name. Maybe if you only want to play mp3's the func name should be PlayMP3? I only say that because mp4's as well as sound that can be played, so do plenty more of file types.

ThallesP commented 3 years ago

Why just mp3? I feel like PlayFile shouldn't be limited to just mp3's based on the name. Maybe if you only want to play mp3's the func name should be PlayMP3? I only say that because mp4's as well as sound that can be played, so do plenty more of file types.

I'm planning to do that in the future, I'll see If the library that I'll use will support other file types or maybe I can convert it to MP3 and then pipe it to the library.

ThallesP commented 3 years ago

Just updated the title to not exclusive limit the audio to .mp3 format

andersfylling commented 3 years ago

I think that it is better to recommend a library for dca convertion in the documentation instead of including one in disgord. Less to maintain, and users only have to do call another function which sounds like a win to me.

There is ofc other concerns for why I don't want to put it into Disgord; such as bugs for specific versions, which audio formats should then be supported and on it goes.

On Sun, 2 May 2021, 23:43 Thalles Passos, @.***> wrote:

Why just mp3? I feel like PlayFile shouldn't be limited to just mp3's based on the name. Maybe if you only want to play mp3's the func name should be PlayMP3? I only say that because mp4's as well as sound that can be played, so do plenty more of file types.

I'm planning to do that in the future, I'll see If the library that I'll use will support other file types or maybe I can convert it to MP3 and then pipe it to the library.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/andersfylling/disgord/issues/392#issuecomment-830876824, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB346VAB2LGS5WI3ZQ35MLLTLXBNPANCNFSM437XR4JA .

ThallesP commented 3 years ago

I was thinking of having an own implemention of dca in Disgord and include the PlayFile with that implemention but is unnecessary and complicated to do.

I'll agree with Anders maybe can be recommend the library that I mentioned or the bwmarrin dca implemention.

The library that I mentioned use discordgo as a dependency which seems unnecessary to download whole library to only convert to dca.

On Sun, May 2, 2021, 7:30 PM Anders Øen Fylling @.***> wrote:

I think that it is better to recommend a library for dca convertion in the documentation instead of including one in disgord. Less to maintain, and users only have to do call another function which sounds like a win to me.

There is ofc other concerns such as bugs for specific versions, which audio formats should then be supported and on it goes.

On Sun, 2 May 2021, 23:43 Thalles Passos, @.***> wrote:

Why just mp3? I feel like PlayFile shouldn't be limited to just mp3's based on the name. Maybe if you only want to play mp3's the func name should be PlayMP3? I only say that because mp4's as well as sound that can be played, so do plenty more of file types.

I'm planning to do that in the future, I'll see If the library that I'll use will support other file types or maybe I can convert it to MP3 and then pipe it to the library.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub < https://github.com/andersfylling/disgord/issues/392#issuecomment-830876824 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AB346VAB2LGS5WI3ZQ35MLLTLXBNPANCNFSM437XR4JA

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/andersfylling/disgord/issues/392#issuecomment-830917153, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASD652GVTW6ELIJCRNKPRCDTLXHAHANCNFSM437XR4JA .

andersfylling commented 3 years ago

I'm closing this for now. Feel free to create a PR for recommending dca projects.