Giter Site home page Giter Site logo

morganney / tts-react Goto Github PK

View Code? Open in Web Editor NEW
41.0 4.0 6.0 9.7 MB

Convert text to speech using React.

Home Page: https://morganney.github.io/tts-react/

License: MIT License

TypeScript 99.86% HTML 0.14%
htmlaudioelement react speechsynthesis speechsynthesisutterance text-to-speech aws-polly

tts-react's Introduction

tts-react's People

Contributors

dependabot[bot] avatar morganney avatar

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

Watchers

 avatar  avatar  avatar  avatar

tts-react's Issues

SyntaxError: Unexpected token 'export'

Thank you for creating this package!

I ran into this error whenever I refresh/re-render the webpage:
image

The error leads to this:
image

My code:
image

I'm using Next js & the latest tts-react.
image
image

It works again when I hide/unhide my TextToSpeech code, but throws the same error when I refresh the page.

Thank you!

MarkTextAsSpoken Issues

I am trying to get my text to be marked as spoken however even in the demo it doesn't always mark it. Could this be my device (Alienware x17 R2)? In the demo, on this device only the EN-US voice works with MarkTextAsSpoken.
Below is the code that I am using. I am using JS.

     <TextToSpeech
                    markTextAsSpoken
                    rate={".9"}
                    lang="en-GB"
                    autoPlay>
                    <p>How old are you?</p>
                </TextToSpeech>

How to config voice?

How to config voice?
any enum?

const CustomTTSComponent = ({ children, highlight = false }: CustomProps) => {
  const { ttsChildren, state, play, stop, pause } = useTts({
    children,
    markTextAsSpoken: highlight,
    lang: "zh-CN",
    autoPlay: true,
void: ?????
  });

  return (
    <div>
      <>
        <button disabled={state.isPlaying} onClick={play}>
          Play
        </button>
        <button disabled={!state.isPlaying} onClick={pause}>
          Pause
        </button>
        <button onClick={stop}>Stop</button>
      </>
      {ttsChildren}
    </div>
  );
};

How to combine with Microsoft Azure speech API?

The Microsoft AI voices are the best in the industry. They are natural sounding and have better cadence than the native WebSpeech Api. However, I am not able to highlight the currently playing word with microsoft-cognitiveservices-speech-sdk. How can I merge microsoft-cognitiveservices-speech-sdk with your package?

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.