A header file for the TagLibParser class and Metadata structure, used to parse metadata from audio files.
More...
#include <filesystem>
#include <fstream>
#include <iostream>
#include <string>
#include <sys/stat.h>
#include <taglib/fileref.h>
#include <taglib/tag.h>
#include <taglib/id3v2tag.h>
#include <taglib/mpegfile.h>
#include <taglib/attachedpictureframe.h>
#include <taglib/tpropertymap.h>
#include <png.h>
#include <unordered_map>
Go to the source code of this file.
|
void | printMetadata (const Metadata &metadata) |
| Prints the metadata of a song to the console.
|
|
void | sendErrMsg (std::string debugLogBoolStr, std::string errMsg) |
| Sends an error message based on the debug log setting.
|
|
bool | extractThumbnail (const std::string &audioFilePath, const std::string &outputImagePath) |
| Extracts the thumbnail (album art) from an audio file and saves it to an image file.
|
|
A header file for the TagLibParser class and Metadata structure, used to parse metadata from audio files.
This file defines a Metadata
structure for storing song information such as title, artist, album, and more. It also defines the TagLibParser
class for reading and extracting metadata from audio files using the TagLib library. In addition, the file provides utility functions for printing metadata, handling error messages, and extracting thumbnails from audio files.
Note: In the Emscripten build, dummy functions are used because TagLib must be compiled using Emscripten to function correctly in a web environment.
◆ extractThumbnail()
bool extractThumbnail |
( |
const std::string & | audioFilePath, |
|
|
const std::string & | outputImagePath ) |
Extracts the thumbnail (album art) from an audio file and saves it to an image file.
- Parameters
-
audioFilePath | The path to the audio file containing embedded album art. |
outputImagePath | The path where the extracted album art image will be saved. |
- Returns
true
if the thumbnail was successfully extracted, false
otherwise.
◆ printMetadata()
void printMetadata |
( |
const Metadata & | metadata | ) |
|
Prints the metadata of a song to the console.
- Parameters
-
metadata | The metadata of the song to print. |
◆ sendErrMsg()
void sendErrMsg |
( |
std::string | debugLogBoolStr, |
|
|
std::string | errMsg ) |
Sends an error message based on the debug log setting.
- Parameters
-
debugLogBoolStr | The debug log setting ("true" or "false"). |
errMsg | The error message to send. |
◆ debugLogBoolStr
std::string debugLogBoolStr |