capacitor-community/text-to-speech

bug: unhelpful error "Failed to read text." when passed a long amount of text.

j-d-carmichael opened this issue · 4 comments

OS: Android 10
Latest "text-to-speech" version

The error message gives no other clues.. is my device out of memory, is there a limit to the text to send, are there characters the reader doesn't support?

Basic snippet works with short bits of text but longer text fails:

await TextToSpeech.speak({
        text: input.text,
        lang,
        rate: input.rate,
        pitch: input.pitch,
        volume: input.volume,
        category: 'ambient',
      });

When passing in the following string which is an article extract from a random blog (https://medium.com/@everywhereist/bros-lecce-we-eat-at-the-worst-michelin-starred-restaurant-ever-3466c98cdbdf) it only returns "Failed to read text.":

Geraldine DeRuiter [https://miro.medium.com/fit/c/56/56/1*w_MQ2FTD63HQBazomOwJLg.png]
[https://medium.com/@everywhereist?source=post_page-----3466c98cdbdf-----------------------------------]

[https://miro.medium.com/max/1400/1*JxYfu0_CFzTM-r4U6x7OtA.png]

Rand’s face as he tries one of the “courses.”

Note: This was originally published on The Everywhereist blog [https://bit.ly/HellNoBros].

There is something to be said about a truly disastrous meal, a meal forever indelible in your memory because it’s so uniquely bad,
it can only be deemed an achievement. The sort of meal where everyone involved was definitely trying to do something; it’s just
not entirely clear what.

I’m not talking about a meal that’s poorly cooked, or a server who might be planning your murder — that sort of thing happens in
the fat lump of the bell curve of bad. Instead, I’m talking about the long tail stuff — the sort of meals that make you feel as
though the fabric of reality is unraveling. The ones that cause you to reassess the fundamentals of capitalism, and whether or not
you’re living in a simulation in which someone failed to properly program this particular restaurant. The ones where you just know
somebody’s going to lift a metal dome off a tray and reveal a single blue or red pill.

I’m talking about those meals.

At some point, the only way to regard that sort of experience — without going mad — is as some sort of community improv theater.
You sit in the audience, shouting suggestions like, “A restaurant!” and “Eating something that resembles food” and “The exchange
of money for goods, and in this instance the goods are a goddamn meal!” All of these suggestion go completely ignored.

That is how I’ve come to regard our dinner at Bros, Lecce’s only Michelin-starred restaurant, as a means of preserving what’s left
of my sanity. It wasn’t dinner. It was just dinner theater.

No, scratch that. Because dinner was not involved. I mean — dinner played a role, the same way Godot played a role in Beckett’s
eponymous play. The entire evening was about it, and guess what? IT NEVER SHOWED.

[https://miro.medium.com/max/1126/1*ruc9YQ1gJ9YhwEjMjB_Tvw.png]

Rand holding up one of the courses — a paper-thin fish cracker — in its entirety.

So no, we can’t call it dinner theater. Instead, we will say it was just theater.

Very, very expensive theater.

I realize that not everyone is willing or able to afford a ticket to Waiting for Gateau and so this post exists, to spare you our
torment. We had plenty of beautiful meals in Lecce that were not this one, and if you want a lovely meal out, I’ll compile a list
shortly.

But for now, let us rehash whatever the hell this was.

We headed to the restaurant with high hopes — eight of us in total, led into a cement cell of a room, Drake pumping through
invisible speakers. It was sweltering hot, and no other customers were present. The décor had the of chicness of an underground
bunker where one would expect to be interrogated for the disappearance of an ambassador’s child.

Earlier that day, we’d seen a statue of a bear, chiseled into marble centuries ago, by someone who had never actually seen a bear.
This is the result:

[https://miro.medium.com/max/1400/1*27GpSnf8K6dcTIHBUsj_Nw.png]

And this is a perfect allegory for our evening. It’s as though someone had read about food and restaurants, but had never
experienced either, and this was their attempt to recreate it.

What followed was a 27-course meal (note that “course” and “meal” and “27” are being used liberally here) which spanned 4.5 hours
and made me feel like I was a character in a Dickensian novel. Because — I cannot impart this enough — there was nothing even
close to an actual meal served. Some “courses” were slivers of edible paper. Some shot were glasses of vinegar. Everything tasted
like fish, even the non-fish courses. And nearly everything, including these noodles, which was by far the most substantial dish
we had, was served cold.

[https://miro.medium.com/max/1400/1*u_FZ6s9YeSkWSwrhO-ndcQ.png]

I’ve added the bread plate for scale. This was the largest course of the 27 (We got six noodles and one piece of bread each.)

Amassing two-dozen of them together amounted to a meal the same way amassing two-dozen toddlers together amounts to one
middle-aged adult.

[https://miro.medium.com/max/1120/1*lSmxF-OT0aaY1HX49YARrQ.png]

A course for *two* people at Bros.

I’ve checked Trip Advisor. Other people who’ve eaten at Bros were served food
[https://www.tripadvisor.com/Restaurant_Review-g194791-d9725946-Reviews-Bros-Lecce_Province_of_Lecce_Puglia.html]. Some of them
got meat, and ravioli, and more than one slice of bread. Some of them were served things that needed to be eaten with forks and
spoons.

We got a tablespoon of crab.

[https://miro.medium.com/max/1124/1*OTLxZpyvYmIxkkjRadhFyw.png]

This was a main course. It’s about a tablespoon of food.

I’ve tried to come up with hypotheses for what happened. Maybe the staff just ran out of food that night. Maybe they confused our
table with that of their ex-lover’s. Maybe they were drunk. But we got twelve kinds of foam, something that I can only describe as
“an oyster loaf that tasted like Newark airport”, and a teaspoon of savory ice cream that was olive flavored.

[https://miro.medium.com/max/1130/1*Nr5x73aqIxhU7ybBc8xzhg.png]

A sliver of oyster loaf with foam. David’s face here says more than I ever can.

[https://miro.medium.com/max/1008/1*Ba0aTB_jpEaNmpP5DbZahg.png]

Teaspoon of olive ice cream.

I’m still not over that, to be honest. I thought it was going to be pistachio.

There is no menu at Bros. Just a blank newspaper with a QR code linking to a video featuring one of the chefs, presumably, against
a black background, talking directly into the camera about things entirely unrelated to food. He occasionally used the proper noun
of the restaurant as an adverb, the way a Smurf would. This means that you can’t order anything besides the tasting menu, but also
that you are at the mercy of the servers to explain to you what the hell is going on.

The servers will not explain to you what the hell is going on.

They will not do this in Italian. They will not do this in English. They will not play Pictionary with you on the blank newspaper
as a means of communicating what you are eating. On the rare occasion where they did offer an explanation for a dish, it did not
help.

“These are made with rancid ricotta,” the server said, a tiny fried cheese ball in front of each of us.

“I’m… I’m sorry, did you say rancid? You mean… fermented? Aged?”

“No. Rancid.”

“Okay,” I said in Italian. “But I think that something might be lost in translation. Because it can’t be-”

“Rancido,” he clarified.

Another course — a citrus foam — was served in a plaster cast of the chef’s mouth. Absent utensils, we were told to lick it out of
the chef’s mouth in a scene that I’m pretty sure was stolen from an eastern European horror film.

[https://miro.medium.com/max/1078/1*jyVvN-wPQbQouQ2RNUrVaQ.png]

For reasons that could fill an entire volume of TimeLife Mysteries of the Unknown, THIS ITEM IS AVAILABLE FOR SALE AT THEIR
GIFTSHOP [https://www.pellegrinobrothers.it/en/product/limoniamo-floriano/]. In case you want to have a restraining order filed
against you this holiday season.

Now, at this point, I may have started quietly freaking out. A hierarchical pecking order was being established, and when you’re
the one desperately slurping sustenance out of the plaster cast of someone else’s mouth, it’s safe to say you are at the bottom of
that pyramid. We’d been beaten into some sort of weird psychological submission. Like the Stanford Prison Experiment
[https://en.wikipedia.org/wiki/Stanford_prison_experiment] but with less prison and more aspic. That’s the only reason I have for
why we didn’t leave during any of these incidents:

 * When a member of our party stood up during the lengthy stretch between courses to go have a cigarette outside, and was scolded
   to sit down.
 * When one member of our party was served nothing for three consecutive courses, because they couldn’t figure out how to
   accommodate her food allergies.
 * When Rand was served food he was allergic to, repeatedly, because they didn’t care enough to accommodate his.
 * When a server reprimanded me for eating. These reconstituted orange slices (one per person) were a course. I asked if I could
   eat the real orange that had been served alongside it (we’d all gotten one, and I, at this point, was extremely hungry). “Yes,”
   the server said, annoyed. “But you aren’t really supposed to.” He let me have two segments and then whisked the fruit away.

[https://miro.medium.com/max/1130/1*BqS17SosY_lAIQME-hmW6A.png]

No, we just sat there while the food was portioned out a teaspoon at a time, a persistent and sustained sort of agony, like slowly
peeling off a band-aid. That’s the problem with a tasting menu. With so many courses, you just assume things are going to turn
around. Every dish is a chance for redemption. Maybe this meal was like Nic Cage’s career — you have to wait a really long time
for the good stuff, but there is good stuff.

BUT NO. We kept waiting for someone to bring us something — anything! — that resembled dinner. Until the exact moment when we
realized: it would never come. It was when our friend Lisa tried to order another bottle of wine.

“Would you like red or white?” the server asked.

“What are we having for the main?” she inquired.

His face blanched.

“The… main, madame? Um… we’re about to move on to dessert.”

We sat for a moment, letting this truth settle over us. Because by now it had been hours, and at no point had we been served
anything that could be considered dinner. (There was one time when I thought it might happen — the staff placed dishes in front of
us, and then swirled sauces on the dishes, and I clapped my hands, excitedly waiting for something to be plated atop those
beautiful sauces. Instead, someone came by with an eyedropper and squirted drops of gelee onto our plates).

[https://miro.medium.com/max/896/1*pImaHJeSxn0zEaoPR0ua3A.png]

The meat droplet course.

“We’ve infused these droplets with meat molecules,” the server explained, and left.

I don’t know if our experience was the norm. I’ve looked TripAdvisor’s photo for Bros, and other people who’ve gone there seem to
have been fed actual food. Like, even this person, who was served the same weird meat droplet course, at least got it with a
triangle of foamy-looking bread [https://www.instagram.com/p/CHAjuY2DX5m/]. Do you know what it’s like to envy someone for a piece
of foamy looking bread? IT’S NOT GREAT.

“There’s no … main?” Lisa said to us in disbelief after the server had retreated.

“Hey,” I said, my hand resting on her arm. She was shaking slightly from low blood sugar. “It’s okay.”

“They haven’t fucking fed us,” she said, her eyes wide.

“I know, I know” I said, “But look. We’re in this amazing country. And I don’t know about you, but nothing is going to stop me
from enjoying tonight.”

She nodded.

“Because I’m surrounded by my favorite people,” I said, and I squeezed Lisa’s hand for emphasis, “and I’m at my favorite
restaurant.”

Lisa sputtered laughing. No more food was coming, but there was something freeing in that. Because this meal had never been about
us to begin with. It sure as hell wasn’t about the food. And there is something glorious about finally giving up.

[https://miro.medium.com/max/1800/1*4HN0IdIg0Ig--Tb-RykYjg.png]

[https://miro.medium.com/max/1400/1*eGE4FNOvCd2k-PRqut7dqw.png]

We sat through a few more courses including a marshmallow flavored like cuttlefish, and a dish called “frozen air” which literally
melted before you could eat it, which melt like a goddamn metaphor for the night.

And then someone came in and demanded we stand and exit the restaurant. Thinking we were getting kicked out, we gleefully
followed. Instead, we were led across the street, to a dark doorway and into the Bros laboratory. A video of the shirtless kitchen
staff doing extreme sports played on a large screen TV while a chef cut us comically tiny slivers of fake cheese.

Rand was, of course, allergic to it.

The bill arrived. The meal cost more than any other we’d eat during our trip by a magnitude of three. They’d given us balloons
with the restaurant’s name across it and the chef emerged and insisted on posing with us for a Polaroid that we did not ask for.
We were finally released into the night, after every other restaurant had closed, ensuring that no food would be consumed that
evening.

“That was abhorrent,” we all agreed as we shoved the balloons into a dumpster (I’d made everyone take one, with the baffling logic
that they’d somehow help offset the cost of the meal). We howled at how ridiculous it was, and how they’d poisoned Rand. How maybe
we should have known that a restaurant named “Bros” was going to be a disaster.

It was like an awful show that we had front row tickets to. But wasn’t there something glorious about sharing it together, the way
that a terrible experience makes you all closer?

“No,” someone said, and we laughed even harder.

P.S. — The next day, one of the staff tried contacting the only single female member of our party via Instagram messages. “Hey, I
served you last night!” he wrote. She immediately blocked him.

Bros. [https://www.pellegrinobrothers.it/en/], Via degli Acaya, 2, 73100 Lecce LE, Italy

Cost: a rather mortifying 130–200 Euros per person

Note: the TripAdvisor reviews show a lot of elaborate courses, and these were all way, way more food than anything we ate. I
cannot express to you how little we were fed, and I’m not a particularly big eater. Allergy and dietary restrictions were largely
ignored.

Recommendation: Do not eat here. I cannot express this enough. This was single-handedly one of the worse wastes of money in my
entire food and travel writing career bwah ha ha ha ha ha ha oh my god

Hi, thank you for your request. I will have a look at it as soon as possible. You are right that the error message is not helpful at the moment. We definitely need to improve that.

I'm now breaking the long string into much smaller chunks, and this seems to pass through ok, so it must be something to do with the string length. I don't know where the limit is though, if i find it I will let you know.

Unfortunately, I could not reproduce the issue with my Android device.
Can you reproduce the problem locally and provide the logs from Android Studio?

It looks like there hasn't been a reply in 30 days, so I'm closing this issue.