-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
45 lines (35 loc) · 1.08 KB
/
index.php
File metadata and controls
45 lines (35 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/**
* Main entry point for AudioPulse
*/
require_once __DIR__ . '/src/Audiopulse.php';
use Audiopulse\Audiopulse;
function main() {
$options = getopt('v::i:o:', ['verbose::', 'input:', 'output:']);
$config = [
'verbose' => isset($options['v']) || isset($options['verbose']),
'input' => $options['i'] ?? $options['input'] ?? null,
'output' => $options['o'] ?? $options['output'] ?? null
];
try {
$app = new Audiopulse($config);
if ($config['verbose']) {
echo "Starting AudioPulse processing...\n";
}
$result = $app->execute();
if ($config['output']) {
echo "Results saved to: " . $config['output'] . "\n";
}
echo "✅ Processing completed successfully\n";
exit(0);
} catch (Exception $e) {
echo "❌ Error: " . $e->getMessage() . "\n";
if ($config['verbose']) {
echo $e->getTraceAsString() . "\n";
}
exit(1);
}
}
if (basename(__FILE__) === basename($_SERVER['PHP_SELF'])) {
main();
}