diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2007-11-18 17:12:19 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2007-11-18 17:12:19 +0000 |
commit | 99617d71bad0e5870a38e37c8654e46868e2a5ba (patch) | |
tree | e0ecc3b73e8e167c7f5bf00a6c88b83c1119aea3 /apps/talk.c | |
parent | 75432619e8be2f22f86ed0869d46bf7245c7c14d (diff) | |
download | rockbox-99617d71bad0e5870a38e37c8654e46868e2a5ba.tar.gz rockbox-99617d71bad0e5870a38e37c8654e46868e2a5ba.zip |
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
Diffstat (limited to 'apps/talk.c')
-rw-r--r-- | apps/talk.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/talk.c b/apps/talk.c index 53729ccd7d..332a10f820 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); |