Skip to content

Commit

Permalink
refactor: Update composer.json name to "afaya/edge-tts"
Browse files Browse the repository at this point in the history
  • Loading branch information
andresayac committed Oct 2, 2024
1 parent 6a635d0 commit 940e5b2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 17 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,27 @@ Command-Line Interface
To synthesize speech from text, use the following command:

```bash
php src/cli.php edge-tts:synthesize --text "Hello, world!"
php .\vendor\bin\edge-tts edge-tts:synthesize --text "Hello, world!"
```

To list available voices, run:

```bash
php src/cli.php edge-tts:voice-list
php .\vendor\bin\edge-tts edge-tts:voice-list
```


## Integration into Your Project
To use Edge TTS in your PHP project, include the autoload file:

```php
<?php

require 'vendor/autoload.php';

use Afaya\EdgeTS\EdgeTS;
use Afaya\EdgeTTS\Service\EdgeTTS;

$tts = new EdgeTS();
$tts = new EdgeTTS();
$tts->synthesize("Hello, world!", "hello-world", "en-US-AriaNeural", "0%","0%","0Hz");
```

Expand Down
7 changes: 2 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "afaya/edge-tts",
"description": "Microsoft Edge's TTS",
"version": "1.0.0",
"version": "1.0.1",
"type": "library",
"license": "GPL-3.0+",
"repository": {
Expand All @@ -24,11 +24,8 @@
"Afaya\\EdgeTTS\\Tests\\": "tests/"
}
},
"scripts": {
"start": "php main.php"
},
"bin": [
"src/cli.php"
"src/edge-tts.php"
],
"minimum-stability": "stable",
"require-dev": {
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 2 additions & 7 deletions src/cli.php → src/edge-tts.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,22 @@

declare(strict_types=1);

require __DIR__ . '/../vendor/autoload.php';

require 'vendor/autoload.php';

use Symfony\Component\Console\Application;
use Afaya\EdgeTTS\CLI\SynthesizeCommand;
use Afaya\EdgeTTS\CLI\VoiceListCommand;

// Crear una nueva instancia de la aplicación de consola
$application = new Application('Edge TTS CLI', '1.0');
$application = new Application('Edge TTS CLI', '1.0.1');

// Registrar los comandos
$application->addCommands([
new SynthesizeCommand(),
new VoiceListCommand(),
]);

// Manejar errores y excepciones
try {
$application->run();
} catch (\Exception $e) {
// Mostrar el mensaje de error y salir con un código de error
fwrite(STDERR, 'Error: ' . $e->getMessage() . PHP_EOL);
exit(1);
}

0 comments on commit 940e5b2

Please sign in to comment.