🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

@linto-ai/linto

Package Overview
Dependencies
Maintainers
4
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@linto-ai/linto

Wrapper around LinTO Studio API

latest
Source
npmnpm
Version
1.1.2
Version published
Weekly downloads
1
-88.89%
Maintainers
4
Weekly downloads
 
Created
Source

LinTO Studio SDK

LinTO Studio SDK is a wrapper around LinTO Studio API. You can generate an auth token from LinTO Studio in the organization settings.

It is available in Python and Javascript (NodeJS and web browser).

Install

Python

pip install linto

NodeJS or compiled front-end project

npm install @linto-ai/linto

Plain JS in web browser

<script type="module" src="https://unpkg.com/@linto-ai/linto/index.js"></script>

How to use

NodeJS or Web browser

// NodeJS
import LinTO from "@linto-ai/linto"
let linTO = new LinTO({
  authToken: "authToken",
})

// Browser
let linTO = new window.LinTO({
  authToken: "authToken",
})

// Choose depending on your environment

// NodeJS
import fs from "fs"
const file = await fs.openAsBlob("path/to/audio.mp3")

// Browser :
// From an <input type='file'/>
const file = document.getElementById("file").files[0]

const handle = await linTO.transcribe(file)

handle.addEventListener("update", (e) => {
  console.log("Audio transcription processing", e.detail)
})

handle.addEventListener("done", (e) => {
  console.log("Audio transcription completed")
  console.log("Full text", e.detail.fullText)
  console.log("Formated output", e.detail.toFormat())
  console.log("Turns list", e.detail.turns)
  console.log("Api response", e.detail.response)
})

handle.addEventListener("error", () => {
  console.log("Error while processing the audio")
})

Full example

  • NodeJS
  • Browser

Python

import os
from linto import LinTO

linTO = LinTO(auth_token="auth_token")

with open("path/to/audio.mp3", "rb") as f:
    file = f.read()

handle = await linTO.transcribe(file)

def on_update(data):
    print("Audio transcription processing", data)

def on_done(data):
    print("Audio transcription completed")
    print("Full text", data.full_text)
    print("Formated output", data.to_format())
    print("Turns list", data.turns)
    print("Api response", data.response)

def on_error(data):
    print("Error while processing the audio")

handle.on("update", on_update)
handle.on("done", on_done)
handle.on("error", on_error)

See complete python script at python/test.js

Documentation

Options in camelCase are the same in pascal_case for Python

Initialisation

// Javascript
linTO = new LinTO({authToken = "auth_token", ...options})
# Python
linTO = LinTO(auth_token="auth_token", **options)

Options

Parameterrequiredvaluedescriptiondefault value
authTokenyesStringStudio auth token
baseUrlnoStringStudio API base urlhttps://studio.linto.ai/cm-api

Transcribe

// Javascript
const handle = await linTO.transcribe(file, { ...options })

handle.addEventListener("update", callback)
handle.addEventListener("done", callback)
handle.addEventListener("error", callback)
# Python
await linTO.transcribe(file, **options)

handle.on("update", callback)
handle.on("done", callback)
handle.on("error", callback)

Options

Parameterrequiredvaluedescriptiondefault value
fileyesFile or BlobAudio file to transcribe
enableDiarizationnoBoolEnable speaker diarizationTrue
numberOfSpeakernoIntNumber of speaker for diarization, 0 means auto0
languageno2 letters language code or "*"Language the audio should be transcribed. "*" means auto-detection + multiple languages"*"
enablePunctuationnoBoolEnable automatic punctuation recognitionTrue
namenoStringName of the media in LinTO Studio"imported file ${date}"

toFormat options

Parameterrequiredvaluedescriptiondefault value
sepnoStringSeparator between metadatas" - "
metaTextSepnoStringSeparator between metadata and text" : "
eolnoStringEnd of line character ("CRLF" or "LF" or None). If neither "CRLF" or "LF", no carriage return is added."CRLF"
ensureFinalEOLnoBoolWhether to ensure final end of linefalse
includenoObjectWhich metadata to include (speaker, lang, timestamp){ speaker: true, lang: true, timestamp: true }
ordernoArrayOrder of metadata in output["speaker", "lang", "timestamp"]

Coming soon 🏗️

Transcribe video conference

const meeting = await linTO.transcribeVideoConference({ type, url, ...options })
meeting.addEventListener("connected", callback)
meeting.addEventListener("meeting_start", callback)
meeting.addEventListener("people_join", callback)
meeting.addEventListener("meeting_end", callback)
meeting.addEventListener("transcription", callback)

handle = await meeting.offlineTranscription({ ...options })
handle.addEventListener("update", callback)
handle.addEventListener("done", callback)
handle.addEventListener("error", callback)

Live transcription

const live = await linTO.transcribeLive({ ...option })
live.connectAudio(source)
live.startTranscription()
live.stopTranscription()
live.addEventListener("transcription", callback)

Keywords

STT

FAQs

Package last updated on 07 Oct 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts