T.ME/BIBIL_0DAY
CasperSecurity


Server : Apache/2
System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64
User : gositeme ( 1004)
PHP Version : 8.2.29
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Directory :  /home/gositeme/domains/soundstudiopro.com/private_html/utils/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/gositeme/domains/soundstudiopro.com/private_html/utils/create_test_audio.php
<?php
// Create Test Audio Files for Player Testing
echo "šŸŽµ CREATING TEST AUDIO FILES\n\n";

// Create audio_files directory if it doesn't exist
$audioDir = './audio_files';
if (!is_dir($audioDir)) {
    mkdir($audioDir, 0755, true);
    echo "āœ… Created audio_files directory\n";
} else {
    echo "āœ… audio_files directory exists\n";
}

// Create task_results directory if it doesn't exist
$resultsDir = './task_results';
if (!is_dir($resultsDir)) {
    mkdir($resultsDir, 0755, true);
    echo "āœ… Created task_results directory\n";
} else {
    echo "āœ… task_results directory exists\n";
}

echo "\nšŸ“ CREATING SAMPLE AUDIO FILES:\n";

// Create a simple test MP3 file (using a placeholder)
$testFiles = [
    'test_sample_1.mp3' => 'Sample audio file 1 for testing',
    'test_sample_2.wav' => 'Sample audio file 2 for testing',
    'test_sample_3.m4a' => 'Sample audio file 3 for testing'
];

foreach ($testFiles as $filename => $description) {
    $filepath = $audioDir . '/' . $filename;
    
    if (!file_exists($filepath)) {
        // Create a placeholder file with audio metadata
        $content = "<!-- This is a placeholder audio file for testing -->\n";
        $content .= "<!-- " . $description . " -->\n";
        $content .= "<!-- Created: " . date('Y-m-d H:i:s') . " -->\n";
        $content .= "<!-- File: " . $filename . " -->\n";
        $content .= "<!-- Duration: 30 seconds -->\n";
        $content .= "<!-- Format: " . pathinfo($filename, PATHINFO_EXTENSION) . " -->\n";
        
        file_put_contents($filepath, $content);
        echo "āœ… Created: " . $filename . "\n";
    } else {
        echo "āš ļø  Exists: " . $filename . "\n";
    }
}

echo "\nšŸ”§ CREATING TEST DATABASE ENTRIES:\n";

// Include database configuration
require_once 'config/database.php';

$pdo = getDBConnection();
if ($pdo) {
    echo "āœ… Database connection successful\n";
    
    // Create test tracks in database
    $testTracks = [
        [
            'task_id' => 'test_audio_001',
            'title' => 'Test Audio Sample 1',
            'prompt' => 'A test audio file for player functionality testing',
            'audio_url' => '/audio_files/test_sample_1.mp3',
            'status' => 'complete'
        ],
        [
            'task_id' => 'test_audio_002', 
            'title' => 'Test Audio Sample 2',
            'prompt' => 'Another test audio file for player functionality testing',
            'audio_url' => '/audio_files/test_sample_2.wav',
            'status' => 'complete'
        ],
        [
            'task_id' => 'test_audio_003',
            'title' => 'Test Audio Sample 3', 
            'prompt' => 'Third test audio file for player functionality testing',
            'audio_url' => '/audio_files/test_sample_3.m4a',
            'status' => 'complete'
        ]
    ];
    
    foreach ($testTracks as $track) {
        // Check if track already exists
        $stmt = $pdo->prepare("SELECT id FROM music_tracks WHERE task_id = ?");
        $stmt->execute([$track['task_id']]);
        $existing = $stmt->fetch();
        
        if (!$existing) {
            // Insert test track
            $stmt = $pdo->prepare("
                INSERT INTO music_tracks (user_id, task_id, title, prompt, music_type, status, audio_url, duration, created_at) 
                VALUES (?, ?, ?, ?, ?, ?, ?, ?, NOW())
            ");
            
            $result = $stmt->execute([
                1, // Default user ID
                $track['task_id'],
                $track['title'],
                $track['prompt'],
                'music',
                $track['status'],
                $track['audio_url'],
                30
            ]);
            
            if ($result) {
                echo "āœ… Created test track: " . $track['title'] . "\n";
            } else {
                echo "āŒ Failed to create test track: " . $track['title'] . "\n";
            }
        } else {
            echo "āš ļø  Test track exists: " . $track['title'] . "\n";
        }
    }
    
} else {
    echo "āŒ Database connection failed\n";
}

echo "\nšŸŽÆ TESTING STEPS:\n";
echo "1. Visit: https://soundstudiopro.com/test_player_functionality.php\n";
echo "2. Run all the player component tests\n";
echo "3. Test with sample audio files\n";
echo "4. Verify browser compatibility\n";
echo "5. Check error handling\n\n";

echo "šŸ“‹ EXPECTED RESULTS:\n";
echo "āœ… Basic audio playback should work\n";
echo "āœ… Player controls should function\n";
echo "āœ… Progress bar should update\n";
echo "āœ… Volume control should work\n";
echo "āœ… Error handling should catch issues\n";
echo "āœ… Browser should support audio formats\n\n";

echo "šŸ”§ NEXT STEPS:\n";
echo "1. If all tests pass, the player is ready for API integration\n";
echo "2. If tests fail, we need to fix the player before proceeding\n";
echo "3. Use the test results to identify any browser compatibility issues\n";
echo "4. Ensure error handling works for failed audio loads\n\n";

echo "šŸŽ‰ TEST AUDIO FILES CREATED!\n";
echo "āœ… Ready for player functionality testing\n";
echo "āœ… Database entries created for testing\n";
echo "āœ… All test infrastructure in place\n";
?> 

CasperSecurity Mini