flogy / gatsby-mdx-tts

🗣 Adds speech output to your Gatsby site using Amazon Polly.
https://gatsby-mdx-tts.netlify.com
MIT License
9 stars 2 forks source link

Need your feedback! #2

Open flogy opened 4 years ago

flogy commented 4 years ago

This is my first Gatsby plugin. Also, I am sure there are lots of programmers who will find some potential for optimization or even bad practices in this repository. This is very appreciated!

I want to improve my skills and I would also like to proceed with this plugin to release a stable v1 soon and get Gatsby even more accessible!

If you have some constructive feedback for me, even if it is just a detail, please comment below or directly create a pull request with your solution 🙂

Thank you!

reggaeman007jah commented 4 years ago

I am onboard !! :)

baart1989 commented 4 years ago

I hope at some point i will be able to contribute, just slightly busy atm.

Have been tracking progress on other AWS source plugin: https://github.com/robinmetral/gatsby-source-s3. I think this repo can point you at some directions in terms of good practices, as to my mind @robinmetral have done outstanding work there.

robinmetral commented 4 years ago

Your plugin looks awesome! I'll need to try it out 🙂

I've never used anything like AWS Polly so I'll leave it to others to give feedback on the actual plugin, but I have a few suggestions in terms of automation/tooling that can make your life easier (and make your plugin more stable) beyond v1.0.0:

You might find that not all of these work for you and that's fine, take whatever you want 🙂

flogy commented 4 years ago

@baart1989 and @robinmetral thank you very much for your comments! I've looked into the tools and they seem very interesting. Due to a lack of time from my site I'll stick to the current setup for the moment, but will definitely consider auto-updating dependencies if this plugin grows further and it needs to be even more stable!

ghost commented 4 years ago

Hello flogy.

I'm currently working on a website for people who are visually impaired or blind. I'm testing whether this plugin is a good idea for providing a "read aloud" feature for the entire website. It seems like a good solution.

Is it true that it regenerates the mp3 files every time a change is made to the website, no matter whether the affected markdown file has changed? Doesn't that rack up the costs quickly if you use it on a lot of pages?

Edit: The cache being a problem was netlify-cms deleting the cache each time. Reusing the cache solved the problem.

flogy commented 4 years ago

Hello @andrinmeier

Very nice to hear the plugin is being used to make the web more accessible! Especially if it is used for a Swiss website, as I'm Swiss myself 😄

Glad you could fix the issue too, it really only regenerates the changed files when in development mode.

Would love to see the resulting website. And don't hesitate to ask if more questions come up while using the plugin.

Schöne Oobe!

ghost commented 4 years ago

The site is rgz-blind. It is still in the works though, we haven't "officially" launched yet.

One problem right now is that the plugin only works for markdown. In other words, it doesn't work for dynamically generated parts. On the rgz-blind site, the landing page consists of a markdown part (the "Aktuelles" part) and a dynamically generated part (the "Aktivitäten" and "Projekte" parts). Because the dynamic parts are in html, the read aloud feature doesn't work. I'm not sure how to solve this problem though.

Ja, was füren zuefall, dass du au schwizer bisch! Das plugin het viel potential und isch e super idee. Ich wirde sicher immer wieder mal ineluege, wänni zit han und helfe, sowit ich chan. Schöne abig :)

Edit: A few other things that came to mind:

flogy commented 4 years ago

@andrinmeier Thank you for the link and your suggestions on how this plugin can be improved.

It is just so cool that there are other people in Switzerland using Gatsby! I'd love to help you getting this project to work successfully with this plugin, so please find my answers to your questions as follows:

In other words, it doesn't work for dynamically generated parts.

This really is one of the weak points of the plugin in the current state. The plugin currently just parses the MDX files, looking for the SpeechOutput components. It then generates the speech output files from the text enclosed by those components. However, I believe this can be solved with some effort. It would improve the usability of the plugin a lot as well!

The speech output isn't stopped when leaving the current site.

Oh, you are right! I did not receive that error as I am using a custom use sound hook that manages stopping all the sounds when leaving a site. This bug could easily be fixed inside the UseSound.ts file of the plugin. We just have to create a useEffect cleanup function that stops the sound when the component using the useSound hook is unmounted. If you have some time to try it out it would be awesome if you could open up a pull request for this 🥳️

The word marker is lagging sometimes, i.e. doesn't keep up with the speech.

This probably has to do with certain characters that are being ignored by the speech output generation process but not by the word highlighting process. An example would be the word E-Mail on the Impressum page of your project. If you watch closely the marker is starting to lag just after that word (with one word offset). This is because the - in the word E-Mail. The current solution to solve such problems is configuring the ignoredCharactersRegex property in your gatsby-config.js.

Perhaps it would be possible to support something like Speech Markdown?

This is currently not possible using this plugin. But you can use my gatsby-transformer-polly plugin to achieve exactly that 🙂

If you have any further questions please don't hesitate to ask. To keep this repository tidy it would be great if you could open up separate issues for each question / problem you are running into.

Also, I would be delighted if we could connect somehow? E.g. on LinkedIn --> my profile?

Schöni Grüess us Windisch, Florian

ghost commented 4 years ago

Thank you for your feedback, I'll open separate tickets for the things I mentioned.

Also, I've contacted you on LinkedIn.

En gruess usem glarnerland/züri Andrin