Giter VIP home page Giter VIP logo

Comments (4)

HaujetZhao avatar HaujetZhao commented on July 16, 2024

你是说源码在 win 上运行良好,在 linux 上 hold mode 不正常了?

发送任务是协程,终止发送是通过取消协程任务实现的 cancel_task()

image

from capswriter-offline.

cancundeyingzi avatar cancundeyingzi commented on July 16, 2024

根据观察,问题的直接原因是反复发送 通知结束任务 type: finish,比方说第一句话,type: finish 了两次...第二句话,开局就会读取到第一句的第二个 finish,导致第二句话开头就被掐掉.录音时间零秒

然后再观察为什么会反复发送type: finish,,发现松开按键的信号重复发送了好多次,,,,即 e.ecent_type:up发送多次
对比发现,Windows 上面每句话只会发送一次按键松开信号,,,,,即 e.ecent_type:up只发送一次

后面就没有继续再观察下去了,超出能力范围.....所以目前需要研究的可能是:为什么按键弹起up的信号会重复发送

在 linux 上 hold mode 不正常了?
按键弹起信号重复发送,还无法真正确定到底是什么原因

from capswriter-offline.

HaujetZhao avatar HaujetZhao commented on July 16, 2024

推测。在 Windows 上,恢复模拟 Capslock 是发送了一个 capslock 的按下和弹起。这个动作不会触发事件监听,但是 Linux 上会触发事件监听。你把 config.py 中的 restore_key 关掉试试

from capswriter-offline.

cancundeyingzi avatar cancundeyingzi commented on July 16, 2024

推测。在 Windows 上,恢复模拟 Capslock 是发送了一个 capslock 的按下和弹起。这个动作不会触发事件监听,但是 Linux 上会触发事件监听。你把 config.py 中的 restore_key 关掉试试

经过测试,确实有所好转,测试到现在没有再出现同样问题过,
不过我在大量测试中又发现一个找不到麦克风的问题,,,讲着讲着,突然从某一条消息开始就变成零秒钟....重启程序后恢复正常...不太确定是什么原因导致的,正在观察
(自动重启程序代码)

        console.print("没有找到麦克风设备", end='\n\n', style='bright_red')
        print('程序重启...')
        # 获取当前解释器路径
        p = sys.executable
        # 启动新程序(解释器路径, 当前程序)
        os.execl(p, p, *sys.argv)
        # 关闭当前程序
        sys.exit()
                console.print(f'任务标识:{task_id}')
                console.print(f'    录音时长:{duration:.2f}s')
                if duration==0:
                    stream_close(1,2)#啥参数我也不知道,反正能跑
                    print("出错尝试重启")

from capswriter-offline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.