From 99617d71bad0e5870a38e37c8654e46868e2a5ba Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Sun, 18 Nov 2007 17:12:19 +0000 Subject: Make speex the new voice format for SWCODEC targets (non-Archos). Remove codec swapping and build speex voice decoding directly into the core binary. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15668 a1c6a512-1295-4272-9138-f99709370657 --- apps/talk.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'apps/talk.c') diff --git a/apps/talk.c b/apps/talk.c index 53729cc..332a10f 100644 --- a/apps/talk.c +++ b/apps/talk.c @@ -56,8 +56,6 @@ | | filebuf | |------------ | | audio - | |------------ - | | codec swap audiobufend----------+-----------+------------ SWCODEC allocates dedicated buffers, MASCODEC reuses audiobuf. */ @@ -628,7 +626,9 @@ int talk_file(const char* filename, bool enqueue) { int fd; int size; +#if CONFIG_CODEC != SWCODEC struct mp3entry info; +#endif if (talk_temp_disable_count > 0) return -1; /* talking has been disabled */ @@ -640,10 +640,12 @@ int talk_file(const char* filename, bool enqueue) if (p_thumbnail == NULL || size_for_thumbnail <= 0) return -1; +#if CONFIG_CODEC != SWCODEC if(mp3info(&info, filename)) /* use this to find real start */ { return 0; /* failed to open, or invalid */ } +#endif fd = open(filename, O_RDONLY); if (fd < 0) /* failed to open */ @@ -651,14 +653,16 @@ int talk_file(const char* filename, bool enqueue) return 0; } +#if CONFIG_CODEC != SWCODEC lseek(fd, info.first_frame_offset, SEEK_SET); /* behind ID data */ +#endif size = read(fd, p_thumbnail, size_for_thumbnail); close(fd); /* ToDo: find audio, skip ID headers and trailers */ - if (size != 0 && size != size_for_thumbnail) /* Don't play missing or truncated clips */ + if (size > 0 && size != size_for_thumbnail) /* Don't play missing or truncated clips */ { #if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR) bitswap(p_thumbnail, size); -- cgit v1.1