A
A
Alexander Knyazev2016-03-21 00:20:15
PHP
Alexander Knyazev, 2016-03-21 00:20:15

Is it possible to find information about the audio file added to the server?

Most likely, the question is nowhere more crazy, but I don’t know if it’s theoretically possible:
When uploading a song to the server, I want to read information about the song - title, album, artist, and so on, and not just the file name. Is this possible to implement?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Sokolov, 2016-03-21
@alexandrknyazev13071995

If this information is written in the id3 tag of the mp3 file, then you can. For example, ffmpeg or its ffprobe utility can read this data from an mp3 file:
Result:

{
    "format": {
        "filename": "music.mp3",
        "nb_streams": 2,
        "nb_programs": 0,
        "format_name": "mp3",
        "format_long_name": "MP2/3 (MPEG audio layer 2/3)",
        "start_time": "0.025056",
        "duration": "219.350204",
        "size": "7072585",
        "bit_rate": "257946",
        "probe_score": 51,
        "tags": {
            "title": "Rihanna - Work (Feat. Drake)(VipMusic.In)",
            "artist": "VipMusic.In",
            "album": "Rihanna - ANTi (2016) - VipMusic.In",
            "composer": "VipMusic.In",
            "copyright": "VipMusic.In",
            "publisher": "VipMusic.In",
            "genre": "[VipMusic.In]"
        }
    }
}

Keep in mind that they can download Metallica by writing in the file tags as if it were Leps.
Another option is to connect to the api of some music service for identifying a recording by sound - for example. EchoNest seems to be able to accept uploads and identify tracks.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question