Skip to content
This repository has been archived by the owner on Jan 20, 2021. It is now read-only.

Download the next song in advance #113

Open
hpincket opened this issue Jan 15, 2016 · 3 comments
Open

Download the next song in advance #113

hpincket opened this issue Jan 15, 2016 · 3 comments

Comments

@hpincket
Copy link

Hey there,

First, this is awesome. Second, I'm working on making a mumbledjkhaled bot which overlays a soundclip of "DJ KHALED!!" over some songs. Right now I've gotten it to work by adding code to the Download() function. Unfortunately this causes a delay while the audio is processed. I think the solution is to start downloading/processing the next song ahead of time.

Do you have any recommendations on where/how to implement this? This is my first time working with Go, so I don't have a super clear understanding of the code base.

Thanks,
Hpincket

@hpincket
Copy link
Author

Actually it might be better to add the "DJ KHALED" shoutout before the song, then I don't have to do any audio encoding.

@matthieugrieger
Copy link
Owner

This is something that has been requested in the past and would definitely be a good thing to implement. In the current code base it is a bit difficult to accomplish this, but I have been working on a refactor for quite awhile now that will hopefully be cleaner and easier to implement things like this.

If you are planning on just playing the shoutout before each song, it may be beneficial to turn on caching as then it won't need to download the shoutout every time it is played.

@RichardNysater
Copy link

I actually hacked this feature together in a separate fork https://github.com/RichardNysater/mumbledj
However, I don't actually know anything about Go, so it's very possible that the method I've used is terrible for some reason.

So if you really need this feature right now, hpincket, you can use that fork. I can't make any guarantees for the correctness, performance or reliability apart from the fact that it has been working fine for my users, though :p.

(The download is made by using a waitgroup and executing "go addedSong.Download()" when a user adds a song if there is currently a song playing)

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

No branches or pull requests

3 participants