Example #1
0
 public function testStore()
 {
     $r = new Catapult\Recording();
     $recs = $r->listRecordings();
     $media = $recs->last()->getMediaFile();
     $media->store("filename.wav");
 }
 /**
  * test guarentees atleast one
  * transcription.
  *
  * also check if the count has been incremented
  */
 public function testListTranscriptions()
 {
     $recording = new Catapult\Recording();
     $last = $recording->listRecordings()->last();
     $trans = new Catapult\Transcription($last->id);
     $transcriptions = $trans->listTranscriptions();
     $this->assertTrue(sizeof($transcriptions->data) > 0);
 }
<?php

require_once "../source/Catapult.php";
// below is a sample of Catapult Transcriptions
// it will execute the provided verb
// IMPORTANT: edit credentials.json
// with your information
// or comment out below /w your keys
//
// This example uses 0.7.0
// please note Credentials object is not here
// and does not need to be used anymore
$client = new Catapult\Client('BANDWIDTH_USER_ID', 'BANDWIDTH_API_TOKEN', 'BANDWIDTH_API_SECRET');
// uncomment if you are using
// credentials.json
//$client = new Catapult\Client;
$recordings = new Catapult\Recording();
$recording = $recordings->listAll()->last();
$transcription = new Catapult\Transcription(array("recordingId" => $recording->id, "text" => "This is a test..", "textUrl" => "any_friendly_url"));
printf("You created a transcription for recording %s, titled: '%s'!", $recording->id, $transcription->text);
Example #4
0
 public function testGetMediaFile()
 {
     $r = new Catapult\Recording("r-id");
     $media = $r->get_media_file();
     $this->assertInstanceOf($media, Catapult\Media);
 }