Last active
December 23, 2015 23:09
-
-
Save sydlawrence/6708392 to your computer and use it in GitHub Desktop.
upload twilio recording to soundcloud
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// download the recording to the local machine | |
file_put_contents("recording.wav", file_get_contents($_POST['RecordingUrl'])); | |
// setup the track info to send to soundcloud | |
$track = array( | |
'track[asset_data]' => '@recording.wav' // adding @ adds the contents to $_FILES | |
); | |
// upload the sound using the soundcloud php sdk | |
$response = $soundcloud->post('tracks', $track); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment