Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ai_dubs has wrong path on GCS #63

Open
anhthoai opened this issue Nov 1, 2021 · 2 comments
Open

ai_dubs has wrong path on GCS #63

anhthoai opened this issue Nov 1, 2021 · 2 comments

Comments

@anhthoai
Copy link

anhthoai commented Nov 1, 2021

Hello. I tried your command but it always show error :
File "dubber.py", line 443, in dub transcripts = get_transcripts_json(os.path.join( File "dubber.py", line 110, in get_transcripts_json res = client.long_running_recognize(config=config, audio=audio).result() File "C:\Users\mrcool\making_with_ml\ai_dubs\venv\lib\site-packages\google\cloud\speech_v1p1beta1\services\speech\client.py", line 457, in long_running_recognize response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) File "C:\Users\mrcool\making_with_ml\ai_dubs\venv\lib\site-packages\google\api_core\gapic_v1\method.py", line 145, in __call__ return wrapped_func(*args, **kwargs) File "C:\Users\mrcool\making_with_ml\ai_dubs\venv\lib\site-packages\google\api_core\grpc_helpers.py", line 59, in error_remapped_callable six.raise_from(exceptions.from_grpc_error(exc), exc) File "<string>", line 3, in raise_from google.api_core.exceptions.InvalidArgument: 400 Invalid recognition 'config': Bad language code.

@shubham8550
Copy link

set your command in this order not from readme order

    videoFile (String): File to dub
    outputDir (String): Directory to write output files
    srcLang (String): Language code to translate from (i.e. "fi")
    targetLangs (list, optional): Languages to translate too, i.e. ["en", "fr"]
    storageBucket (String, optional): GCS bucket for temporary file storage. Defaults to None.
    phraseHints (list, optional): "Hints" for words likely to appear in audio. Defaults to [].
    dubSrc (bool, optional): Whether to generate dubs in the source language. Defaults to False.
    speakerCount (int, optional): How many speakers in the video. Defaults to 1.
    voices (dict, optional): Which voices to use for dubbing, i.e. {"en": "en-AU-Standard-A"}. Defaults to {}.
    srt (bool, optional): Path of SRT transcript file, if it exists. Defaults to False.
    newDir (bool, optional): Whether to start dubbing from scratch or use files in outputDir. Defaults to False.
    genAudio (bool, optional): Generate new audio, even if it's already been generated. Defaults to False.
    noTranslate (bool, optional): Don't translate. Defaults to False.

example

python dubber.py sample.mp4 outputDir "hi" --targetLangs '["ja",]'

@shubham8550
Copy link

for GCS error u can use this

    # transcripts = get_transcripts_json(os.path.join(
    #     "gs://", storageBucket, tmpFile), srcLang,
    #     phraseHints=phraseHints,
    #     speakerCount=speakerCount)
    transcripts = get_transcripts_json(
        "gs://"+ storageBucket+"/"+ tmpFile, srcLang,
        phraseHints=phraseHints,
        speakerCount=speakerCount)

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

No branches or pull requests

2 participants