How to get MIMIC3 to pull long text from a file?

I would like to have Mimic3 pull text from a .txt file and output it as a .wav file. I can get it to do singular sentences just fine but anything with a line break and it won’t do it. There is an example on the Mimic3 website but it pulls from a URL which is posted below in Italics. I tried this, but since it is not a url it of course didn’t work.

Please let me know if anyone out there has some words of wisdom.

BTW I am brand new to coding in python and have zero experience beyond installing Mimic3 and testing out the server function.

Thank you in advance for your time,
Zeddock

Example Below

If your long text is fixed-width with blank lines separating paragraphs like those from Project Gutenberg, use the --process-on-blank-line option so that sentences will not be broken at line boundaries. For example, you can listen to “Alice in Wonderland” like this:

curl --output - ‘https://www.gutenberg.org/files/11/11-0.txt’ | \ mimic3 --interactive --process-on-blank-line

Just so we’re clear on what’s what, this part is neither Python nor the assistant, but Unix!

curl is a program, which comes with most Linux distributions, that downloads whatever’s at the other end of a URL. The | operator is called a pipe. It allows you to chain programs together; it takes the output of the program on the left and passes it along to the program on the right.

You need to replace everything on the curl side of the pipe with a command to read your text file and print its output. The command to do that is cat.

All of that said, I don’t know what will happen if you hit the public instances with large input. OVOS doesn’t maintain Mimic. It’s running, but it’s abandonware. We suggest self-hosters switch to Piper, from the same author after he went back to his old project.

I don’t know anything about MIMIC3 and very little about curl, but curl outputs to stdout by default, so

curl ‘https://www.gutenberg.org/files/11/11-0.txt’ |
mimic3 --interactive --process-on-blank-line

should work. I tried:
curl https://www.gutenberg.org/files/11/11-0.txt | wc
on my debian bullseye laptop and it worked fine, except that there was a long delay before any data transfer started. (Maybe delay was because of something on the gutenberg.org end.)

It will work, but only if the file is on the internet, because curl downloads from the internet.

I really can’t stress enough that these are Linux questions, nothing to do with Mycroft.

I should have been more specific. I do not need to use the curl tool that was just the example given on the site. I was just looking for a way to get the text from a local file.

Do you have a link for the Piper project?

And thanks again for sharing your experience.

In case you missed it: cat filename.txt in place of everything left of the |

Thanks for all your help. I very much appreciate it. I’ll be trying it out next time I get a chance.

mimic3 --interactive --process-on-blank-line < filename.txt

should also work and would use fewer processes.

< filename.txt means read stdin from filename.txt

Hello again. It’s been some time. I have spent about 2 hours on piper and I am having a hard time. I am using the code on the git site and have come up with this

                cat GatewaytotheGalaxyUniverseAMilitarySpaceO.txt | piper \ -m/--model en_US-libritts_r-medium \ --output_file testp.wav

but it keeps out puting a error

                                         piper: error: the following arguments are required: -m/--model

What am I doing wrong? And is there a different place I should be looking for help since this is no longer a Mimic3 issue?

Thanks again for holding my hand while I try and learn python

Right there at the Piper repo is a safe bet for help, under the Issues tab, or Discussions if he’s enabled it.

In this case, however, it is indeed just growing pains. Command line arguments, when specified that way, are specifying that you can input -m or --model, not to input both.