Closed NickUfer closed 6 years ago
What codec you have installed, I have problem with playing audio on opusscript (11.3.0), but on node-opus everything is good.
I am using node-opus v0.2.7. I quickly added my dependencies.
Hmm, than its a dev branch bug. I think???
I'm also getting this with type: "opus"
. It seems to be trying to play it back at the same speed as ffmpeg is outputting it. Could it need a buffer of sorts? This also happens with -frame_duration 20
sent to ffmpeg. I don't believe node-opus comes into play when using type: "opus"
@DerTechNick: What does your Transform stream look like?
Same versions:
Dependencies:
"bufferutil": "^3.0.3",
"discord.js": "git+https://github.com/discordjs/discord.js.git",
"erlpack": "github:discordapp/erlpack",
"libsodium-wrappers": "^0.7.3",
"node-opus": "^0.2.7",
"uws": "^9.14.0",
"zlib-sync": "^0.1.4"
My transform stream is in fact just a duplex stream.
this._outputStream = new Transform({
transform: function (chunk, encoding, callback) {
this.push(chunk);
callback();
},
highWaterMark: 1024 * 4096 // TODO
});
Btw: I have found a workaround. I have choosen "opus" as output format instead of "data" for ffmpeg and used "ogg/opus" as type when i play the resource.
Yep, otherwise the stream would send data back to ffmpeg to be reconverted to pcm. As a sidenote, why not just let discord.js convert your stream to opus?
Please describe the problem you are having in as much detail as possible:
Music which is played is incomplete / is jumpy / has wrong speed / doesnt play some parts. This bug occurs in the 12.0.0dev version and not in the stable one from npmjs (11.3.0) with the exact same code.
For clarification I recorded the output of my bot: (you can clearly recognize the wrong behaviour from ~25 seconds) https://workupload.com/file/ayX5MHC
And this is the original song: https://www.youtube.com/watch?v=A3mScURQA5U
Include a reproducible code sample here, if possible:
fluent-ffmpeg:
The output of ffmpeg goes into a Transform / Duplex stream which is then played like:
also tried:
Further details:
Dependencies:
discord.js version: 12.0.0dev (github:discordjs/discord.js) hash: 35babc706d6351d5899aa6eb1ee4bf54be88cf04
node.js version: 9.6.1
Operating system: Kubuntu 17.10 ; Kernel: 4.13.0-36-generic
Priority this issue should have – please be realistic and elaborate if possible: normal
[ ] I found this issue while running code on a user account
[X] I have also tested the issue on latest master, commit hash: 35babc706d6351d5899aa6eb1ee4bf54be88cf04