PHP SDK for the Dolby API is a PHP package by Andréia Bohner that provides a wrapper around the Dolby API:
For example, Dolby provides various media APIs such as enhance, improving the quality of your media. Using this package, you can do the following to enhance the quality of an audio file:
use DolbyApi\DolbyApi; $dolbyApi = new DolbyApi('your-api-token'); $startEnhance = $dolbyApi->api('media') ->enhance( 'https://dolbyio.s3-us-west-1.amazonaws.com/public/shelby/tunnel.original.mp4', 'dlb://example_out' ); $startEnhance->body();// "{"job_id":"5970da3d-cdbc-4128-b2f8-21ab61573d2e"}"$startEnhance->json();// decoded body: [ "job_id" => "44fccc05-54cc-4bda-84ba-a8c9ee4b8335"]$startEnhance->status(); // 200
Since this is an asynchronous operation, you can get the status of the enhancement by providing the job ID:
$enhanceStatus = $dolbyApi ->api('media') ->enhanceStatus('44fccc05-54cc-4bda-84ba-a8c9ee4b8335'); $enhanceStatus->body();// {"path":"/media/enhance","status":"Success","progress":100,"api_version":"v1.1.2","result":{}}"
Check out the documentation on GitHub for usage and examples. You can learn more about this package, get full installation instructions, and view the source code on GitHub.
As a side note, this package uses the excellent Saloon Package, which is helpful in building API integrations and SDKs in PHP.
0 comments:
Post a Comment
Thanks