-
-
Notifications
You must be signed in to change notification settings - Fork 1
Home
EhsanFox edited this page Apr 22, 2022
·
4 revisions
music-engines is a package to fetch a music/artist/album or even playlist from the platform you choose, there multi platforms that are supported in this package, so there is no need for any others....
music-engine currently Supports 4 biggest platform that we all know all-in-one package and access to the Audio buffers directly from the platform API, so we are all-in-one and we have download feature
- Using NPM
npm install music-engines
- Using yarn
yarn add music-engines
- Custom Data Wrapper
- No Token Required
- Music Buffers (sometimes FFMPEG or Opus)
- YouTube
- SoundCloud
- Spotify
- Deezer
- Radio Javan (Maybe, maybe not)
Documents are live at /music-engines
const { YouTube } = require("music-engines");
const myEngine = new YouTube();
myEngine.use('https://www.youtube.com/watch?v=KQlyGYCKGGA', { format: true })
.then(resultArray => {
const track = resultArray[0];
const audioBuffer = track.stream()
audioBuffer.pipe(fs.createWritestream("music.mp3"))
})
.catch(console.error)
const { YouTube } = require("music-engines");
const myEngine = new YouTube();
myEngine.use('https://www.youtube.com/watch?v=KQlyGYCKGGA', { format: true })
.then(resultArray => {
const track = resultArray[0];
// Disabling chunking is recommended in Discord bots
const audioBuffer = track.stream({ filter: 'audioonly', dlChunkSize: 0 })
// Discord.js Stuff....
const connection = await voiceChannel.join();
const dipatcher = connection.play(audioBuffer)
// Enjoy the Music
})
.catch(console.error)
- More Examples would be added soon (PR's are welcome)
- Thanks to Kambiz for all the helps on the package and Future PR's