GithubHelp home page GithubHelp logo

albumcoverextractor's Introduction

AlbumCoverExtractor

Extract album cover picture from your media files, you can also use it for your music player.

It is a C++ Libary, can also be used as a terminal tool.

API

Use the spID3 namespace to extract the album cover in MPEG, and use the spFLAC namespace for FLAC.

Because the code is written like C, it can be easily changed to C language.

This library will define unsigned char type as byte.

// First you need to include these files
#include "ID3v2Pic.h"
#include "FlacPic.h"

/*
Read the album cover picture data from the media file
Parameter 1: File path
Return: true if successful, false if no picture data or format is incorrect.
*/
bool loadPictureData(const char *inFilePath);


/*
Get the picture data pointer
Return: Pointer to picture data starting point
*/
byte *getPictureDataPtr();


/*
Get the picture data size
Return: The number of bytes of image data
*/
int getPictureLength();


/*
Generate an image file extension
Return: Pointer to the character array that stores the file extension
*/
char *getPictureFormat();


/*
Write out the picture data to a file
Parameter 1: File path
Return: true if successful
*/
bool writePictureDataToFile(const char *outFilePath);


/*
Extract album cover from the media file
Parameter 1: Input media file path
Parameter 2: output image file path
Return: true if successful
*/
bool extractPicture(const char *inFilePath, const char *outFilePath);

/* free the memory */
void freePictureData();

Terminal tool

Supports MPEG and FLAC media files.

Extract images from media file like this:

ID3v2Pic media.mp3

You will get the picture file, name is output.(extension) .

Of course, you can also specify the output file name:

ID3v2Pic media.mp3 cover.jpg

albumcoverextractor's People

Contributors

shadowpower avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.