Added makefile. Fixed char pointer warnings
This commit is contained in:
12
csoundbox.c
12
csoundbox.c
@@ -1,8 +1,15 @@
|
||||
#include <ao/ao.h>
|
||||
#include <mpg123.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define BITS 8
|
||||
|
||||
void exitfunction(void) {
|
||||
|
||||
printf("Exiting csoundbox.\n");
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
mpg123_handle *mh;
|
||||
@@ -17,7 +24,8 @@ int main(int argc, char *argv[])
|
||||
ao_sample_format format;
|
||||
int channels, encoding;
|
||||
long rate;
|
||||
|
||||
|
||||
atexit(exitfunction);
|
||||
if(argc < 2)
|
||||
exit(0);
|
||||
|
||||
@@ -43,7 +51,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
/* decode and play */
|
||||
while (mpg123_read(mh, buffer, buffer_size, &done) == MPG123_OK)
|
||||
ao_play(dev, buffer, done);
|
||||
ao_play(dev, (char *)buffer, done);
|
||||
|
||||
/* clean up */
|
||||
free(buffer);
|
||||
|
Reference in New Issue
Block a user