24
2024
Use TikTok-TTS in Unity (with WebRequest)
Was watching some weird physics based game developed at https://www.twitch.tv/clayman_dev and they used node.js+tiktok TTS to play funny text-to-speech sounds!
Then found this library, https://github.com/Steve0929/tiktok-tts
(took a while to get it working as node.js, due to sessionid+server mismatch, but posted solution here https://github.com/Steve0929/tiktok-tts/issues/17 )
Then “converted” it to Unity.. (*not much to convert, it is just a Webrequest (POST) and few header values.. problem is that if you post wrong data, it just says “404”, so you don’t know whats the issue..
Initially tried to get this working https://docs.unity3d.com/ScriptReference/Networking.UnityWebRequestMultimedia.GetAudioClip.html but then checked original node.js sources, where it uses POST request, instead of GET.. so that was the main issue! (and setting cookie to getrequest was probably initially wrong,
Check repo source & instructions for getting tiktok sessionid+server:
https://github.com/unitycoder/tiktok-tts-unity
Sample audio:
https://soundcloud.com/user-689598301/tiktok-tts-sample
making of / struggling video:
*This is not their official API, so it could be closed anytime or the servers might change..
Related Posts
Leave a comment
Recent posts
- [GreaseMonkey] Unity Forum Fixer
- UnityHub: Make Hub application background Translucent
- Customize SpriteShapeRenderer quality (but has issues)
- Editor tool: Copy selected gameobject’s names into clipboard as rows (for Excel)
- Editor tool: Replace string in selected gameobject’s names
- UnityHub: Enable built-in Login Dialog (no more browser login/logout issues!)
- Use TikTok-TTS in Unity (with WebRequest)
- Create Scene Thumbnail Image using OnSceneSaved & OnPreviewGUI
- webgl+javascript TTS
- Using Moonsharp (LUA) + Unity Webgl
- Using 3D gameobject prefabs with Unity Tilemap + NavMesh Surface
- Custom Unity Hub Project Template Preview Image/Video (using HTML+CSS in package description)
Recent Comments
- Vector3 maths for dummies! on
- UnityHub: Make Hub application background Translucent on
- UnityHub: Make Hub application background Translucent on
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub) on
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub) on
- [Asset Store] Point Cloud Viewer & Tools on
- [Asset Store] Point Cloud Viewer & Tools on
- ffmpeg stream raw video into Unity Texture2D on