Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: failed to downcast any to number #100

Open
LMS5413 opened this issue Apr 30, 2022 · 0 comments
Open

TypeError: failed to downcast any to number #100

LMS5413 opened this issue Apr 30, 2022 · 0 comments

Comments

@LMS5413
Copy link

LMS5413 commented Apr 30, 2022

Issue:

I was trying to use prism-media to be able to record the discord.js call using discord.js and when I use prism.opus.OggLogicalBitstream I get an error

Steps to reproduce:

My code:

const opusStream = connection.receiver.subscribe(userReciver, {
            end: {
                behavior: EndBehaviorType.Manual
            },
        });
        const oggWriter = new prism.opus.OggLogicalBitstream({
            opusHead: new prism.opus.OpusHead({
                channelCount: 2,
                sampleRate: 48000,
            }),
            pageSizeControl: {
                maxPackets: Number(10),
            }
        });
        pipeline(oggWriter, opusStream, createWriteStream(`./records/${message.guild.id}/record.ogg`), (err) => {
            if (err) {
                console.warn(`❌ Error recording file record.ogg - ${err.message}`);
            } else {
                console.log(`✅ Recorded record.ogg`);
            }
        });

Further details:

  • Operating System: Windows 10
  • Node.js version: 18.0.0
  • Commit I'm using: "prism-media": "^2.0.0-alpha.0",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant