Skip to content

[saa-js] turnReady event payload fields are not typed in the README #22

Description

@musadiq1707

Package

@attenlabs/saa-js

Version

0.1.0

What happened?

Bug report: saa-js README documents turnReady event payload inconsistently with TypeScript types

Summary

The saa-js README events table documents turnReady payload as:

{ audioBase64, audioPcm16, durationSec, frames, context }

But the Python SDK (saa-py) documents the equivalent TurnReadyEvent as having audio_pcm16: np.ndarray and audio_base64: str as the first two fields — i.e. the audio is a NumPy array in Python and an unspecified type in the JS table.

For a user integrating the JS SDK, it is unclear:

  1. What type is audioPcm16? The README does not say. The Python README says np.int16, but JS has no equivalent.
  2. Is audioPcm16 an Int16Array, a Float32Array, a plain ArrayBuffer, or something else?
  3. The frames field is not described at all in the JS events table (the Python README says list[TurnFrame] with "JPEG stills, empty unless the server has frames_per_turn > 0").

Expected behaviour

The turnReady entry in the saa-js README should describe:

  • audioPcm16: Int16Array — PCM16 @ 16 kHz mono
  • frames: Blob[] — JPEG stills, empty unless frames_per_turn > 0 is configured server-side
  • context: string | null — e.g. "interjection_follow_up"; null for normal turns

Actual behaviour

The payload shape is listed without types. frames and context have no explanation at all.

Impact

Developers building audio pipelines against audioPcm16 (e.g. feeding a Web Audio AudioBuffer) cannot determine the correct type without reading TypeScript source.

Suggested fix

Expand the events table to include types for every field in the turnReady payload, matching the detail level of the Python README.

Labels

documentation, saa-js

Steps to reproduce

Steps to reproduce

  1. Open packages/saa-js/README.md.
  2. Find the turnReady row in the Events table.
  3. Try to forward audioPcm16 to a Web Audio API AudioBuffer — the type is unknown.

Environment

No response

Logs / errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions