Skip to content

Commit

Permalink
Updated Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
oslindstrm committed Sep 9, 2019
1 parent 0773745 commit a1a4179
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 13 deletions.
49 changes: 38 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,63 @@
# charisma-sdk-unity
Unity SDK for Charisma.ai

If you have any questions or issues, please contact me at; oscar@charisma.ai
If you have any questions or issues, please contact me at: oscar@charisma.ai

<h2> 1. Importing / Installing </h2>
### 1. Importing / Installing

Download the contents of this repo, extract it to a folder of your choice and then import the folder to your Unity Project

<h2> 2. Settings </h2>
### 2. Settings

In the resources folder within the CharismaSDK, there is a file named Charisma Settings. This file contains all the information the plugin will use to interface with Charisma. Setting this file up correctly is important. This file needs to be referenced somewhere
in your project for the settings to be properly loaded. After that, they can be referenced anywhere from within your scripts through the "Instance" property.
in your project for the settings to be loaded properly. After that, they can be referenced anywhere from within your scripts through the "Instance" property.

<b> 2.a StoryId </b>
The following sections describe what each of the separate fields are for.

**2.a StoryId**

The Id of the story that you want to play. Each story has a unique Id. Navigate to the Charisma website, click the story you want to play from Unity. The story id can be found in the URL in the following location:
"https://charisma.ai/stories/>storyId<".


![StoryId](https://i.ibb.co/sPqS9n2/StoryId.png)

* **2.b Story Version**

This is the version of the story you want to play.

* To play the latest published version, keep this at 0.

* To play a specific, published, version of your story, set the number to that particular version.

The story that you want to play. The story id can be found in the URL in the following location;
"https://charisma.ai/stories/<StoryId>"
* To play the draft version, set the number to -1. To do this, you must also supply a Debug Token. More on how to get your Debug Token below.

<b> 2.b AudioConfig </b>
**2.c AudioConfig**

The output format of the audio received from Charisma. the default audio format is Ogg.
Unless there are specific requirements that mean the format has to be Wav, I recommend keeping it as Ogg.

Audio can be received both as an audio clip (buffer) and a URL.

<b> 2.c Token </b>
**IMPORTANT:** Wav files can only be generated on Windows. Having this option selected on any other platform will result in an error.

If you want to debug your draft version (Unpublished), the StoryId needs to be set to -1 and "IsDebugging" checked.
**2.d Debug Token**

If you want to debug your draft version (Unpublished), the Story Version needs to be set to -1 and "IsDebugging" checked.
You also need to retrieve your token from the Charisma website. To do this, go the Charisma website, right-click to inspect the site,
navigate to storage and copy the access token to the "Debug token"-field.

<h2> 3. Example </h2>
**IMPORTANT:** This token renews every month or so. If you are having trouble accessing your draft version, check if the token has been renewed.

![Token](https://i.ibb.co/hfJk0H7/Token.png)

## 3. Example

I've created a small example for you to be able to understand how the startup flow works. To test it out, run the example scene.
The script itself can be found in the example folder as well.

## 4. Known Issues (v0.01)

* Some character voices do not convert to audio files properly, resulting in an FMOD error. The voices concerned are all named after Game of Thrones characters. Please avoid using these voices for the time being.


7 changes: 7 additions & 0 deletions README.md.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Scripts/AudioConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class AudioConfig
{
public enum Encoding
{
Mp3,
Wav,
Ogg
}

Expand Down Expand Up @@ -38,7 +38,7 @@ public string AudioEncoding
{
switch (_encoding)
{
case Encoding.Mp3:
case Encoding.Wav:
return "mp3";
case Encoding.Ogg:
return "ogg";
Expand Down

0 comments on commit a1a4179

Please sign in to comment.