text-to-speech-api
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -1,2 +0,2 @@ | ||
class TextToVoice { | ||
class TextToSpeech { | ||
/** | ||
@@ -37,8 +37,8 @@ * Convert text to speech. | ||
// Export the TextToVoice class | ||
// Export the TextToSpeech class | ||
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') { | ||
module.exports = TextToVoice; | ||
module.exports = TextToSpeech; | ||
} else if (typeof window !== 'undefined') { | ||
// Avoid redeclaration | ||
window.TextToVoice = window.TextToVoice || TextToVoice; | ||
window.TextToSpeech = window.TextToSpeech || TextToSpeech; | ||
} |
{ | ||
"name": "text-to-speech-api", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A simple NPM package to convert text to voice using native JavaScript API.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# TextToVoice | ||
# TextToSpeech | ||
`TextToVoice API` is a lightweight JavaScript class that provides an easy way to convert text to speech using the native Web Speech API. It allows customization of voice selection, speech rate, and pitch, making it a versatile tool for web applications that require voice synthesis capabilities. | ||
`TextToSpeech API` is a lightweight JavaScript class that provides an easy way to convert text to speech using the native Web Speech API. It allows customization of voice selection, speech rate, and pitch, making it a versatile tool for web applications that require voice synthesis capabilities. | ||
@@ -38,3 +38,3 @@ ## Features | ||
```javascript | ||
const TextToVoice = require('text-to-speech-api'); | ||
const TextToSpeech = require('text-to-speech-api'); | ||
``` | ||
@@ -46,7 +46,7 @@ | ||
To convert text to speech, simply call the `convert` method of the `TextToVoice` class: | ||
To convert text to speech, simply call the `convert` method of the `TextToSpeech` class: | ||
```javascript | ||
const text = "Hello, this is a text to voice conversion!"; | ||
TextToVoice.convert(text); | ||
TextToSpeech.convert(text); | ||
``` | ||
@@ -62,3 +62,3 @@ | ||
TextToVoice.convert(text, voiceName, 1.2, 1.0); | ||
TextToSpeech.convert(text, voiceName, 1.2, 1.0); | ||
``` | ||
@@ -76,3 +76,3 @@ | ||
```javascript | ||
TextToVoice.convert("This is a faster voice!", null, 1.5, 1); | ||
TextToSpeech.convert("This is a faster voice!", null, 1.5, 1); | ||
``` | ||
@@ -86,3 +86,3 @@ | ||
try { | ||
TextToVoice.convert("Hello, world!"); | ||
TextToSpeech.convert("Hello, world!"); | ||
} catch (error) { | ||
@@ -95,3 +95,3 @@ console.error(error.message); | ||
Here is a simple example of how to use `TextToVoice` in an HTML file: | ||
Here is a simple example of how to use `TextToSpeech` in an HTML file: | ||
@@ -114,3 +114,3 @@ ```html | ||
const text = "Hello, this is a text to voice conversion!"; | ||
TextToVoice.convert(text); | ||
TextToSpeech.convert(text); | ||
}); | ||
@@ -122,2 +122,14 @@ </script> | ||
## Changelog | ||
### [1.0.1] | ||
#### Updated | ||
- Enhanced user experience. | ||
### [1.0.0] | ||
#### Initial Release | ||
- Released the `TextToSpeech` class with basic functionality to convert text to speech using the native Web Speech API. | ||
## License | ||
@@ -124,0 +136,0 @@ |
6595
135