githubEdit

Action Table - Audio

Introduction

This tutorial will guide you through using the JamAI Base TypeScript SDK to create a simple audio information processing system.

What We'll Build

Automate tasks with audio! Imagine processing meeting recordings or voice memos automatically.

In this tutorial, we'll create an audio processing system that:

  • Takes an audio file as input (e.g., .mp3, .wav).

  • Uploads it to a JamAI Base action table.

  • Extracts and generates key information such as:

    • Transcription of the audio content.

    • Summary of the audio.

Prerequisites

Before starting, you'll need:

  • Node.js 16.x or higher installed

  • Project ID and Personal Access Token (PAT)

Installation and Setup

Installing the SDK

Basic Configuration

Get your Personal Access Token (PAT) here:

Get your Project ID here:

Creating Your Action Table

1

Create the action table

Navigate to your JamAI Base action table tab and create a new action table named "AudioProcessor".

2

Configure columns

Configure the following columns:

Input Column:

  • Name: "Audio"

  • Type: Audio

Output Columns:

  • Name: "Transcription" Type: Text ☑️ Output checkbox enabled

  • Name: "Summary" Type: Text ☑️ Output checkbox enabled

3

Verify table

Create and confirm the table:

Basic Implementation

4.1 Simple Audio Processor

4.2 Complete Implementation with Error Handling

Usage Examples

Basic Usage

Batch Processing

Best Practices

Error Handling

  • Always validate input audio files.

  • Handle network errors gracefully.

  • Consider adding specific error handling for audio processing failures (e.g., silence, corrupted files).

Performance

  • Reuse the client instance.

  • Consider batch processing for multiple files.

  • Implement rate limiting for large batches if needed.

Security

  • Use environment variables for credentials.

Complete Standalone Example

Save this as audio_processor.ts:

Running the Example

  1. Save the code as audio_processor.ts

  2. Create a .env file:

  3. Install dependencies:

  4. Run with:

Or compile and run:

Troubleshooting

chevron-rightFile not found errorhashtag
  • Check that the file path is correct

  • Use absolute paths or ensure relative paths are correct

chevron-rightUnsupported file formathashtag
  • Ensure audio is in MP3 or WAV format

  • Check file extension matches actual file type

chevron-rightUpload timeouthashtag
  • Check internet connection

  • Verify file size is reasonable (< 25MB recommended)

  • Large audio files may take longer to upload

chevron-rightTranscription errorshashtag
  • Check audio quality (clear speech, minimal background noise)

  • Ensure audio file is not corrupted

  • Verify audio contains speech content

chevron-rightAPI errorshashtag
  • Verify your PAT and Project ID are correct

  • Check that the action table "AudioProcessor" exists in your project

  • Ensure output columns "Transcription" and "Summary" are configured correctly

Was this helpful?