Skip to content

aisha-group/aisha-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Aisha AI PHP SDK

aisha-ai/aisha-php is the PHP SDK for the Aisha AI API.

Use it when you want to add text-to-speech or speech-to-text to a PHP backend, Laravel app, worker, or script.

Install

composer require aisha-ai/aisha-php

Quick Start

<?php

use AishaAI\AishaClient;

$client = new AishaClient(getenv('AISHA_API_KEY'));

$result = $client->tts([
    'transcript' => 'Salom dunyo',
]);

echo $result['audioUrl'];

Text-to-Speech

$result = $client->tts([
    'transcript' => 'Assalomu alaykum',
    'language' => 'uz',
    'model' => 'Gulnoza',
    'mood' => 'Happy',
    'speed' => 1.0,
]);

Save audio to a file:

$result = $client->tts([
    'transcript' => 'Assalomu alaykum',
    'output_path' => 'outputs/assalomu-alaykum.wav',
]);

If output_path is not set, the SDK only returns audioUrl.

Speech-to-Text

$result = $client->stt('meeting.wav', [
    'language' => 'uz',
    'diarization' => true,
]);

History

$ttsHistory = $client->ttsHistory(page: 1, limit: 10);
$sttHistory = $client->sttHistory(page: 1, limit: 10);

Common Values

Name Value
Languages uz, en, ru
Uzbek moods Neutral, Cheerful, Happy, Sad
Default model Gulnoza
Speed range 0.5 to 2.0; 0 uses API default
Transcript limit 1000 characters

Development

composer install
composer test

Real API smoke tests are disabled by default:

RUN_AISHA_REAL_API_TESTS=1 AISHA_API_TEST_KEY="your-key" composer test

About

The official PHP SDK for the AIsha AI API.

Topics

Resources

License

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages