|
8 | 8 | --- |
9 | 9 |
|
10 | 10 | ## Overview |
11 | | -This project integrates OpenAI's Text-to-Speech API into a Unity application, allowing users to convert and synthesize text to spoken audio within Unity via any AudioSource component. |
12 | | -Tested with Unity version 2022.3.13f1. |
| 11 | +This project integrates OpenAI's Text-to-Speech API into any Unity project, allowing users to convert and synthesize text to spoken audio via any AudioSource component within seconds. |
13 | 12 |
|
14 | | -## Demo Video |
15 | | -https://github.com/mapluisch/OpenAI-Text-To-Speech-for-Unity/assets/31780571/29c19c4f-8d7a-40e2-bc4e-c7b7337520e2 |
| 13 | +It *does not use third-party libraries*, making it super lightweight and easy to use cross-platform. |
| 14 | + |
| 15 | +### What's new in v.1.1. |
| 16 | +- Added a new custom editor script for easily setting up TTS within your Unity project (see demo videos below) |
| 17 | + |
| 18 | +## Demos |
| 19 | + |
| 20 | +Once you've installed this project, setting up OpenAI's TTS within Unity takes seconds. |
| 21 | + |
| 22 | +Integrate this project (either in your existing project, or in a fresh one), then open up the `TTS Setup` Prefab and click through the steps, as shown in this demo: |
| 23 | + |
| 24 | +https://github.com/mapluisch/OpenAI-Text-To-Speech-for-Unity/assets/31780571/e6dc69b9-d0b5-4af5-9844-5d336551cf10 |
| 25 | + |
| 26 | +I've also added a quick UI example scene, so you can tinker around with some TTS settings easily: |
| 27 | + |
| 28 | +https://github.com/mapluisch/OpenAI-Text-To-Speech-for-Unity/assets/31780571/aadf35dc-453e-4f55-8930-f9169e3b185e |
16 | 29 |
|
17 | 30 | ### Setup |
18 | | -1. Download the latest release `.unitypackage`. |
19 | | -2. Import it into your own project, e.g. via `Assets > Import Package`. |
20 | | -3. Either open the `OpenAI-TTS-Example` scene, or add the necessary Prefabs to your own scene: |
| 31 | +0. Download the latest release `.unitypackage`. |
| 32 | +1. Import it into your own project, e.g. via `Assets > Import Package`. |
| 33 | +2. Either open the `OpenAI-TTS-Example` scene, or open up the `TTS Setup` Prefab and click through the installation steps. |
| 34 | +- Optional: Change the `TTSManager` Prefab settings to your liking (useful if you want to have different entities with predefined voices, speeds, etc.) |
| 35 | +3. Reference the `TTSManager` and call `TTSManager.SynthesizeAndPlay` via script. |
21 | 36 |
|
22 | 37 | ### Using OpenAI TTS in your own scene |
23 | | -1. Add `OpenAI` and `TTSManager` Prefabs to your scene. |
24 | | -2. Add your OpenAI API key to the OpenAI-Prefab. |
| 38 | +0. Open up the `TTS Setup` Prefab. |
| 39 | +1. Add your OpenAI API key first, then click through the installation steps. |
25 | 40 | - Optional: Change the `TTSManager` Prefab settings to your liking (useful if you want to have different entities with predefined voices, speeds, etc.) |
26 | | -3. Call `TTSManager.SynthesizeAndPlay` of your `TTSManager` object. |
| 41 | +2. Reference a `TTSManager` and call `TTSManager.SynthesizeAndPlay` via script. |
27 | 42 |
|
28 | 43 | ### Disclaimer |
29 | | -This project is a prototype and serves as a basic example of integrating OpenAI's TTS API with Unity. Feel free to create a PR. |
| 44 | +This project is a prototype and serves as a basic example of integrating OpenAI's TTS API with Unity. Feel free to create a PR 😊 |
0 commit comments