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

Add sounds #3

Closed
HugoFara opened this issue Nov 14, 2021 · 8 comments
Closed

Add sounds #3

HugoFara opened this issue Nov 14, 2021 · 8 comments
Assignees
Labels
enhancement Develop an existing feature

Comments

@HugoFara
Copy link
Owner

Sounds are often a good way to make an application more lively.

Open source sounds are necessary, but that should not be a problem.

@HugoFara HugoFara added the enhancement Develop an existing feature label Nov 14, 2021
@HugoFara HugoFara self-assigned this Nov 14, 2021
@chaosarium
Copy link

I noticed the same problem as I went in and tried to fix things for my personal use. It seems like that tts.php in the original versional is responsible for making sounds when words are clicked, but the Google Translate API is no longer working (I think you might have noticed that I removed calls to tts.php in my fork, which you later forked). I tried to fix the issue but, since I don't know PHP, I made little progress.

So far I have been using MacOS's built in text-to-speech after manually selecting the text, which produces serviceable sound and works offline. I wonder if there is a way to invoke the system speech synthesizer from the browser. I thought say.js might be an option but didn't have time to look into integrating it to LWT.

As of open source sounds, I don't think it would be necessary if the system speech synthesizer suffice. I assume you are talking about adding an open source sound library?

I didn't have time to experiment with using the system synthasizer since my last commit in August, but I could try if you think this is a good idea.

@chaosarium
Copy link

As far as I am aware, the current version already implemented a "Read in browser" button that reads the whole text in the browser. But since I have audio for texts already, I think it's more helpful to have speech synthesis for individual words. Or am I missing something...

@HugoFara
Copy link
Owner Author

I was more thinking of sounds when doing tests for example, a "success" sound is rewarding, which help learning.

A text-to-speech feature for individual word is also a good idea. In fact modern browsers already ship this functionality with JS, so there is no need to install anything here :)

Concerning the file tts.php, I don't think to re-use it again, because it is simply unnecessary.

As there is no priority here, I do not have a date for this feature but I am welcome to any pull request! If you want to experiment a bit, you can try to reproduce the "Read in browser" functionality in do_test_test.php.

@chaosarium
Copy link

Hi!

I did manage to implement a new tts.php that works with the SpeechSynthesis API in modern browsers on my fork (mostly in this commit). I took a look at your version but realised something breaks when migrating my lwt database, which I think I will open another issue with details. Hopefully I can open a pull request in the future when things are figured out :)

@HugoFara
Copy link
Owner Author

Hi!

I have read your commits, There are a few steps we need to take before any pull request, so I created an issue on your fork.

I don't remember changing database calls, so that may be an issue related to the official LWT, it worth opening a separate issue.

I'm also implementing sounds for tests, you can listen to sounds folder on dev branch, so we may close this issue soonner tanh expected.

@HugoFara
Copy link
Owner Author

HugoFara commented Feb 5, 2022

For records, I implemented two sounds systems in release 2.2.0.

  • "Success" and "Failure" sounds that play during tests. They are compatible with themes, so they can be customized.
  • A text-to-speech reading for tests only. This is an optional feature.

How is it going on your side @chaosarium ? Your commits on tts.php tackle a broader issue, so your work can still be implemented. As this issue was very general, I may close it in a few days if I have no return from you. It would be interesting to create a more specific issue for TTS. So, let me know!

@chaosarium
Copy link

Hi @HugoFara!

I checked out the latest version (2.2.0) and saw the changes that you've made. I like the success and failure sounds!

I ran into some problem with changing language for previous modification to tts.php but I haven't had a chance to look into that yet. As of now my text to speech seems limited to function with the language specified in settings. Right now, I think this issue can be closed.

One problem, however, is that the "Read words aloud" button doesn't stay checked in test mode so everytime the user need to check the box to get pronunciation.

I've also been thinking about some ideas I had for LWT and I will bring them to discussions soon. Hopefully I can have some time to contribute.

@HugoFara
Copy link
Owner Author

HugoFara commented Feb 7, 2022

Hi!

Glad to see you appreciate the motivational sounds!

For the "Read words aloud", in fact it is not saved to settings yet, as we are working on a merge of your changes on tts.php, I consider it an experimental feature, before a more mature system.

Never hesitate to create issues when you run across problems ;) In the worst case the resolution may help someone else!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Develop an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants