podcasthosting/audiowaveform-php-client
最新稳定版本:v0.2.2
Composer 安装命令:
composer require podcasthosting/audiowaveform-php-client
包简介
A PHP wrapper for easy access to the BBC project audiowaveform client.
README 文档
README
This project is straight forward to use. It implements all the arguments from the commandline audiowaveform command as methods. The script calls the shell command. So audiowaveform has to be installed for this script to work.
Create a new instance of the AudiowaveformClient class to work with it. It automatically tries to detect where the audiowaveform command is installed.
$ac = new AudiowaveformClient();
Get the version of the installed audiowaveform:
echo $ac->getVersion();
The __constructor() method calls a method called detectAndSetPath() to find the audiowaveform binary.
You can override the name of the binary by using the setter method setBinaryName(string $binaryName).
All parameters have their own setter method:
setColors(string $color)setWaveformColor(string $color)setBorderColor(string $color)setBackgroundColor(string $color)setAxisLabelColor(string $color)setInputFilename(string $name)setInputFormat(string $name)setOutputFilename(string $name)setSplitChannels()setPixelsPerSecond(Int $pixels)setBits(Int $bits)setStart(Int $start)setEnd(Int $end)setWidth(Int $width)setHeight(Int $height)setNoAxisLabels()setWithAxisLabels()setAmplitudeScale(Float $scale)setCompression(Int $level)setCompression(Int $level)setQuiet()- and more
setInputFilename() and setOutputFilename() are required.
After you have set all parameters you have to call the execute() method to run the program, e.g.
$ac = new AudiowaveformClient()
$ac->setInputFilename('my-audio-file.mp3');
$ac->setBackgroundColor('000000');
$ac->setPixelsPerSecond(300);
$ac->setOutputFilename('my-audio-file.dat');
$ac->execute();
You can also chain all setters:
(new AudiowaveformClient)->setInputFilename('other-audio.wav')setColors('ff9900')->setPixelsPerSecond(300)->setOutputFilename('my-audio-file.dat')->execute();
统计信息
- 总下载量: 69
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-01-19