Skip to content

Instantly share code, notes, and snippets.

@RobSpectre
Created January 9, 2012 23:10
Show Gist options
  • Save RobSpectre/1585538 to your computer and use it in GitHub Desktop.
Save RobSpectre/1585538 to your computer and use it in GitHub Desktop.
Faking audio scrubbing using discrete audio chunks
<?php
// Include Twilio helper library
require("Services/Twilio.php");
// Instantiate Twilio Response object to render TwiML.
$response = new Services_Twilio_Twiml();
$gather = $response->gather(array('numDigits' => 1));
if (isset($_REQUEST['Digits'])) {
$gather-say('Playing part '.$_REQUEST['Digits']);
$gather->play('part'.$_REQUEST['Digits'].'.mp3');
} else {
// No digit set - play first track
$gather->play('part1.mp3');
}
print $response;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment