GithubHelp home page GithubHelp logo

Local files support about yasha HOT 13 CLOSED

widepeepoclap avatar widepeepoclap commented on July 21, 2024
Local files support

from yasha.

Comments (13)

davidzeng0 avatar davidzeng0 commented on July 21, 2024

There is currently no way to play directly from the disk, however you can set up an http server to serve those files and use a network FileTrack (see docs/FileTrack.md)

from yasha.

davidzeng0 avatar davidzeng0 commented on July 21, 2024

If this is something you need then I can work on this issue

from yasha.

widepeepoclap avatar widepeepoclap commented on July 21, 2024

Was thinking about doing the same thing after making this issue. I believe that should work, but I'd love to see it natively supported in the future.
I deeply appreciate your efforts on this perfect project, thanks a lot!

from yasha.

davidzeng0 avatar davidzeng0 commented on July 21, 2024

May I know why you are using this as opposed to lavaplayer (lavalink)?

from yasha.

widepeepoclap avatar widepeepoclap commented on July 21, 2024

Lavalink has this problem where the track would start playing briefly before the bot becomes fully connected since it doesn't emit a ready event. Sometimes it just stops sending the audio out of nowhere. I've tried other packages like djs/opus and they all cause memory leaks and fragmentation, and have inferior audio quality.

from yasha.

davidzeng0 avatar davidzeng0 commented on July 21, 2024

See docs/FileTrack.md on how to use it

For security purposes, you may want to prevent users from attempting to play local files on your system if you allow them to play from any arbitrary url

if(track.isLocalFile) return;

from yasha.

davidzeng0 avatar davidzeng0 commented on July 21, 2024

I forgot to mention that local file support is added, let me know if you have any issues

from yasha.

widepeepoclap avatar widepeepoclap commented on July 21, 2024

I've been able to run it perfectly on local Ubuntu 20 but on Ubuntu 18 I'm getting this error for some reason.. [Error: Invalid data found when processing input]
It's obviously related to ffmpeg because I couldn't install these packages (libavcodec58 libavformat58 libavutil56 libavfilter7 libswresample3) for sange since they're not available on bionic. I've also built ffmpeg from source but it still didn't help.
I can't update my vps to ubuntu 20 at the moment. Should I just dockerize everything or is there something I can do to get it working on bionic?

from yasha.

davidzeng0 avatar davidzeng0 commented on July 21, 2024

I don't have experience with docker. Could you paste the error message from building ffmpeg from source?

from yasha.

davidzeng0 avatar davidzeng0 commented on July 21, 2024

Also if your bot serves many people, its recommended to install ffmpeg from source to avoid the infinite loop problem
The packages are probably just outdated on Ubuntu 18 so if you type out most of the name (e.g sudo apt install libavfilter) and then spam tab key it will show up with the version that's available

from yasha.

davidzeng0 avatar davidzeng0 commented on July 21, 2024

Another thing is it may be required to update the npm packages via npm update

from yasha.

widepeepoclap avatar widepeepoclap commented on July 21, 2024

Could you paste the error message from building ffmpeg from source?

I didn't get any errors from that, the error was emitted from the TrackPlayer instance after calling start().
Anyways, the problem was that I installed ffmpeg libraries then built if from source on top.
Everything is working perfectly, as well as playing local files. Thank you a lot.

from yasha.

davidzeng0 avatar davidzeng0 commented on July 21, 2024

No problem 👍

from yasha.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.