{"id":27113130,"url":"https://github.com/acecentre/sapi-poc","last_synced_at":"2025-07-08T22:05:19.553Z","repository":{"id":246027937,"uuid":"816234932","full_name":"AceCentre/SAPI-POC","owner":"AceCentre","description":"Use a range of TTS systems in SAPI for Windows. A Pipe service, A register Voice GUI and dll that links with SAPI","archived":false,"fork":false,"pushed_at":"2024-10-03T06:36:03.000Z","size":561,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-07T02:49:49.110Z","etag":null,"topics":["sapi","tts"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AceCentre.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-17T10:15:23.000Z","updated_at":"2024-10-14T10:39:56.000Z","dependencies_parsed_at":"2024-06-25T13:00:02.047Z","dependency_job_id":"d8543f51-b6e3-492f-a8ce-9eaf91fa490b","html_url":"https://github.com/AceCentre/SAPI-POC","commit_stats":null,"previous_names":["acecentre/sapi-poc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AceCentre/SAPI-POC","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AceCentre%2FSAPI-POC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AceCentre%2FSAPI-POC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AceCentre%2FSAPI-POC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AceCentre%2FSAPI-POC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AceCentre","download_url":"https://codeload.github.com/AceCentre/SAPI-POC/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AceCentre%2FSAPI-POC/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264357296,"owners_count":23595576,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["sapi","tts"],"created_at":"2025-04-07T02:49:51.035Z","updated_at":"2025-07-08T22:05:19.531Z","avatar_url":"https://github.com/AceCentre.png","language":"C++","readme":"## SAPI-Bridge\r\n\r\n## What are we trying to do?\r\n\r\n- Create a SAPI engine\r\n- No synth directly in the dll. Pass all speak calls - infact all calls for other methods to a pipe service (see VoiceServer)\r\n\r\nSo to be clear\r\n- Have a pipe service running in the background which deals with all sapi calls\r\n- A GUI \"Register your voice\" app (see VoiceServer/RegisterVoice)\r\n- A SAPI Dll that is registered in windows which for all purposes to windows works as a sapi system but redirects to a pipe service\r\n\r\n## Why like this? Why not build all on the dll?\r\n\r\nBecause some TTS systems we are using have really slow cold-start times to call each time. Take for example sherpa-onnx models. Its far faster to hold the client object in memory and next synth streaming calls are faster\r\n\r\n## Are you sure? There are going to be loads of methods you cant support\r\n\r\nFor sure - we arent totally sure. Infact we can do lots to improve coldstart times - but we already have most of the service code working and a pretty decent tts-wrapper that allows us to do synth streaming calls across a wide range of speech engines that are on and offline. \r\n\r\nFor all the methods - you are right - we are going to struggle to do things like wordEvents for all engines. But for some we already have this (https://github.com/willwade/tts-wrapper?tab=readme-ov-file#feature-set-overview)\r\n\r\n## What was your code originally doing here\r\n\r\nWe built a simple proof of concept to build a SAPI dll and integrate it into python. Its a total PITA to build and - we figured why not just abstract this and remove the python headaches. Redirect to a pipe service..\r\n\r\n**WE HAVENT MIGRATED AWAY FROM THIS DLL CODE MUCH - INFACT IT JUST DOESNT WORK**\r\n\r\n\r\n** So what should this dll do?**\r\n\r\n1. Register as a SAPI engine\r\n2. When voices call this engine it redirects speak calls - and other callls it can support to a pipe service\r\n3. We should safely pass on calls we cant support\r\n\r\n** How could/should we test this?**\r\n\r\nUse https://www.cross-plus-a.com/balabolka.htm and see if the voices get registered (they do now) but they dont speak\r\n\r\n\r\n\r\nSo what follows below is specific code details on the DLL part.. \r\n\r\n\r\n# Building\r\n\r\nUse Visual Studio  to build the project. The project is a CMake project, so you can use CMake to generate the Visual Studio solution file\r\nSo the build process is as follows:\r\n\r\n1. Download opensource jsoncpp.\r\n2. Build jsoncpp.lib and jsoncpp.dll\r\n3. Link jsoncpp.lib and dll to pysapittsengine project.\r\n4. Then build the pysapittsengine.dll\r\n\r\n\r\n```\r\ncd engine\r\nmkdir build\r\ncd build\r\ncmake ..\r\ncmake --build . --config Debug\r\ncmake --build . --config Release\r\n```\r\n\r\n# Registering engine (run as Administrator)\r\n```\r\nregsvr32.exe pysapittsengine.dll\r\n```\r\n\r\n# Registering voice (run as Administrator)\r\n```\r\nregvoice.exe --token PYTTS-AzureNeural --name \"Azure Neural\" --vendor Microsoft --path C:\\Work\\SAPI-POC;C:\\Work\\build\\venv\\Lib\\site-packages --module voices --class AzureNeuralVoice\r\n```\r\n\r\nOr use the GUI to register voices.\r\nSee VoiceServer/README.md for more information.\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facecentre%2Fsapi-poc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facecentre%2Fsapi-poc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facecentre%2Fsapi-poc/lists"}