{"id":4660,"url":"https://github.com/naoufal/react-native-speech","last_synced_at":"2025-04-05T19:12:43.661Z","repository":{"id":33397189,"uuid":"37042261","full_name":"naoufal/react-native-speech","owner":"naoufal","description":"A text-to-speech library for React Native.","archived":false,"fork":false,"pushed_at":"2017-05-27T00:31:22.000Z","size":13,"stargazers_count":304,"open_issues_count":26,"forks_count":52,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-29T17:08:20.370Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-native-speech","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"wordpress-mobile/WordPress-iOS","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/naoufal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-08T02:40:51.000Z","updated_at":"2024-08-30T19:50:05.000Z","dependencies_parsed_at":"2022-07-13T11:50:32.728Z","dependency_job_id":null,"html_url":"https://github.com/naoufal/react-native-speech","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naoufal%2Freact-native-speech","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naoufal%2Freact-native-speech/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naoufal%2Freact-native-speech/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naoufal%2Freact-native-speech/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/naoufal","download_url":"https://codeload.github.com/naoufal/react-native-speech/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247386265,"owners_count":20930619,"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":[],"created_at":"2024-01-05T20:17:19.380Z","updated_at":"2025-04-05T19:12:43.629Z","avatar_url":"https://github.com/naoufal.png","language":"Objective-C","funding_links":[],"categories":["Components","\u003ca name=\"Network:-Native-Modules\"\u003eNetwork: Native Modules\u003c/a\u003e"],"sub_categories":["Media"],"readme":"# React Native Speech\n\n[![npm version](https://img.shields.io/npm/v/react-native-speech.svg?style=flat-square)](https://www.npmjs.com/package/react-native-speech)\n[![npm downloads](https://img.shields.io/npm/dm/react-native-speech.svg?style=flat-square)](https://www.npmjs.com/package/react-native-speech)\n[![Code Climate](https://img.shields.io/codeclimate/github/naoufal/react-native-speech.svg?style=flat-square)](https://codeclimate.com/github/naoufal/react-native-speech)\n\nReact Native Speech is a text-to-speech library for [React Native](https://facebook.github.io/react-native/).\n\n## Documentation\n- [Install](https://github.com/naoufal/react-native-speech#install)\n- [Usage](https://github.com/naoufal/react-native-speech#usage)\n- [Example](https://github.com/naoufal/react-native-speech#example)\n- [Methods](https://github.com/naoufal/react-native-speech#methods)\n- [License](https://github.com/naoufal/react-native-speech#license)\n\n## Install\n```shell\nnpm i --save react-native-speech\n```\n\n## Usage\n### Linking the Library\nIn order to use Speech, you must first link the library your project.  There's excellent documentation on how to do this in the [React Native Docs](https://facebook.github.io/react-native/docs/linking-libraries.html#content).\n\n### Speaking an Utterance\nOnce you've linked the library, you'll want to make it available to your app by requiring it:\n\n```js\nvar Speech = require('react-native-speech');\n```\n\nSpeaking an utterance is as simple as calling:\n```js\nSpeech.speak({\n  text: 'React Native Speech is awesome!  I\\'m going to use it in my next project.',\n  voice: 'en-US'\n});\n```\n\n## Example\nUsing Speech in your app will usually look like this:\n```js\nvar Speech = require('react-native-speech');\n\nvar YourComponent = React.createClass({\n  _startHandler() {\n    Speech.speak({\n      text: 'Aujourd\\'hui, Maman est morte. Ou peut-être hier, je ne sais pas.',\n      voice: 'fr-FR'\n    })\n    .then(started =\u003e {\n      console.log('Speech started');\n    })\n    .catch(error =\u003e {\n      console.log('You\\'ve already started a speech instance.');\n    });\n  },\n\n  _pauseHandler() {\n    Speech.pause();\n  },\n\n  _resumeHandler() {\n    Speech.resume();\n  },\n\n  _stopHandler() {\n    Speech.stop();\n  },\n\n  render() {\n    return (\n      \u003cView\u003e\n        ...\n        \u003cButton onPress={this._startHandler}\u003e\n          Speak\n        \u003c/Button\u003e\n        \u003cButton onPress={this._pauseHandler}\u003e\n          Pause\n        \u003c/Button\u003e\n        \u003cButton onPress={this._resumeHandler}\u003e\n          Resume\n        \u003c/Button\u003e\n        \u003cButton onPress={this._stopHandler}\u003e\n          Stop\n        \u003c/Button\u003e\n      \u003c/View\u003e\n    );\n  }\n});\n```\n\n## Methods\n\n### speak(utterance)\nInitializes the speech instance and speaks the utterance provided.\n\n__Arguments__\n- `utterance` - An `Object` containing the following keys: `text`, `voice` and, optionally, `rate`. `rate` is a float where lower numbers indicate slower speech.\n\n__Examples__\n```js\nSpeech.speak({\n  text: 'I was runnin\\' through the 6 with my woes',\n  voice: 'en-US',\n  rate: 0.4\n})\n.then(started =\u003e {\n  // Success code\n})\n.catch(error =\u003e {\n  // Failure code\n});\n```\n\n```js\nSpeech.speak({\n  text: 'I was runnin\\' through the 6 with my woes',\n  voice: 'en-US'\n});\n```\n\n### pause()\nPauses the speech instance.\n\n__Example__\n```js\nSpeech.pause();\n```\n\n### resume()\nResumes the speech instance.\n\n__Example__\n```js\nSpeech.resume();\n```\n\n### stop()\nStops and destroys the speech instance.\n\n__Example__\n```js\nSpeech.stop();\n```\n\n### isSpeaking()\nIndicates whether speech is in progress.\n\n__Example__\n```js\nSpeech.isSpeaking()\n  .then(speaking =\u003e {\n    console.log(speaking); // true or false\n  });\n```\n\n### isPaused()\nIndicates whether speech is paused.\n\n__Example__\n```js\nSpeech.isPaused()\n  .then(paused =\u003e {\n    console.log(paused); // true or false\n  });\n```\n\n### supportedVoices()\nIndicates which speech voices are available.\n\n__Example__\n```js\nSpeech.supportedVoices()\n  .then(locales =\u003e {\n    console.log(locales); // [\"ar-SA\", \"en-ZA\", \"nl-BE\", \"en-AU\", \"th-TH\", ...]\n  });\n```\n\n## License\nCopyright (c) 2015, [Naoufal Kadhom](http://naoufal.com)\n\nPermission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaoufal%2Freact-native-speech","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaoufal%2Freact-native-speech","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaoufal%2Freact-native-speech/lists"}