diff options
| -rw-r--r-- | Makefile | 20 | ||||
| -rw-r--r-- | README | 2 | ||||
| -rw-r--r-- | wave_linux.c | 26 |
3 files changed, 48 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0c2c47a --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +STRIP = strip
+CC = gcc
+CFLAGS = -D__USE_INLINE__ -O3 -ffast-math -finline-functions -funroll-loops -fstrict-aliasing -Wall -I$(SRC)c64
+LDFLAGS = -lsndfile
+TARGET = sam_player
+
+OBJS = sam.o sam_player.o wave_linux.o c64/c64.o c64/cia.o c64/cpu.o c64/kbd.o c64/mem.o c64/prg_file.o c64/sid.o c64/tape.o
+
+%.o: %.c
+ $(CC) $(CFLAGS) -o $@ -c $*.c
+
+all: $(TARGET)
+
+$(TARGET): $(OBJS)
+ $(CC) $(OBJS) -o $@ $(LDFLAGS)
+ $(STRIP) --strip-all $@
+
+
+clean:
+ rm -f *.o $(TARGET) c64/*.o
@@ -0,0 +1,2 @@ +Based on sam_player by Markku Alén +http://aminet.net/package/misc/emu/sam_player diff --git a/wave_linux.c b/wave_linux.c new file mode 100644 index 0000000..6d04fb7 --- /dev/null +++ b/wave_linux.c @@ -0,0 +1,26 @@ + +#include "wave.h" +#include <stdio.h> +#include <sndfile.h> + +int wave_out(wave_t *wave) +{ + SNDFILE* out; + SF_INFO info; + + info.samplerate = wave->samples_per_sec; + info.channels = wave->channels; + info.format = SF_FORMAT_WAV | SF_FORMAT_PCM_U8; + + out = sf_open("out.wav", SFM_WRITE, &info); + sf_write_raw(out, wave->frame_data, wave->frame_size); + sf_close(out); + + printf("channels: %d, samples_per_sec: %d, bits_per_sample: %d, frame_size: %d, frame_count: %d\n", wave->channels, wave->samples_per_sec, wave->bits_per_sample, wave->frame_size, wave->frame_count); + return 0; +} + +const char *wave_err_to_str(int err) +{ + return "unknown error"; +} |
