diff --git a/examples/recorder/src/createListeningStream.ts b/examples/recorder/src/createListeningStream.ts index da2c2e8a..0bcbdb36 100644 --- a/examples/recorder/src/createListeningStream.ts +++ b/examples/recorder/src/createListeningStream.ts @@ -1,7 +1,7 @@ import { EndBehaviorType, VoiceReceiver } from '@discordjs/voice'; import { User } from 'discord.js'; import { createWriteStream } from 'node:fs'; -import { opus } from 'prism-media'; +import * as prism from 'prism-media'; import { pipeline } from 'node:stream'; function getDisplayName(userId: string, user?: User) { @@ -16,8 +16,8 @@ export function createListeningStream(receiver: VoiceReceiver, userId: string, u }, }); - const oggStream = new opus.OggLogicalBitstream({ - opusHead: new opus.OpusHead({ + const oggStream = new prism.opus.OggLogicalBitstream({ + opusHead: new prism.opus.OpusHead({ channelCount: 2, sampleRate: 48000, }), diff --git a/src/util/demuxProbe.ts b/src/util/demuxProbe.ts index 9a388cd9..fa7fd9be 100644 --- a/src/util/demuxProbe.ts +++ b/src/util/demuxProbe.ts @@ -1,5 +1,5 @@ import { Readable } from 'node:stream'; -import { opus } from 'prism-media'; +import * as prism from 'prism-media'; import { noop } from './util'; import { StreamType } from '..'; @@ -83,11 +83,11 @@ export function demuxProbe( } }; - const webm = new opus.WebmDemuxer(); + const webm = new prism.opus.WebmDemuxer(); webm.once('error', noop); webm.on('head', foundHead(StreamType.WebmOpus)); - const ogg = new opus.OggDemuxer(); + const ogg = new prism.opus.OggDemuxer(); ogg.once('error', noop); ogg.on('head', foundHead(StreamType.OggOpus)); diff --git a/src/util/generateDependencyReport.ts b/src/util/generateDependencyReport.ts index 424040b1..9a033457 100644 --- a/src/util/generateDependencyReport.ts +++ b/src/util/generateDependencyReport.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-var-requires */ /* eslint-disable @typescript-eslint/no-require-imports */ import { resolve, dirname } from 'node:path'; -import { FFmpeg } from 'prism-media'; +import * as prism from 'prism-media'; /** * Generates a report of the dependencies used by the \@discordjs/voice module. @@ -32,7 +32,7 @@ export function generateDependencyReport() { // ffmpeg report.push('FFmpeg'); try { - const info = FFmpeg.getInfo(); + const info = prism.FFmpeg.getInfo(); report.push(`- version: ${info.version}`); report.push(`- libopus: ${info.output.includes('--enable-libopus') ? 'yes' : 'no'}`); } catch (err) {