From 267eb077a79b85638598e1a872ffab9e60da7dfe Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Thu, 14 Apr 2005 11:51:31 +0000 Subject: New API for buffered PCM playback git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6284 a1c6a512-1295-4272-9138-f99709370657 --- apps/debug_menu.c | 57 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 19 deletions(-) (limited to 'apps') diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 3969972ea8..f1402950a9 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c @@ -63,8 +63,8 @@ #include "pcm_playback.h" #include "buffer.h" -#define CHUNK_SIZE 44100 /* Transfer CHUNK_SIZE bytes on - each DMA transfer */ +#define CHUNK_SIZE 0x100000 /* Transfer CHUNK_SIZE bytes on + each DMA transfer */ static unsigned char line = 0; static unsigned char *audio_buffer; @@ -95,9 +95,9 @@ static void puts(const char *fmt, ...) /* Very basic WAVE-file support.. Just for testing purposes.. */ int load_wave(char *filename) { - int f, i; + int f, i, num; unsigned char buf[32]; - unsigned short *p; + unsigned short *p, *end; puts("Loading %s..", filename); @@ -136,10 +136,18 @@ int load_wave(char *filename) close(f); puts("Changing byte order.."); + end = (unsigned short *)(audio_buffer + audio_size); p = (unsigned short *)audio_buffer; - for (i=0; i