Giter Site home page Giter Site logo

braceyourselfgames / ue-bygtexttospeech Goto Github PK

View Code? Open in Web Editor NEW
20.0 1.0 4.0 2.44 MB

A plugin that uses the Windows Speech API to speak text in Unreal Engine 4.

License: BSD 3-Clause "New" or "Revised" License

C# 3.15% C++ 94.85% C 0.36% Batchfile 1.64%
ue4 ue4-plugin unreal unreal-engine-4 unreal-engine cpp sapi text-to-speech accessibility gamedev game-development

ue-bygtexttospeech's Introduction

BYG Text to Speech

A plugin for Unreal Engine that wraps Windows accessibility text-to-speech functionality.

Unreal 5.0 Note

Note that as of Unreal 5.0, there is an Experimental Text-to-Speech plugin included that is made by Epic. It supports Windows, Mac, Linux, iOS and Android. On Windows it uses Flite. I would recommend considering it instead of this plugin.

Note Before Using

This project is aimed at adding text-to-speech for accessibility. It will only work on Windows PCs that have text-to-speech language packs already installed.

It is not suitable for general text-to-speech in games, e.g. "I want it to speak this text on all machines, because I want all players to hear the spoken voice." It will only work for players that have the text-to-speech language packs installed.

Features

  • Automatically read text under the cursor using UE4's built-in GetAccessibleText().
  • Blueprint functions for creating USoundWave instances from text.
  • Settings for voice, speed, volume.
  • Detects all installed voices.
  • Can handle large amounts of text without hitches (runs asynchronously, splits up long sentences).

Installation

  1. Download the zip or clone the repository to ProjectName/Plugins/BYGTextToSpeech.
  2. Add BYGTextToSpeech to .uproject file
  3. Add BYGTextToSpeech to PrivateDependencyModuleNames inside ProjectName.Build.cs.
  4. Install ATL dependencies through Visual Studio. Run the Visual Studio 2019 installer and under Individual Modules make sure that "C++ ATL for latest v142 build tools (x86 & x64) is checked". Check the path in BYGTextToSpeech.Build.cs is pointing to where they are installed (see FAQ for details)
  5. Make sure that you have voices installed on your PC. Under Windows settings search for Speech. At the bottom under Manage Voices ensure that you have voices installed for the languages you wish to use.

Usage

Settings

Global default settings are exposed under Project Settings > Plugins > BYG Text to Speech.

C++

UBYGTextToSpeechSubsystem* TextToSpeech = Cast<UBYGTextToSpeechSubsystem>( GetWorld()->GetSubsystemBase( UBYGTextToSpeechSubsystem::StaticClass() ) );
if ( TextToSpeech )
{
    TextToSpeech->SetIsEnabled( true );
    TextToSpeech->SetAutoReadOnHoverEnabled( true );
    TextToSpeech->SetVolumeMultiplier( 1.0f );
    TextToSpeech->SetSpeed( 1.0f );
}

Blueprints

Check the BYG Text to Speech category for functionality.

Most functionality is accessible through the BYG Text to Speech Subsystem.

Limitations

  • Windows only.
  • Requires users to have voice packs installed for the language(s) they wish to use.

Unreal Version Support

  • Checked with 4.25 and 4.26.
  • Compiles with 5.0EA but not tested, sorry!

FAQ

Q: I get the error "Cannot open include file: 'atlbase.h': No such file or directory"

It's possible that the AtlmfcFolder variable inside BYGTextToSpeech.Build.cs is pointing to the wrong place.

To find where it is installed on your machine, search inside C:\Program Files (x86)\Microsoft Visual Studio\ for atlbase.h. Then change the path inside BYGTextToSpeech.Build.cs to match.

Q: Does this work on Linux/Mac/iOS/Android?

No, it only works on Windows, and only if the player has the text-to-speech language packs installed.

License

Contact

ue-bygtexttospeech's People

Contributors

benui-dev avatar

Stargazers

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

Watchers

 avatar

ue-bygtexttospeech's Issues

Voice Id not set.

I am getting voice ID not set in the console, any idea what should i put there?

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.