DEV Community

Discussion on: Deepgram x DEV Hackathon Help Thread

Collapse
 
tqbit profile image
tq-bit

Hello guys,

I'm using the Node.js SDK to stream an audio file from a web application. I'm using Typescript and was wondering why I receive the following ts error here.

Do I really need the version property here? Could anything unexpected happen if I don't?

My current code looks something like this (and works file if I set @ts-ignore on top of it):

import { Deepgram } from '@deepgram/sdk';

...

export default class Transcriber {

   ...

  public translateFromLocalFile = async () => {
    const streamSource = {
      stream: fs.createReadStream(this.filePath),
      mimetype: this.mimeType,
    };

    const response = await this.deepgram.transcription.preRecorded(streamSource, {
      punctuate: true,
    });

    const transscript = this.getHighestRatedTranscript(response)

    return transscript;
  };
  ...
}

...
Enter fullscreen mode Exit fullscreen mode
Collapse
 
michaeljolley profile image
Michael Jolley • Edited

Great find. That's a bug in our SDK. version is an optional parameter.

Collapse
 
michaeljolley profile image
Michael Jolley

New release is on NPM now with that fix. Thanks for catching & reporting it.

Thread Thread
 
tqbit profile image
tq-bit

That was quick. Thanks :-)