npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

austack

v0.1.0

Published

TypeScript/JavaScript client SDK for Austack conversational AI

Readme

Austack Client SDK for Node.js/TypeScript

A TypeScript/JavaScript client SDK for Austack conversational AI, providing WebSocket-based audio communication with built-in audio processing and conversation management.

Installation

npm install @austack/client

Features

  • 🎙️ Audio Input/Output: Browser-compatible audio capture and playback
  • 🔊 Real-time Communication: WebSocket-based bidirectional audio streaming
  • 🎯 Voice Activity Detection: Intelligent speech detection and silence handling
  • 🛠️ TypeScript Support: Full type definitions included
  • 🔄 Interrupt Handling: Smart audio interruption for natural conversations
  • 📦 Dual Module Support: Works with both CommonJS and ES modules

Quick Start

import { ConversationManager } from '@austack/client';

const conversation = new ConversationManager(
  'ws://localhost:8000/ws',
  (state) => {
    console.log('Conversation state:', state);
  }
);

// Start the conversation
await conversation.startConversation();

// Stop the conversation
conversation.stopConversation();

// Clean up resources
conversation.cleanup();

API Reference

ConversationManager

The main class for managing audio conversations.

class ConversationManager {
  constructor(
    websocketUrl: string,
    stateChangeCallback?: (state: ConversationState) => void
  )

  async startConversation(): Promise<void>
  stopConversation(): void
  sendMessage(message: object): void
  cleanup(): void
  getState(): ConversationState
  isActive(): boolean
  isConnected(): boolean
  updateWebSocketUrl(newUrl: string): void
}

ConversationState

interface ConversationState {
  isConnected: boolean;
  isRecording: boolean;
  isPlaying: boolean;
  currentAmplitude: number;
  error: string | null;
}

AudioInterface

Low-level audio interface for custom implementations.

class AudioInterface {
  constructor(
    inputCallback: (audioData: ArrayBuffer | ArrayBufferView) => void,
    amplitudeCallback?: (amplitude: number) => void,
    onInterrupt?: () => void
  )

  async start(): Promise<void>
  stop(): void
  play(audioData: ArrayBuffer): void
  interruptPlayback(): void
  setAudioPlaybackState(isPlaying: boolean): void
  cleanup(): void
}

WebSocketManager

WebSocket communication manager.

class WebSocketManager {
  constructor(websocketUrl: string, audioInterface?: AudioInterface)

  connect(): Promise<void>
  disconnect(): void
  sendAudioData(audioData: ArrayBuffer): void
  sendMessage(message: object): void
  sendInterrupt(): void
  isConnected(): boolean
}

Examples

Basic Usage with State Monitoring

import { ConversationManager, ConversationState } from '@austack/client';

const conversation = new ConversationManager(
  'ws://localhost:8000/ws',
  (state: ConversationState) => {
    if (state.error) {
      console.error('Conversation error:', state.error);
    }
    
    if (state.isConnected) {
      console.log('Connected to server');
    }
    
    if (state.isRecording) {
      console.log('Recording audio...');
    }
    
    if (state.currentAmplitude > 0.1) {
      console.log('Voice detected');
    }
  }
);

try {
  await conversation.startConversation();
  console.log('Conversation started successfully');
} catch (error) {
  console.error('Failed to start conversation:', error);
}

Custom Audio Configuration

import { AudioInterface, WebSocketManager } from '@austack/client';

// Create custom audio interface
const audioInterface = new AudioInterface(
  (audioData) => {
    // Handle audio input
    webSocketManager.sendAudioData(audioData);
  },
  (amplitude) => {
    // Monitor voice amplitude
    console.log('Amplitude:', amplitude);
  },
  () => {
    // Handle interruptions
    console.log('User interrupted playback');
  }
);

const webSocketManager = new WebSocketManager('ws://localhost:8000/ws', audioInterface);

await webSocketManager.connect();
await audioInterface.start();

Audio Configuration

The SDK uses the following default audio settings:

  • Sample Rate: 16kHz (input and output)
  • Channels: Mono (1 channel)
  • Format: 16-bit PCM
  • Chunk Size: 1024 samples
  • Silence Threshold: 0.01
  • Silence Timeout: 2 seconds
  • Send Interval: 0.5 seconds

These settings are optimized for speech recognition and conversation applications.

Browser Compatibility

This SDK is designed for modern browsers with support for:

  • WebSocket API
  • Web Audio API
  • MediaDevices API (getUserMedia)

License

MIT