コード例 #1
0
ファイル: test.php プロジェクト: hctpbl/alizephp
require __DIR__ . '/../src/AlizePHP.php';
use alizephp\AlizePHP;
$audio_file = "xaaf.pcm";
$speakerrec = new AlizePHP("person", $audio_file);
$speakerrec->cleanUserFiles();
$speakerrec2 = new AlizePHP("person2", $audio_file);
$speakerrec2->cleanUserFiles();
try {
    $speakerrec->extractFeatures();
    $speakerrec->normaliseEnergy();
    $speakerrec->detectEnergy();
    $speakerrec->normaliseFeatures();
    $speakerrec->trainTarget();
    //$speakerrec->ivExtractor();
} catch (Exception $e) {
    print $e->getMessage();
    print $e->getCode();
}
try {
    $speakerrec2->extractFeatures();
    $speakerrec2->normaliseEnergy();
    $speakerrec2->detectEnergy();
    $speakerrec2->normaliseFeatures();
    //$speakerrec2->trainTarget();
    $speakerrec2->computeTest("person");
    //$speakerrec2->ivExtractor();
    //$speakerrec2->ivTest("person");
} catch (Exception $e) {
    print "<pre>" . $e . "</pre>";
}
コード例 #2
0
ファイル: AlizePHPTest.php プロジェクト: hctpbl/alizephp
 /**
  * Test the compute test method
  * @depends testTrainTarget
  */
 public function testComputeTest(AlizePHP $alizeuser)
 {
     $otheruser = new AlizePHP($this->nameTwo);
     $otheruser->extractFeatures($this->filePathTwo);
     $otheruser->normaliseEnergy();
     $otheruser->detectEnergy();
     $otheruser->normaliseFeatures();
     $result = $otheruser->computeTest($alizeuser->getSpeaker());
     $this->assertFileExists($otheruser->getNdxFileName());
     $this->assertFileExists($otheruser->getResultsFileName());
     $this->assertInternalType('float', $result);
     $otheruser->cleanUserFiles();
     return $alizeuser;
 }