From 7b25eaa1e2dbe08aeb1e3a0d3b389120504cfe9f Mon Sep 17 00:00:00 2001 From: xufulong Date: Tue, 5 Oct 2021 19:29:04 +0800 Subject: [PATCH] remove wve.c --- app/src/main/cpp/sox/CmakeLists.txt | 1 - app/src/main/cpp/sox/formats.h | 2 +- app/src/main/cpp/sox/wve.c | 63 ----------------------------- 3 files changed, 1 insertion(+), 65 deletions(-) delete mode 100644 app/src/main/cpp/sox/wve.c diff --git a/app/src/main/cpp/sox/CmakeLists.txt b/app/src/main/cpp/sox/CmakeLists.txt index d09d414..cca7fe0 100644 --- a/app/src/main/cpp/sox/CmakeLists.txt +++ b/app/src/main/cpp/sox/CmakeLists.txt @@ -122,7 +122,6 @@ set(formats_srcs vox.h vox-fmt.c wav.c - wve.c xa.c ) diff --git a/app/src/main/cpp/sox/formats.h b/app/src/main/cpp/sox/formats.h index ef47dd8..dd2a24e 100644 --- a/app/src/main/cpp/sox/formats.h +++ b/app/src/main/cpp/sox/formats.h @@ -60,7 +60,7 @@ FORMAT(voc) FORMAT(vox) FORMAT(wav) - FORMAT(wve) +// FORMAT(wve) FORMAT(xa) /*--------------------- Plugin or static format handlers ---------------------*/ diff --git a/app/src/main/cpp/sox/wve.c b/app/src/main/cpp/sox/wve.c deleted file mode 100644 index d0f639b..0000000 --- a/app/src/main/cpp/sox/wve.c +++ /dev/null @@ -1,63 +0,0 @@ -/* libSoX file format: Psion wve (c) 2008 robs@users.sourceforge.net - * - * See http://filext.com/file-extension/WVE - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or (at - * your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser - * General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "sox_i.h" -#include - -static char const ID1[18] = "ALawSoundFile**\0\017\020"; -static char const ID2[] = {0,0,0,1,0,0,0,0,0,0}; /* pad & repeat info: ignore */ - -static int start_read(sox_format_t * ft) -{ - char buf[sizeof(ID1)]; - uint32_t num_samples; - - if (lsx_readchars(ft, buf, sizeof(buf)) || lsx_readdw(ft, &num_samples) || - lsx_skipbytes(ft, sizeof(ID2))) - return SOX_EOF; - if (memcmp(ID1, buf, sizeof(buf))) { - lsx_fail_errno(ft, SOX_EHDR, "wve: can't find Psion identifier"); - return SOX_EOF; - } - return lsx_check_read_params(ft, 1, 8000., SOX_ENCODING_ALAW, 8, (uint64_t)num_samples, sox_true); -} - -static int write_header(sox_format_t * ft) -{ - uint64_t size64 = ft->olength? ft->olength:ft->signal.length; - unsigned size = size64 > UINT_MAX ? 0 : (unsigned)size64; - return lsx_writechars(ft, ID1, sizeof(ID1)) - || lsx_writedw(ft, size) - || lsx_writechars(ft, ID2, sizeof(ID2))? SOX_EOF:SOX_SUCCESS; -} - -LSX_FORMAT_HANDLER(wve) -{ - static char const * const names[] = {"wve", NULL}; - static sox_rate_t const write_rates[] = {8000, 0}; - static unsigned const write_encodings[] = {SOX_ENCODING_ALAW, 8, 0, 0}; - static sox_format_handler_t const handler = {SOX_LIB_VERSION_CODE, - "Psion 3 audio format", - names, SOX_FILE_BIG_END | SOX_FILE_MONO | SOX_FILE_REWIND, - start_read, lsx_rawread, NULL, - write_header, lsx_rawwrite, NULL, - lsx_rawseek, write_encodings, write_rates, 0 - }; - return &handler; -}