Coder Social home page Coder Social logo

jsakamoto / toolbelt.blazor.speechsynthesis Goto Github PK

View Code? Open in Web Editor NEW
88.0 10.0 18.0 4.33 MB

SpeechSynthesis API access for your Blazor apps.

Home Page: https://jsakamoto.github.io/Toolbelt.Blazor.SpeechSynthesis/

License: Mozilla Public License 2.0

C# 65.71% HTML 17.45% TypeScript 7.38% JavaScript 8.79% CSS 0.67%

toolbelt.blazor.speechsynthesis's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

toolbelt.blazor.speechsynthesis's Issues

addEventListener is not a function on Safari for MacOS

great library, but alas still an issue when running in Safari Version 15.4 (17613.1.17.1.13) on MacOS Monterey 12.3.1 (Apple silicon)

javascript console error:
Unhandled Promise Rejection: TypeError: t.addEventListener is not a function. (In 't.addEventListener("voiceschanged",()=>{t.getVoices().length>0&&n()})', 't.addEventListener' is undefined)

can reproduce it easily when navigating to the online demo site: will not enumerate the voices as a result

Is there a limit for words spoken by google german - Voice?

I would like to use the tool to read a complete web page. But the voice output stops after the 1st paragraph. I did divide the voice output into individual sentences and did it output in a for-loop. This works, but then a pause/resume no longer works.
Does anyone have an idea of how I can have long texts read out, with a pause/resume function?!?
Thanks, Thomas

volume control bar is hidden on mobile display

I accessed https://jsakamoto.github.io/Toolbelt.Blazor.SpeechSynthesis on my iPhone, but could not touch some of the controls in the options.

Example: chrome developer tool (iPhone 12 Pro)
screenshot

Server and Signal-R version

Hi, is this also supposed to work with server side blazor app?
So far I was not able to make it working in latest 3.1 .net core server side blazor template.

Blazor Server Project with Blazor running in different path

Hello and thank you for the project!
I have a project running with blazor in separate path - https://localhost:44368/blazor/
Therefore I have:
Startup.cs
endpoints.MapBlazorHub("/Blazor/_blazor");
endpoints.MapFallbackToPage("~/Blazor/{*clientroutes:nonfile}", "/Blazor/_Host");

Pages/Blazor/_Host.cshtml
@page "/blazor"
...
<head>
...
<link rel="stylesheet" href="/css/site.css" />
<base href="~/blazor/" />
</head>
<body>
...
<script src="~/_framework/blazor.server.js"></script>
</body>

All of my other Blazor content works fine.
When attempting to use this project, I receive the error:
{"Failed to fetch dynamically imported module: https://localhost:44368/blazor/_content/Toolbelt.Blazor.SpeechSynthesis/script.module.min.js?v=10.0.0\nTypeError:
Failed to fetch dynamically imported module: https://localhost:44368/blazor/_content/Toolbelt.Blazor.SpeechSynthesis/script.module.min.js?v=10.0.0"}

Do you know how I can get this issue resolved?

Thank you!

Can this speak a blog page?

Hi @jsakamoto ,

I'm thinking of integrating speech synthesis functionality in https://ilovedotnet.org and would like to understand if this API has functionality to speak contents of current component. Or I have figure out a way to parse all the text inside the current component and pass it to this API to speak? Your thoughts on this please..

Support for SSML?

Hi, I was wondering if this project supports Speech Synthesis Markup Language (SSML)
For Kanji characters, there may be more than one reading for a character (生 can be なま or せい, etc) and I want to be able to have it use the intended pronunciation.
I've tried it on the live site and it doesn't seem to be supported but I was wondering if I maybe just got the syntax wrong
Anways, thanks so much for your work on this!
I'm currently using it on my own Blazor Project and it works really well :)

Doesn't work on iOS on mobile devices.

Server side Blazor app. Doesn't work with iOS (Safari or Chrome) on mobile (phone / tablet). Not sure if it works on a Mac (ie desktop).

Works fine on Android phone/ tablet.
Works fine on Windows desktop.

Haven't tried clientside Blazor (ie WASM)... does clientside work on iOS mobile devices?

Setting the language in the utterance is ignored on android browsers

When you set the language/locale in the utterance as

var utterance = new SpeechSynthesisUtterance { Text = frenchText, Lang = "fr-FR" };

This works on windows, but it is ignored in Android for both Chrome and Edge/Chrome browsers. Tested with Blazor .Net 7. By default, both browsers will use the system locale of your mobile device.

Methods to get this working can be found here: https://learn.microsoft.com/en-us/aspnet/core/blazor/globalization-localization?view=aspnetcore-7.0&preserve-view=true

If the answer is, "works on .Net 8", that's awesome, but I just don't have a way to test that right now.

Loading voices not working on Android 11

When I load your sample website on my Android 11 phone, I get "An unhandled error has occurred." It works on Windows Desktop and iOS.

I made a simplified version of your sample website with only:

  • Voice selection dropdown
  • Text input
  • Button to initiate speaking

It works on Windows Desktop (Edge) but I get the same error on my Android device. (Unfortunately I haven't figured out how to debug this on Android yet.)

Note: If I leave off the dropdown for selecting voices and just call SpeechSynthesis.speak with text when I click the Speak button, it speaks (with the default voice).

[Thanks for a great library! I'm just starting out with Blazor and this is one of the first things I wanted to do.]

When Blazor Is Initialized, and you want to let the user know, "Speak" not working

What I am trying to do is to alert the user when the Blazor Application is running in their browser, and this is not working. Stepping through the code, it is executing the code, but not working until you come back to the page.

The following are the steps to reproduce:

After adding a new Blazor Wasm application, installing this library, and then updating the "Index.razor" page to:

@using Toolbelt.Blazor.SpeechSynthesis @{/* Add these two lines. */}
@inject SpeechSynthesis SpeechSynthesis
@page "/"

<PageTitle>Index</PageTitle>

<h1>Hello, world!</h1>

Welcome to your new app.

<SurveyPrompt Title="How is Blazor working for you?" />

@code {

    string Text1 = "Hello From the Blazor application's Home page";
    string Text2 = "Welcome back to the Blazor application's Home page";

    protected override void OnAfterRender(bool firstRender)
    {
        if (firstRender)
        {
            this.SpeechSynthesis.Speak(this.Text1); // <-- Speak!
            this.SpeechSynthesis.Speak(this.Text1); // <-- Speak!
            this.SpeechSynthesis.Speak(this.Text1); // <-- Speak!
        }
        else
        {
            this.SpeechSynthesis.Speak(this.Text2); // <-- Speak!
        }
    }
}

You can only here the message when you come back to the page. In addition, "firstRender" seems to be true when going back to the page. Likewise if you refresh the page, you get the same behavior. So, this may be a Blazor issue or both.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.