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
- Testing Unity AI Beta
- Ways to Support UnityCoder Development
- Using UI Slider to Create 5-Star Rating Element
- Game Music Library For Unity (editor plugin)
- Fontastic : Easily Test Fonts in Unity Editor!
- GeoTiff Importer & Terrain Generator for Unity
- Create Baked DropShadow for UI images
- .JP2 Ortho Image Converter to PNG/JPG/TIFF
- Convert LAS/LAZ/PLY pointclouds to GLTF (GLB) Point Meshes (standalone converter)
- Detect SRP (URP or HDRP) with Assembly Definition Version Defines
- [LudumDare57] Theme: Depths
- MotionVector Effect: Object “disappears” when paused
Recent Comments
- on [Asset Store] PolygonCollider2D Optimizer
- on Trajectory Test Scene 2.0
- on Vector3 maths for dummies!
- on UnityHub 3.6.0: Remove Version Control & Cloud Dashboard columns
- on Using RenderDoc with Unity (graphics debugger)
- on UI Scroll View automatic Content height
- on [Asset Store] Point Cloud Viewer & Tools
- on [Asset Store] Point Cloud Viewer & Tools
Coin:
CUgDSbRqFcAumDSAcdKDvuXsw26VdkJe8C8WGUQHBAGS
An article by











