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

Space in path (directory or file name) prevents diarization #23

Open
MrEdwards007 opened this issue Dec 22, 2023 · 2 comments
Open

Space in path (directory or file name) prevents diarization #23

MrEdwards007 opened this issue Dec 22, 2023 · 2 comments

Comments

@MrEdwards007
Copy link

I am unable to process a file if there is a space in the folder path or in the file name.
I have tried escaping the spaces but the sticking point appears to be ffmpeg or more specifically "convert_wavefile".
Currently my only method for addressing this is to create a temporary name and copy the file to a temporary directory, to eliminate the space.

Is there another way to manage this issue.
I have attempted to escape the spaces but that has not worked.

@MrEdwards007
Copy link
Author

MrEdwards007 commented Dec 22, 2023

Proposing the following

single quotes around the '{}' resolves the space issue with ffmpeg.
Adding a way to silence the large output from ffmpeg to stdout.
It has value for debugging but otherwise, it is just noisy.
If you need it, you can pass False to silent.

def convert_wavfile(wavfile, outfile, silent=True):
    """
    Converts file to 16khz single channel mono wav
    """
    cmd = "ffmpeg -y -i '{}' -acodec pcm_s16le -ar 16000 -ac 1 '{}'".format( wavfile, outfile )
    if (silent == True):
        rc = subprocess.Popen(cmd, shell=True, stderr=subprocess.DEVNULL, stdout=subprocess.DEVNULL).wait()
    else:
        subprocess.Popen(cmd, shell=True).wait()
    return outfiles

@mDimitar
Copy link

Hey @MrEdwards007 do you mind if we chat somewhere outside? Possibly Discord,I have troubles starting this project and running it on my test audio .wav file. I'd appreciate it if you help me.

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