时间:2021-05-20
本文实例讲述了C++实现显示MP3文件信息的方法。分享给大家供大家参考。具体实现方法如下:
/** * This is small example how to use libZPlay library to play files. * This example is using OpenFile functions to open disk files and play. */#define WIN32_LEAN_AND_MEAN#include <windows.h>#include <olectl.h>#include <ole2.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <conio.h>#include <dos.h>#include <conio.h>#include "../include/libzplay.h"using namespace libZPlay;ZPlay* player;int __stdcall CallbackFunc(void* instance, void *user_data, TCallbackMessage message, unsigned int param1, unsigned int param2);int main(int argc, char **argv){ // clear screen system("CLS"); // create class instance player = CreateZPlay(); // chek if we have class instance if(player == 0) { printf("Error: Can't create class instance !nPress key to exit.n"); getch(); return 0; } // get library version int ver = player->GetVersion(); // check if we have version 2.00 and above if(ver < 200) { printf("Error: Need library version 2.00 and above !nPress key to exit.\r\n"); getch(); player->Release(); return 0; } // display version info printf("libZPlay v.%i.%02i\r\n\r\n", ver / 100, ver % 100); if(argc > 1) { TID3InfoEx id3_info; if(player->LoadFileID3Ex(argv[1], sfAutodetect, &id3_info, 1)) // loading ID3v2 { printf("Title: %s\r\n", id3_info.Title); printf("Artist: %s\r\n", id3_info.Artist); printf("Album: %s\r\n", id3_info.Album); printf("Year: %s\r\n", id3_info.Year); printf("Comment: %s\r\n", id3_info.Comment); printf("Genre: %s\r\n", id3_info.Genre); printf("Track: %s\r\n\r\n", id3_info.TrackNum); printf("Artist1 : %s\r\n", id3_info.AlbumArtist ); printf("Composer: %s\r\n", id3_info.Composer ); printf("Original: %s\r\n", id3_info.OriginalArtist ); printf("Copyright: %s\r\n", id3_info.Copyright ); printf("URL: %s\r\n", id3_info.URL ); printf("Encoder: %s\r\n", id3_info.Encoder ); printf("Publisher: %s\r\n", id3_info.Publisher ); printf("BPM: %u\r\n", id3_info.BPM); printf("MIME: %s\r\n", id3_info.Picture.MIMEType); printf("TYPE: %u\r\n", id3_info.Picture.PictureType); printf("Desc: %s\r\n", id3_info.Picture.Description); printf("Size: %u\r\n", id3_info.Picture.PictureDataSize); // draw picture on desktop window player->DrawBitmapToHWND(NULL, 0, 0, 0, 0, id3_info.Picture.hBitmap); } else { printf("No ID3 data\r\n\r\n"); } } else { // no filename in argument player->Release(); // delete ZPlay class char *end = strrchr(argv[0], '\'); if(end && *(end + 1) != 0) end++; else end = argv[0]; printf("Usage: %s filename\r\n\r\nPress key to exit\r\n", end); getch(); return 0; } getch();}希望本文所述对大家的C++程序设计有所帮助。
声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。
Mp3tag是一个MP3文件修改器,意思就是在MP3文件中添加演唱者、年月、注释等等一些信息,下面说下怎么下载安装并更改语言界面:软件名称:Mp3tag(MP3
本文实例讲述了java实现酷狗音乐临时缓存文件转换为MP3文件的方法。分享给大家供大家参考,具体如下:酷狗临时缓存文件,其实已经是吧MP3文件下载好了,只是名字
本文实例讲述了Python写入数据到MP3文件中的方法。分享给大家供大家参考。具体分析如下:通过Mp3的Id3V1数据段的数据来修正Mp3文件的正确名字,但是,
本文实例讲述了Java编程实现获取mp3时长及播放mp3文件的方法。分享给大家供大家参考,具体如下:所需包为jaudiotagger-2.2.6-SNAPSHO
前言: 今天刚刚做了个音乐列表,但笔者发现在指定目录mp3文件名为中文时,便出现pygame.error,不能正确加载指定mp3文件.写好的代码不想再改了,来个