diff --git a/index.php b/index.php new file mode 100644 index 0000000..2036f7c --- /dev/null +++ b/index.php @@ -0,0 +1,122 @@ + + + + + + Quiz Musical + + + +
+

Quiz Musical

+ Aucun fichier audio trouvé dans le dossier spécifié.

"; + } else { + // Choix aléatoire d'un fichier audio + $random_file = $audio_files[array_rand($audio_files)]; + + // Récupérer les métadonnées du fichier audio + require_once 'getID3/getid3/getid3.php'; + $getID3 = new getID3; + $audio_info = $getID3->analyze($random_file); + getid3_lib::CopyTagsToComments($audio_info); + + // Afficher le lecteur audio avec les métadonnées + if (!empty($audio_info['comments_html']['title'][0]) && !empty($audio_info['comments_html']['artist'][0])) { + $title = $audio_info['comments_html']['title'][0]; + $artist = $audio_info['comments_html']['artist'][0]; + $album = !empty($audio_info['comments_html']['album'][0]) ? $audio_info['comments_html']['album'][0] : 'Inconnu'; + $year = !empty($audio_info['comments_html']['year'][0]) ? $audio_info['comments_html']['year'][0] : '(Année inconnue)'; + $cover = !empty($audio_info['comments_html']['attached_picture'][0]) ? base64_encode($audio_info['comments_html']['attached_picture'][0]['data']) : ''; + ?> +

Trouverez-vous l'artiste et le titre de cette chanson sortie en ?

+ +
+
+ +
+ + + + + +
Titre :

Artiste :

Album :

Année :

+ '; + } + ?> +
+
+ + Aucune métadonnée valide trouvée pour le fichier audio.

"; + } + } + ?> +
+ + \ No newline at end of file