mymad.h
来自「The purpose of this program is to run as」· C头文件 代码 · 共 42 行
H
42 行
#ifndef _HW4_MYMAD_H#define _HW4_MYMAD_H#include "myalsa.h"#include "error.h"#define MAD_BUF_SIZE (1152*4) struct buffer{ void * buf; /* buf for data to play */ int sockfd; /* socket descriptor */ ssize_t length; /* length of the current stream */ int finished; /* flag to identify whether finish playing a mp3 file */};//int decode(unsigned char const *, unsigned long);enum mad_flow /* input callback function, fetch data from the socket descriptor */input(void *data, struct mad_stream *stream);inline signed int /* scale the samples to 16 bits, this function is obtained from minimad.c */scale(mad_fixed_t sample);enum mad_flow /* output callback function, form PCM data and call alsa_play */output(void *data, struct mad_header const *header, struct mad_pcm *pcm);enum mad_flow /* error callback function */error(void *data, struct mad_stream *stream, struct mad_frame *frame);int /* this function will be called from main */mad(int sockfd); /* a function tackle mp3 files with libmad */#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?