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

Added TextToSpeechManager to support dynamic speech (request 2) #38

Closed
wants to merge 3 commits into from
Closed

Added TextToSpeechManager to support dynamic speech (request 2) #38

wants to merge 3 commits into from

Conversation

jbienzms
Copy link
Contributor

@jbienzms jbienzms commented May 13, 2016

This pull request contains the changes requested from the last pull request.

Namely:

  1. No longer using Singleton < T >
  2. Spelling corrected
  3. Regions Removed

I also added the ability to speak SSML, which I had left out of the previous
pull request.

Please note that the code for TextToSpeechManager is 100% new code by
me. However, portions of the Wav class were based on this sample:
http://answers.unity3d.com/questions/737002/wav-byte-to-audioclip.html

The author does release that code for others to use and I have
attributed the article in the class comments, but if this source
is not acceptable we will need to rewrite the WAV class.

Here are the steps for adding Text to Speech to your own apps:

  1. Create an AudioSource somewhere in the scene. I recommend creating it on an empty GameObject that is a child of the Main Camera and is positioned about 0.6 units above the camera.
  2. Add the TextToSpeechManager component to the scene.
  3. Assoicate the AudioSource with the manager.
  4. Obtain a reference to the TextTosSpeechManager by calling GetComponent on the GameObject where the script resides.
  5. Call TextToSpeechManager.SpeakText("Hello World");
  6. Alternatively call TextToSpeechManager.SpeakSsml("...");

jbienz added 2 commits May 3, 2016 16:23
…our instead of Singleton, fixed a spelling error, and regions were removed. Also added the ability to speak SSML which was omitted from the original submission.
@msftclas
Copy link

Hi @jbienzms, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!


It looks like you're a Microsoft contributor (Jared Bienz). If you're full-time, we DON'T require a Contribution License Agreement. If you are a vendor, please DO sign the electronic Contribution License Agreement. It will take 2 minutes and there's no faxing! https://cla.microsoft.com.

TTYL, MSBOT;

{
try
{
if (audioSource == null) { throw new InvalidOperationException("An AudioSource is required and should be assigned to 'Audio Source' in the inspector."); }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you trying to throw this out of the method or just use this as a means to log the error in your catch below?

…s. Corrected camel case of method name. Changed logging strategy from exception to direct logging. Completely removed WAV class and integrated conversion methods into the TextToSpeechManager.
@jbienzms
Copy link
Contributor Author

About to open attempt number 3. Closing this one.

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

Successfully merging this pull request may close these issues.

4 participants