Skip to content

agent_playout.ts AudioFrame copy bug #621

@victorx98

Description

@victorx98

Describe the bug

In capture():
It didn't respect the Int16Array boundary and copy the underlying buffer directly. This will create issue if we use Buffer (minimum 8192 bytes) and use Int16Array view on PCM data less than 8192 bytes.

                for (const f of bstream.write(frame.data.buffer)) {
                  handle.pushedDuration += (f.samplesPerChannel / f.sampleRate) * 1000;
                  await this.#audioSource.captureFrame(f);
                }

Relevant log output

No response

Describe your environment

Nodejs 18, livekit agent 0.7.9

Minimal reproducible example

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions