Giter Site home page Giter Site logo

Comments (4)

Talhavaival1 avatar Talhavaival1 commented on July 16, 2024 1

I wanted to know what should I put in wav, sr = translator.synthesize_speech(<speech_units>, <tgt_lang>) , speech units part

from seamless_communication.

Mortimerp9 avatar Mortimerp9 commented on July 16, 2024

your sample is to synthesize speech from the output of the translation step. Check https://github.com/facebookresearch/seamless_communication/blob/main/scripts/m4t/predict/predict.py as this has an example of predicting with code.

from seamless_communication.

Mortimerp9 avatar Mortimerp9 commented on July 16, 2024

https://github.com/facebookresearch/seamless_communication/blob/main/src/seamless_communication/models/inference/translator.py#L150 has more details

from seamless_communication.

l4b4r4b4b4 avatar l4b4r4b4b4 commented on July 16, 2024

yeah I am stumbling over tihs one as well. And when I plug the tensor response from predict as follows, it does generate a small 2 sec audio, but without any content. But I just started playing around 2 hours ago ...

translated_text, wav, sr = translator.predict(
        content, mode, target_lang, src_lang=source_lang
    )

    # Save the translated audio generation.   
    # wav, sr = translator.synthesize_speech(wav, "eng")
    unique_filename = str(uuid.uuid4())  # Generate a UUID and convert it to a string
    file_extension = ".wav"  # Replace with the desired file extension
    file_path = os.path.join(folder_path, unique_filename + file_extension)

    # # Save the translated audio generation.
    torchaudio.save(
        file_path,
        wav[0].cpu(),
        # TODO test gpu
        # wav[0].cpu(),
        sample_rate=sr,
    )

from seamless_communication.

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.