Skip to content

Instantly share code, notes, and snippets.

@sydlawrence
Last active December 23, 2015 23:09
Show Gist options
  • Save sydlawrence/6708392 to your computer and use it in GitHub Desktop.
Save sydlawrence/6708392 to your computer and use it in GitHub Desktop.
upload twilio recording to soundcloud
<?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