{"id":36891878,"url":"https://github.com/charisma-ai/charisma-sdk-js","last_synced_at":"2026-01-12T15:37:58.884Z","repository":{"id":38173718,"uuid":"124551029","full_name":"charisma-ai/charisma-sdk-js","owner":"charisma-ai","description":"Charisma.ai SDK for Javascript (browser)","archived":false,"fork":false,"pushed_at":"2025-08-13T15:03:54.000Z","size":1782,"stargazers_count":12,"open_issues_count":11,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-13T16:59:43.812Z","etag":null,"topics":["ai","digital-humans","javascript","machine-learning","nlp","storytelling","virtual-beings"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/charisma-ai.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2018-03-09T14:30:11.000Z","updated_at":"2025-08-13T15:03:58.000Z","dependencies_parsed_at":"2024-11-28T14:04:09.206Z","dependency_job_id":null,"html_url":"https://github.com/charisma-ai/charisma-sdk-js","commit_stats":{"total_commits":321,"total_committers":3,"mean_commits":107.0,"dds":0.04672897196261683,"last_synced_commit":"d7159506a6a19ac1a61dd45faaba0c72726fd099"},"previous_names":["benhjames/charisma-sdk-js"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/charisma-ai/charisma-sdk-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charisma-ai%2Fcharisma-sdk-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charisma-ai%2Fcharisma-sdk-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charisma-ai%2Fcharisma-sdk-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charisma-ai%2Fcharisma-sdk-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/charisma-ai","download_url":"https://codeload.github.com/charisma-ai/charisma-sdk-js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charisma-ai%2Fcharisma-sdk-js/sbom","scorecard":{"id":274150,"data":{"date":"2025-08-11","repo":{"name":"github.com/charisma-ai/charisma-sdk-js","commit":"b1bf34059af382d07f8a9c23f490bdccd694345c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/run-tests.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":10,"reason":"16 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":1,"reason":"Found 1/9 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run-tests.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/charisma-ai/charisma-sdk-js/run-tests.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/run-tests.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/charisma-ai/charisma-sdk-js/run-tests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run-tests.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/charisma-ai/charisma-sdk-js/run-tests.yml/main?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 24 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"26 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-67mh-4wv8-2f99","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-64vr-g452-qvp3","Warn: Project is vulnerable to: GHSA-9cwx-2883-4wfx","Warn: Project is vulnerable to: GHSA-vg6x-rcgg-rjx6","Warn: Project is vulnerable to: GHSA-x574-m823-4x7w","Warn: Project is vulnerable to: GHSA-4r4m-qw57-chr8","Warn: Project is vulnerable to: GHSA-xcj6-pq6g-qj4x","Warn: Project is vulnerable to: GHSA-356w-63v5-8wf4","Warn: Project is vulnerable to: GHSA-859w-5945-r5v3","Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-h5c3-5r3r-rr8q","Warn: Project is vulnerable to: GHSA-rmvr-2pp2-xj38","Warn: Project is vulnerable to: GHSA-xx4v-prfh-6cgc","Warn: Project is vulnerable to: GHSA-xq7p-g2vc-g82p","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-7hpj-7hhx-2fgx","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T14:03:21.962Z","repository_id":38173718,"created_at":"2025-08-17T14:03:21.962Z","updated_at":"2025-08-17T14:03:21.962Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28341112,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["ai","digital-humans","javascript","machine-learning","nlp","storytelling","virtual-beings"],"created_at":"2026-01-12T15:37:58.124Z","updated_at":"2026-01-12T15:37:58.879Z","avatar_url":"https://github.com/charisma-ai.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Charisma.ai SDK for JavaScript\n\n```\npnpm i @charisma-ai/sdk\n```\n\n## Usage\n\n```js\n// main.js\nimport {\n  Playthrough,\n  createPlaythroughToken,\n  createConversation,\n} from \"@charisma-ai/sdk\";\n\nlet conversation;\n\nasync function start() {\n  // Get a unique token for the playthrough.\n  const { token } = await createPlaythroughToken({ storyId: 4 });\n\n  // Create a new conversation.\n  const { conversationUuid } = await createConversation(token);\n\n  // Create a new playthrough.\n  const playthrough = new Playthrough(token);\n\n  // Join the conversation.\n  conversation = playthrough.joinConversation(conversationUuid);\n\n  // Handle messages in the conversation.\n  conversation.on(\"message\", (message) =\u003e {\n    console.log(message.message.text);\n  });\n\n  conversation.on(\"problem\", console.warn);\n\n  // Prepare the listener to start the conversation when the playthrough is connected.\n  playthrough.on(\"connection-status\", (status) =\u003e {\n    if (status === \"connected\") {\n      conversation.start();\n    }\n  });\n\n  await playthrough.connect();\n}\n\n// Send the reply to charisma.\nfunction reply(message) {\n  conversation.reply({ text: message });\n}\n```\n\n## API Reference\n\nThere are two ways to use the API directly, either by importing `api`, which includes all the API methods, or you can import API methods individually, like `createPlaythroughToken`.\n\n```js\nimport { api, createPlaythroughToken } from \"@charisma-ai/sdk\";\n\napi.createPlaythroughToken();\ncreatePlaythroughToken();\n```\n\nMost API methods are also callable using an instance of the `Playthrough` class, which automatically scopes the API calls to the playthrough `token` passed when creating the instance:\n\n```js\nconst playthrough = new Playthrough(token);\n// No need to pass `token` here!\nplaythrough.createConversation();\n```\n\n#### createPlaythroughToken\n\nUse this to set up a new playthrough.\n\n- `storyId` (`number`): The `id` of the story that you want to create a new playthrough for. The story must be published, unless a Charisma.ai user token has been passed and the user matches the owner of the story.\n- `version` (`number`, optional): The `version` of the story that you want to create a new playthrough for. If omitted, it will default to the most recent published version. To get the draft version of a story, pass `-1` and an `apiKey`.\n- `apiKey` (`string`, optional): To access draft, test or unpublished versions of your story, pass an `apiKey`. The API key can be found on the story overview page.\n- `languageCode` (`string`, optional): To play a story in a language other than English (`en`, the default), pass a BCP-47 `languageCode`. For example, to play in Italian, use `it`.\n\nReturns a promise that resolves with the token.\n\n```js\nconst { token } = await createPlaythroughToken({\n  storyId: 12,\n  version: 4,\n  apiKey: \"...\",\n  languageCode: \"en\",\n});\n```\n\n#### createConversation\n\nA playthrough can have many simultaneous conversations. In order to start interacting, a conversation needs to be created, which can then be joined.\n\n- `playthroughToken` (`string`): The token generated with `createPlaythroughToken`.\n\n```js\nconst { conversationUuid } = await createConversation(token);\n```\n\n## Playthrough\n\nCreate a new `Playthrough` instance to connect to a playthrough and interact with the chat engine.\n\n- `playthroughToken` (`string`): The `token` generated in `createPlaythroughToken`.\n\n#### Playthrough.joinConversation\n\nThis makes the `Playthrough` instance listen out for events for a particular conversation, and returns a `Conversation` that events can be called on and event listeners attached.\n\n- `conversationUuid` (`string`): The conversation UUID generated with `createConversation`.\n\nReturns a `Conversation`, which can be used to send and receive events bound to that conversation.\n\n```js\nplaythrough.joinConversation(conversationUuid);\n```\n\n#### Playthrough.connect\n\nThis is what kicks off the connection to the chat engine. Call this once you're ready to start sending and receiving events.\n\nReturns an object with a `playerSessionId` property.\n\n```js\nawait playthrough.connect();\n```\n\n#### Playthrough.disconnect\n\nIf you want to end the connection to the playthrough, you can call `playthrough.disconnect()`.\n\n```js\nplaythrough.disconnect();\n```\n\n## Events\n\nTo interact with the story, events are sent to and from the server that the WebSocket is connected to.\n\n### Events sent from client\n\n#### conversation.start({ ... })\n\n```js\n{\n  // For Pro stories, start the story at a particular subplot with the `startGraphReferenceId`.\n  // It can be found by clicking '...' next to the subplot in the sidebar, and clicking 'Edit details'.\n  // For Web Comic stories do not provide `startGraphReferenceId`, the story will start automatically from the first scene\n  \"startGraphReferenceId\": \"my-id\", // Optional, default undefined\n}\n```\n\n#### conversation.reply({ ... })\n\n```js\n{\n  \"text\": \"Please reply to this!\"\n}\n```\n\n#### conversation.tap({ ... })\n\nThis event has no fields.\n\n#### conversation.action({ ... })\n\n```js\n{\n  \"action\": \"pick-up-book\"\n}\n```\n\n#### conversation.resume({ ... })\n\nThis event has no fields.\n\n### Events received by client\n\n#### conversation.on('message', (event) =\u003e { ... })\n\n```js\n{\n  \"message\": {\n    \"text\": \"Greetings and good day.\",\n    \"character\": {\n      \"id\": 20,\n      \"name\": \"Ted Baker\",\n      \"avatar\": \"https://s3.charisma.ai/...\"\n    },\n    \"speech\": {\n      \"duration\": 203,\n      \"audio\": /* either a buffer, or a URL */,\n    }\n    \"metadata\": {\n      \"myMetadata\": \"someValue\"\n    },\n    \"media\": null\n  },\n  \"endStory\": false,\n  \"path\": [{ \"id\": 1, \"type\": \"edge\" }, { \"id\": 2, \"type\": \"node\" }]\n}\n```\n\n#### conversation.on('start-typing', () =\u003e { ... })\n\nThis event has no additional data.\n\n#### conversation.on('stop-typing', () =\u003e { ... })\n\nThis event has no additional data.\n\n#### conversation.on('action', (event) =\u003e { ... })\n\n#### conversation.on('reply', (event) =\u003e { ... })\n\n#### conversation.on('resume', (event) =\u003e { ... })\n\n#### conversation.on('start', (event) =\u003e { ... })\n\n#### conversation.on('tap', (event) =\u003e { ... })\n\nWhen another player sends specific events to a Charisma playthrough, they are sent back to all other connected players, so that other players can perform actions based on the events, such as displaying their messages in UI.\n\nThe events that are currently echoed to all clients are `action`, `reply`, `resume`, `start` and `tap`.\n\n**Important:** These events are **not** emitted for the player that sent the original corresponding event!\n\nEach event includes its committed `eventId` and `timestamp` as well as the original payload (excluding the `speechConfig`).\n\n#### conversation.on('problem', (event) =\u003e { ... })\n\nIf a problem occurs during a conversation, such as a pathway not being found after submitting a player message, `problem` will be emitted.\n\n### Conversation helpers\n\n#### conversation.setSpeechConfig(config)\n\nThis sets the speech configuration to use for all events in the conversation until set otherwise:\n\n```json\n{\n  \"encoding\": [\"ogg\", \"mp3\"],\n  \"output\": \"buffer\"\n}\n```\n\n`encoding` is the file format of the resulting speech: `mp3`, `ogg`, `wav` or `pcm`. If an array, Charisma will use the first encoding that the voice supports, useful for cases where a voice synthesis service of a particular voice does not support the \"default\" encoding you wish to use.\n\n`output` determines whether the speech received back is a `buffer` (a byte array) or whether it should instead be a `url` pointing to the audio file.\n\n## AudioManager\n\nThe audio manager will handle the audio from characters, media and speech-to-text functionality.\n\n```js\nimport { AudioManager } from \"@charisma-ai/sdk\";\n\nconst audio = new AudioManager({\n  // AudioManager options\n  handleTranscript: (transcript: string) =\u003e {\n    console.log(transcript);\n  },\n});\n```\n\n#### AudioManager Options\n\n| Option             | Type                               | Default                     | Description                                                                                                                             |\n| ------------------ | ---------------------------------- | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --- |\n| `debugLogFunction` | `(message: string) =\u003e void`        | `() =\u003e {}`                  | Callback to handle log messages for debugging.                                                                                          |\n| `duckVolumeLevel`  | `number`                           | 0                           | Background audio volume level to use when ducking for microphone input (0 to 1).                                                        |     |\n| `handleConnect`    | `(message: string) =\u003e void`        | `console.log(message)`      | Callback to handle when the transcription service connects.                                                                             |\n| `handleError`      | `(error: string) =\u003e void`          | `console.error(error)`      | Callback to handle errors.                                                                                                              |\n| `handleDisconnect` | `(message: string) =\u003e void`        | `console.error(message)`    | Callback to handle when the transcription service disconnects.                                                                          |\n| `handleStartSTT`   | `() =\u003e void`                       |                             | Callback to handle when speech-to-text starts. Can be used to update the UI.                                                            |\n| `handleStopSTT`    | `() =\u003e void`                       |                             | Callback to handle when speech-to-text stops.                                                                                           |\n| `handleTranscript` | `(transcript: string) =\u003e void`     |                             | Callback to handle transcripts.                                                                                                         |\n| `streamTimeslice`  | `number`                           | 100                         | The number of milliseconds to record into each Blob. See https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/start#timeslice |\n| `sttService`       | `\"charisma/deepgram\" \\| \"browser\"` | `\"charisma/deepgram\"`       | Speech-to-text service to use (see below).                                                                                              |\n| `sttUrl`           | `string`                           | `\"https://stt.charisma.ai\"` | Speech-to-text service URL.                                                                                                             |\n\nThere are currently two speech-to-text services available:\n\n- `charisma/deepgram`: Deepgram is a neural network based speech-to-text service that that can be accessed through Charsima.ai.\n- `browser`: Some browsers have built-in speech recognition, which can be used to provide speech-to-text functionality. **This is only available in browsers that support `SpeechRecognition`. Please refer to [this browser compatibility table](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition#browser_compatibility) for more details.**\n\n### Speech-to-text\n\n#### audioManager.startListening(timeout?: number)\n\nStarts listening for speech. This will call handleStartSTT() when the speech-to-text service starts.\nTakes a `timeout` argument in milliseconds, which will automatically stop the speech-to-text service after the timeout. Defaults to 10000 (ten seconds) if not provided.\n\n#### audioManager.stopListening()\n\nStops listening for speech. This will call handleStopSTT() when the speech-to-text service stops.\n\n#### audioManager.connect(token: string, playerSessionId: string)\n\nConnects the to the speech-to-text service using the playthrough token and player session id to validate. This is only needed when using the `charisma/deepgram` speech-to-text service.\n\nThe `playerSessionId` is returned from `playthrough.connect()`. See the `deepgram-stt` demo for an example.\n\n#### audioManager.disconnect()\n\nDisconnects from the speech-to-text service.\n\n#### audioManager.resetTimeout(timeout: number)\n\nResets the timeout for the speech-to-text service to `timeout` in milliseconds. If this is not run, the speech-to-text service will default to a timeout of 10 seconds.\nAfter the timeout, the speech-to-text service will automatically stop listening.\n\n#### audioManager.browserIsSupported(): boolean\n\nReturns `true` if the browser supports the `browser` speech recognition service.\n\n### General Output\n\n#### audioManager.initialise()\n\nInitialises the audio for characters and media. This method _must_ be called before attempting to play audio from media nodes or character speech.\n\nThis method _must_ also be called from a user interaction event, such as a click or a keypress. This is due to a security restriction in some browsers (especially mobile). We recommend adding it to the \"start\" button the sets up your playthrough. See the demos for an example.\n\n### Character Audio\n\n#### audioManager.playCharacterSpeech(audio: ArrayBuffer, options: AudioOutputsServicePlayOptions): Promise\u003cvoid\u003e\n\nThis plays the generated speech in the message event. Typically, you would want to use this in combination with a `message` conversation handler.\n\nReturns a Promise that resolves once the speech has ended.\n\n`options` is an object with two properties:\n\n```ts\ntype SpeakerPlayOptions = {\n  /**\n   * Whether to interrupt the same track as the `trackId` passed (`track`), all currently playing audio (`all`), or not to interrupt anything (`none`). Default is `none`.\n   */\n  interrupt?: \"track\" | \"all\" | \"none\";\n  /**\n   * If you want to prevent a particular character to speak over themselves, a `trackId` can be set to a unique string. When playing another speech clip, if the same `trackId` is passed and `interrupt` is set to `true`, then the previous clip will stop playing. Default is unset.\n   */\n  trackId?: string;\n};\n```\n\n#### audioManager.characterSpeechVolume\n\nGet or set the volume of the character speech. Must be a number between 0 and 1.\n\n#### audioManager.characterSpeechIsMuted\n\nGet or set whether character speech is muted. Must be a boolean.\n\n### Media Track Audio\n\n#### audioManager.mediaAudioPlay(audioTracks: AudioTrack[]): void\n\nWill play the audio tracks in a message event. An empty array can also be passed here so it can be called on every message event.\n\n#### audioManager.mediaAudioVolume\n\nGet or set the volume of all non-character audio. Must be a number between 0 and 1.\n\n#### audioManager.characterSpeechIsMuted\n\nGet or set whether all non-character audio is muted. Must be a boolean.\n\n#### audioManager.mediaAudioStopAll()\n\nWill stop all media audio tracks.\n\n## Questions\n\nFor further details or any questions, feel free to get in touch at [hello@charisma.ai](mailto:hello@charisma.ai), or head to the [Charisma docs](https://charisma.ai/docs)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharisma-ai%2Fcharisma-sdk-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcharisma-ai%2Fcharisma-sdk-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharisma-ai%2Fcharisma-sdk-js/lists"}