Coder Social home page Coder Social logo

Comments (3)

guillaumekln avatar guillaumekln commented on May 12, 2024 2

Sure, that should be a simple change. Let me open a PR.

from faster-whisper.

guillaumekln avatar guillaumekln commented on May 12, 2024

Hi,

This is already possible. The transcribe method accepts file-like objects so you can wrap your buffer with io.BytesIO.

For example, the code below reads the audio file into a buffer of bytes which is then passed to transcribe:

import io

with open("audio.mp3", "rb") as audio_file:
    audio_bytes = audio_file.read()
    audio_file = io.BytesIO(audio_bytes)

segments, _ = model.transcribe(audio_file)
text = "".join(segment.text for segment in segments)

from faster-whisper.

royce-mathew avatar royce-mathew commented on May 12, 2024

Would it be possible to add support to pass the waveform as a numpy array directly to transform without creating a file? whisper currently allows you to pass the audio file or the audio waveform. For projects which listen to audio in realtime and try to transcribe the audio fast I think the option of being able to pass the waveform directly to transcribe would be really great

from faster-whisper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.