コード例 #1
0
ファイル: test.php プロジェクト: hctpbl/alizephp
<?php

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
 /**
  * Tests the removal of a user from the system
  * @depends testComputeTest
  */
 public function testCleanUserFiles(AlizePHP $alizeuser)
 {
     $alizeuser->cleanUserFiles();
     $this->assertTrue(!file_exists($alizeuser->getRawFeaturesFileName()));
     $this->assertTrue(!file_exists($alizeuser->getNormalisedEnergyFileName()));
     $this->assertTrue(!file_exists($alizeuser->getLabelFileName()));
     $this->assertTrue(!file_exists($alizeuser->getNormalisedFeaturesFileName()));
     $this->assertTrue(!file_exists($alizeuser->getTrainModelFileName()));
     $this->assertTrue(!file_exists($alizeuser->getModelFileName()));
     $this->assertTrue(!file_exists($alizeuser->getResultsFileName()));
 }