Download the PHP package vikas5914/fluidaudio without Composer
On this page you can find all versions of the php package vikas5914/fluidaudio. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vikas5914/fluidaudio
More information about vikas5914/fluidaudio
Files in vikas5914/fluidaudio
Package fluidaudio
Short Description On-device speech recognition for NativePHP Mobile via FluidAudio (Apple Core ML)
License MIT
Informations about the package fluidaudio
FluidAudio Plugin for NativePHP Mobile
On-device speech recognition via FluidAudio (Apple Core ML).
iOS 18+ only — the Android bridge functions answer UNSUPPORTED_PLATFORM.
Two modes:
- Batch file ASR —
initializeAsr()downloads/loads the model pack, thentranscribeFile($path)transcribes an audio file. - Mic streaming —
startStreaming()loads a Parakeet EOU model and streams partial transcripts from the microphone untilstopStreaming().
All calls are non-blocking: they return {accepted, requestId} immediately and
deliver results through events correlated by requestId.
Installation
Usage (PHP)
initializeAsr() defaults to AsrModel::MultilingualV3 (v3); the other
option is AsrModel::EnglishV2 (v2). startStreaming() defaults to
StreamingModel::Eou160ms; Eou320ms and Eou1280ms trade latency for
accuracy. Invalid values throw InvalidArgumentException, as does an empty
path passed to transcribeFile().
Off-device (web/preview, no nativephp_call), the *Accepted methods return
a fabricated {accepted: true, requestId} envelope; getSystemInfo() and
cleanup() return null, isAsrAvailable() returns false.
Listening for Events
ModelLoadProgress carries status (downloading / compiling / ready),
progress (0–100) and type (asr / streaming). StreamingUpdate carries
partial text with confirmed empty until the final update (isFinal: true).
Choosing and Downloading Models
The plugin ships two separate model packs. List them with models() and let
the user pick one of each:
- Batch pack (
asr):v2(English) orv3(multilingual). Used for file transcripts. Download it withFluidAudio::initializeAsr(['version' => 'v3']). - Live pack (
streaming): Parakeet EOU at 160/320/1280 ms latency. Used for mic streaming. Download it up front withFluidAudio::downloadStreamingModel(['variant' => 'parakeet-eou-160ms']), or skip this — the firststartStreaming()downloads it by itself.
Both downloads report through ModelLoadProgress (type is asr or
streaming) and stay cached on-device, so each pack downloads once.
Model Download Progress
Two ways to read progress:
- Live events — listen for
ModelLoadProgressas above. Best for progress bars while a download runs. - Snapshot function —
FluidAudio::modelLoadProgress()returns the last known state without waiting for an event. Best onmount(), e.g. when the user navigates back mid-download:
Each entry carries status (idle / downloading / compiling / ready),
progress (0–100) and the requestId it belongs to (absent when idle).
Returns null off-device.
Usage (JavaScript)
For Inertia + Vue/React apps, import the client from resources/js/index.js
(published to npm as @vikas5914/fluidaudio):
Every function mirrors a FluidAudio.* bridge call and resolves with the
{accepted, requestId} envelope (or the sync payload for reads). Results
arrive via native events correlated by requestId.
Permissions
iOS declares NSMicrophoneUsageDescription and the audio background mode in
the manifest. No Android permissions are needed: the Android bridge is an
explicit stub until a future release adds on-device support.
Environment Variables
None. The plugin needs no API keys or secrets.
Support
Report issues at github.com/Vikas5914/fluidaudio/issues or mail [email protected].
License
MIT