CHANGE: tags are cooked. tags are a damn SNAFU. tags are out.
This commit is contained in:
parent
afaf940b37
commit
3584792c3a
@ -23,5 +23,4 @@
|
|||||||
- [ ] get things up and running on vps
|
- [ ] get things up and running on vps
|
||||||
|
|
||||||
- optional, but kinda neat:
|
- optional, but kinda neat:
|
||||||
* [ ] establish password secured admin backend
|
* [ ] establish password secured admin backend to manage content
|
||||||
* [ ] write id3 and flac tag extractor in php
|
|
@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
function get_file_tags($input_file) {
|
function get_file_tags($input_file) {
|
||||||
$input_type = mime_content_type($input_file);
|
$input_type = mime_content_type($input_file);
|
||||||
// echo $input_type;
|
//echo $input_type;
|
||||||
|
|
||||||
switch($input_type) {
|
switch($input_type) {
|
||||||
case 'audio/mpeg': break;
|
case 'audio/mpeg': get_mp3_tags($input_file); break;
|
||||||
case 'audio/flac': get_flac_tags($input_file); break;
|
case 'audio/flac': get_flac_tags($input_file); break;
|
||||||
default: echo("Ey boss, that file type is NOT okay."); die(); break;
|
default: echo("Ey boss, that file type is NOT okay."); die(); break;
|
||||||
}
|
}
|
||||||
@ -13,4 +13,17 @@ function get_file_tags($input_file) {
|
|||||||
|
|
||||||
function get_flac_tags($input_file) {
|
function get_flac_tags($input_file) {
|
||||||
echo(fread(fopen($input_file, 'r'), 4096));
|
echo(fread(fopen($input_file, 'r'), 4096));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_mp3_tags($input_file) {
|
||||||
|
$fp = fopen($input_file, "r");
|
||||||
|
|
||||||
|
fseek($fp, -64, SEEK_END);
|
||||||
|
|
||||||
|
$mdata = fgets($fp);
|
||||||
|
var_dump($mdata);
|
||||||
|
fclose($fp);
|
||||||
|
}
|
||||||
|
|
||||||
|
// https://stackoverflow.com/questions/16653100/what-are-those-32-bits-near-the-start-of-a-flac-file
|
||||||
|
// https://github.com/mdesharnais/mediatheque/
|
@ -32,9 +32,4 @@
|
|||||||
else {
|
else {
|
||||||
get_audio($pdo);
|
get_audio($pdo);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: remove this part: TESTING ONLY!
|
|
||||||
include_once('../app/tag_extractor.php');
|
|
||||||
get_file_tags('../public/resources/aud/chronostasis.mp3');
|
|
||||||
get_file_tags('F:\MEGA Backup\musik\chronostasis\01 the enigmatic benefits of chronostasis - dan the melon lord.flac');
|
|
||||||
?>
|
?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user