Skip to content

Conversation

@kw0n0
Copy link

@kw0n0 kw0n0 commented Dec 19, 2024

First attempt to handling buffer data, refer to #140

With this change:

  • Change variable name(filePath - audioSrc)

  • Add logic when receiving buffer data

    • Create temporary input file
    • Set output WAV file path
    • Delete temporary input file

I've created a simple example, but I'll post a PR for more if needed

Comment on lines +38 to +40
const tempInputPath = `Nodejs-whisper-input_${Date.now()}`
fs.writeFileSync(tempInputPath, inputAudioSrc)
logger.debug(`[Nodejs-whisper] Temporary input file created: ${tempInputPath}`)
Copy link
Contributor

@MrSwitch MrSwitch Feb 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the output is the name of this wav file plus ".srt" or ".json" or ".vtt" etc..

So with this change having a generated filepath to the .wav would make the corresponding output file paths indeterminate.

(at least that's my understanding #120 (comment))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants