Skip to content

Am I using Text to Speech or Universal streaming with the current implementation? #94

@kondricz

Description

@kondricz

Dear AssemblyAI team,

I have inherited a live transcription piece of code from a previous developer. I have been reading the changelog where Universal-Streaming was introduced.

I am using "assemblyai": "4.9.0" in my frontend code, and I need to know if this one is using Universal Streaming or not?

The official documentation seems to be a code running in backend environment:

https://www.assemblyai.com/docs/speech-to-text/universal-streaming

My questions would be:

  • Is my implementation using Universal Streaming or not? (I can't really figure it out from the types or from the documentation)
  • Does updating my assemblyai package for 4.13.3 will make it use Universal Streaming? Or would it give an option for that?

Thank You in advance,
Just a confused silly dev.

My code:

"use client";

import { useRef, useState, useEffect, useCallback } from "react";
import {
  RecordRTCPromisesHandler as RecordRTC,
  StereoAudioRecorder,
} from "recordrtc";
import { RealtimeTranscriber } from "assemblyai";

const initTranscriber = async () => {
    // Don't initialize if we're already initializing or have an instance
    if (
      isTranscriberConnecting.current ||
      isTranscriberConnected.current ||
      realtimeTranscriber.current
    ) {
      return;
    }

    isTranscriberConnecting.current = true;

    try {
      const token = await getToken();

      realtimeTranscriber.current = new RealtimeTranscriber({
        token,
        sampleRate: 16000,
      });
.... REST OF THE CODE

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions