mirror of
https://github.com/darksaid98/mediaplex.git
synced 2026-12-02 14:38:55 +00:00
improve probe accuracy
This commit is contained in:
1 parent
888e075376
commit
3f0a20b3a2
3 files changed
+19
-10
No files matched your search
+6
-2
@@ -1,13 +1,17 @@
|
||||
const fs = require('fs');
|
||||
const { probeStream, readMetadata } = require('../index.js');
|
||||
|
||||
const stream = fs.createReadStream(`${__dirname}/demo.pcm`);
|
||||
const url = "https://cdn.discordapp.com/attachments/1128739211701395518/1134561530885705738/16905709686973736.mp3";
|
||||
// const stream = fs.createReadStream(`${__dirname}/test.pcm`);
|
||||
const stream = new Promise((resolve, reject) => {
|
||||
require('https').get(url, resolve);
|
||||
});
|
||||
|
||||
/**
|
||||
* @param {Buffer} chunk
|
||||
*/
|
||||
async function main() {
|
||||
const probeResult = await probeStream(stream);
|
||||
const probeResult = await probeStream(await stream);
|
||||
console.log(probeResult.result);
|
||||
// console.log(readMetadata(probeResult.result));
|
||||
/*
|
||||
|
||||
Reference in new issue
Block a user