discordjs / discordjs/opus

Buffer

Open
#51 6 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
C++
Stars
253
Forks
74
PR merge metrics
No merged PRs in 30d

Description

**Please describe the problem you are having in as much detail as possible:**
When i try to construct the Method `OpusEncoder` node exits with `errno 4294930435` or with `Error: Cannot create a Buffer larger than 0x100000000 bytes`.

The first one occurs only when rate is set to `32000` on the constructor and the scond on on every other rate

**Include a reproducible code sample here, if possible:**
just construct OpusEncoder.

```js
import Microphone from 'node-microphone'
import { io } from 'socket.io-client'
import { OpusEncoder } from '@discordjs/opus'

const socket = io("http://localhost:3000");
const encoder = new OpusEncoder(16000, 2);

var mic = new Microphone({
bitwidth: 16,
channels: 1,
rate: 32000,
encoding: 'unsigned-integer',
endian: 'big'
});

var micStream = mic.startRecording();

micStream.on('data', (data) => {
var encodedData = encoder.encode(data);
console.log(encodedData);
socket.emit('stream', data);
});

```

**Further details:**
the problem occurs in line 6
- @discordjs/opus version:
- Node.js version: 15.3.0
- Operating system: Windows 10 Pro 64bit

- Priority this issue should have – please be realistic and elaborate if possible:
**medium**

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure at the OpusEncoder constructor on line 6 using the provided sample and Node.js 15.3.0 on Windows 10. Trace the constructor path in the native binding and verify that supported rates no longer cause the reported errno or oversized Buffer error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
audio-video-rtc
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.