I have audio files on my server and wanted to convert them into flac format in order to convert them into text. Please let me know how can we achieve that..
You can use FFmpeg: https://ffmpeg.org/
ffmpeg -i input.mp3 output.flac
There is a php wrapper for the ffmpeg binary on github. https://github.com/PHP-FFMpeg/PHP-FFMpeg
In case you can't install ffmpeg you might want to try this free API:
<?php
$url = 'http://server.com/sound.mp3';
$data = json_decode(file_get_contents('http://api.rest7.com/v1/sound_convert.php?url=' . $url . '&format=flac'));
if (@$data->success !== 1)
{
die('Failed');
}
$flac = file_get_contents($data->file);
file_put_contents('sound.flac', $flac);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With