I am working on a php code as shown below which convert mp4 files (present in the in_folder) to mp3 (and send it into out_folder)
<?php
foreach ($mp4_files as $f)
{
$parts = pathinfo($f);
switch ($parts['extension'])
{
case 'mp4' :
$filePath = $src_dir . DS . $f;
system('ffmpeg -i ' . $filePath . ' -map 0:2 -ac 1 ' . $destination . DS . $parts['filename'] . '.mp3', $result);
break;
case 'mp3' :
// copy($f, $destination. DS . $parts['filename']. '.' . $parts['extension']);
copy($f, $mp3_processed . DS . $parts['filename'] . '.mp3');
copy($f, $destination . DS . $parts['filename'] . '.mp3');
break;
}
}
?>
<script src="https://connect.soundcloud.com/sdk/sdk-3.3.2.js"></script>
<script>
SC.initialize({
client_id: 'YOUR_CLIENT_ID',
redirect_uri: 'http://example.com/callback'
});
var getTracks = function() { return SC.get('/me/tracks'); };
// connect and update track data
SC.connect().then(getTracks).then(function(tracks){
SC.put('/tracks' + tracks[0].id, {
track: {
description: 'This track was recorded in Berlin',
genre: 'Electronic'
}
});
});
</script>
My next step is to upload the mp3 files(which is in the out_folder) to a specific soundcloud account. I added some script (where php code finish) from soundcloud developers guide as a 1st step in order to upload songs from the songs directory to soundcloud.
Problem Statement:
I am wondering what changes I should in the script code above so that we can make upload songs/audio file from the out_folder directory to any specific soundcloud account. Any pointers will be highly appreciated.