{"id":21191929,"url":"https://github.com/edgeimpulse/example-transform-text-to-speech","last_synced_at":"2026-02-17T14:33:03.047Z","repository":{"id":104673005,"uuid":"537439910","full_name":"edgeimpulse/example-transform-text-to-speech","owner":"edgeimpulse","description":"Use Google text-to-speech API to generate new keywords","archived":false,"fork":false,"pushed_at":"2025-02-10T10:06:25.000Z","size":41,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-10T22:26:37.580Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause-clear","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/edgeimpulse.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,"zenodo":null}},"created_at":"2022-09-16T12:03:20.000Z","updated_at":"2025-02-10T10:06:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"677d1d1c-5df6-452a-a2b2-9405b15163a2","html_url":"https://github.com/edgeimpulse/example-transform-text-to-speech","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/edgeimpulse/example-transform-text-to-speech","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edgeimpulse%2Fexample-transform-text-to-speech","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edgeimpulse%2Fexample-transform-text-to-speech/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edgeimpulse%2Fexample-transform-text-to-speech/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edgeimpulse%2Fexample-transform-text-to-speech/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edgeimpulse","download_url":"https://codeload.github.com/edgeimpulse/example-transform-text-to-speech/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edgeimpulse%2Fexample-transform-text-to-speech/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29547420,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T14:33:00.708Z","status":"ssl_error","status_checked_at":"2026-02-17T14:32:58.657Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-11-20T19:06:20.544Z","updated_at":"2026-02-17T14:33:03.015Z","avatar_url":"https://github.com/edgeimpulse.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Text to speech transform block\n\nThis is a transformation block that adds words or short sentences to your Edge Impulse project.\n\n## How to run (Edge Impulse)\n\n1. You'll need a Google Cloud API key:\n    * Enable the TTS API for your account: https://cloud.google.com/nodejs/docs/reference/text-to-speech/latest#before-you-begin\n    * Create an API Key: https://cloud.google.com/docs/authentication/api-keys\n\n2. Add the API key as a secret to your Edge Impulse organization:\n    1. Go to your Edge Impulse organization.\n    2. Click **Custom blocks \u003e Transformation**\n    3. Click **Add new secret**\n    4. Set as name: `GOOGLE_CLOUD_TTS_API_KEY`, as value the API Key you created in step 1.\n\n3. Create a new transformation block:\n\n    ```\n    $ edge-impulse-blocks init\n\n    ? Choose a type of block Transformation block\n    ? Choose an option Create a new block\n    ? Enter the name of your block Google Cloud text-to-speech\n    ? Enter the description of your block Use Google Cloud's TTS API to generate new keywords. Takes in --keyword, --label, --lang and --count\n    ? What type of data does this block operate on? Standalone (runs the container, but no files / data items passed in)\n    ? Which buckets do you want to mount into this block (will be mounted under /mnt/s3fs/BUCKET_NAME, you can change these mount points in the St\n    udio)?\n    ? Would you like to download and load the example repository? no\n    ```\n\n4. Push the block:\n\n    ```\n    $ edge-impulse-blocks push\n    ```\n\n5. Now, you can add data to your project via:\n\n    1. Go to your Edge Impulse project.\n    2. Select **Data sources \u003e Add new data source**\n    3. Select *Transformation block*, *Google Cloud text-to-speech*, and set your arguments, e.g.:\n\n        ```\n        --keyword \"Hello world\" --lang nl-NL,en-US --count 100 --label helloworld\n        ```\n\n    4. Run the data source, then remove the data source again.\n\n## How to run locally\n\n1. You'll need a Google Cloud API key:\n    * Enable the TTS API for your account: https://cloud.google.com/nodejs/docs/reference/text-to-speech/latest#before-you-begin\n    * Create an API Key: https://cloud.google.com/docs/authentication/api-keys\n\n2. Create a file called `set-env.sh` and set:\n\n    ```\n    export EI_PROJECT_ID=12009\n    export EI_PROJECT_API_KEY=ei_...\n    export EI_API_ENDPOINT=https://studio.edgeimpulse.com\n    export EI_INGESTION_HOST=edgeimpulse.com\n    export GOOGLE_CLOUD_TTS_API_KEY=AI...\n    ```\n\n3. Then, source the environment variables and run the script:\n\n    ```\n    source set-env.sh\n    node tts.js --keyword \"Hello world\" --lang nl-NL,en-US --count 10 --label helloworld\n    ```\n\n    You'll find your files in `out-wav/`.\n\n4. Upload the files to your project via:\n\n    ```\n    edge-impulse-uploader --api-key $EI_PROJECT_API_KEY out-wav/*.wav\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedgeimpulse%2Fexample-transform-text-to-speech","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedgeimpulse%2Fexample-transform-text-to-speech","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedgeimpulse%2Fexample-transform-text-to-speech/lists"}