运行环境Centos 6.5
C语言
实现mp3的大部分功能。
/***********************************************************************
> File Name: mp3.c
> Author: YangKun
> Mail: [email protected]
> Created Time: Sat 30 Sep 2017 11:24:28 PM PDT
************************************************************************/
#include<string.h>
#include<stdio.h>
#include<stdlib.h>
#include<dirent.h>
#include <sys/types.h>
typedef struct _node
{
char name[256];
struct _node* prev;
struct _node* next;
}node;
node* head = NULL;
node* cur =NULL;
int first = 1;
void play()
{
if(first==1)
{
first=0;
char buf[1024]={};
sprintf(buf,"madplay -o wav:- %s 2>/dev/null | aplay 2>/dev/null &",cur->name);
system(buf);
}
else if(first==0)
{
system("killall -19 madplay");
}
}
void continue_play()
{
system(