From 79a5d75dacf9e314ea244b05100b3cd95c3b8d99 Mon Sep 17 00:00:00 2001 From: foyou Date: Fri, 26 May 2023 11:22:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20get=5Fduration=20=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E4=B8=8D=E5=AF=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 6 +++++- pilk/__init__.py | 10 ++++------ setup.py | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index eb2a1da..933737e 100644 --- a/.gitignore +++ b/.gitignore @@ -186,4 +186,8 @@ cython_debug/ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. -#.idea/ \ No newline at end of file +#.idea/ +/dev/ +/test/ +/main.py +/build_wheel.bat diff --git a/pilk/__init__.py b/pilk/__init__.py index b604027..ec95168 100644 --- a/pilk/__init__.py +++ b/pilk/__init__.py @@ -8,12 +8,12 @@ __title__ = 'pilk' __description__ = 'python silk codec binding' __url__ = 'https://github.com/foyoux/pilk' -__version__ = '0.0.2' +__version__ = '0.2.4' # noinspection SpellCheckingInspection __author__ = 'foyou' __author_email__ = 'yimi.0822@qq.com' -__license__ = 'Apache 2.0' -__copyright__ = f'Copyright 2022 {__author__}' +__license__ = ' GPL-3.0' +__copyright__ = f'Copyright 2022~2023 {__author__}' __ide__ = 'PyCharm - https://www.jetbrains.com/pycharm/' @@ -33,10 +33,8 @@ def get_duration(silk_path: str, frame_ms: int = 20) -> int: size = silk.read(2) if len(size) != 2: break - size = size[0] + size[1] << 8 - if not tencent and size == 0xffff: - break i += 1 + size = size[0] + size[1] * 16 silk.seek(silk.tell() + size) return i * frame_ms diff --git a/setup.py b/setup.py index 7879e03..adf354b 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ # noinspection SpellCheckingInspection setup( name='pilk', - version='0.2.3', + version='0.2.4', description='python silk voice library', long_description=long_description, long_description_content_type='text/markdown',