添加语音功能

http://www.kuitao8.com/20150916/4055.shtml
php利用安装ffmpeg-php扩展来获取对视频信息操作

添加语音功能

http://www.cnblogs.com/zox2011/archive/2013/03/20/2971724.html 

FFmpegPHP的安装使用详解  

添加语音功能

https://github.com/PHP-FFMpeg/PHP-FFMpeg/
PHP FFmpeg

 

https://help.aliyun.com/document_detail/32378.html?spm=5176.doc52787.6.558.DTwmrC

 

先用composer下载 ffmpeg

(在homestead环境下安装较容易)

vagrant 安装 ffmpeg  (apt-get install ffmpeg)(采用网易镜像) 

 

 

例:转成8k采样率

   $ffmpeg = FFMpeg\FFMpeg::create(

        [

            'ffmpeg.binaries'  => '/usr/bin/ffmpeg',

            'ffprobe.binaries' => '/usr/bin/ffprobe',

        ]

    );

    $dir = resource_path('20170609171458.mp3');

    $audio = $ffmpeg->open( $dir );

 

    $audio->filters()->resample(8000);

    $format = new FFMpeg\Format\Audio\Mp3();

//    $format->on('progress', function ($audio, $format, $percentage) {

//        echo "$percentage % transcoded";

//    });

 

    $format

        ->setAudioChannels(2);

 

    $audio->save($format, resource_path('convert.mp3'));

 

相关文章:

  • 2021-12-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-12
  • 2021-09-14
  • 2021-09-06
猜你喜欢
  • 2021-08-17
  • 2021-11-30
  • 2021-08-23
  • 2021-07-22
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
相关资源
相似解决方案