Coder Social home page Coder Social logo

hibobmaster / matrix-stt-bot Goto Github PK

View Code? Open in Web Editor NEW
19.0 1.0 3.0 50 KB

A simple matrix bot that transcribes your voice to text message

Home Page: https://matrix.to/#/#public:matrix.qqs.tw

License: MIT License

Dockerfile 2.27% Python 97.73%
chatbot faster-whisper matrix-dendrite matrix-synapse openai-whisper python speech-to-text stt accessibility

matrix-stt-bot's People

Contributors

hibobmaster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

matrix-stt-bot's Issues

Matrix store and olm account is not loaded.

Hello! I have a problem related to e2ee.
I log in using an access token. I followed the instructions and edited the config.json and compose.yaml. I initially ran the Docker image using sudo docker compose without any problems, but after I tried to add e2ee, I found the following error message:

matrix-stt-bot  | 2023-12-04 09:34:41,890 - INFO - Bot started!
matrix-stt-bot  | 2023-12-04 09:34:43,052 - INFO - Login via access_token
matrix-stt-bot  | 2023-12-04 09:34:43,052 - INFO - start import_keys process, this may take a while...
matrix-stt-bot  | Traceback (most recent call last):
matrix-stt-bot  |   File "/app/src/bot.py", line 632, in <module>
matrix-stt-bot  |     asyncio.run(main())
matrix-stt-bot  |   File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
matrix-stt-bot  |     return runner.run(main)
matrix-stt-bot  |            ^^^^^^^^^^^^^^^^
matrix-stt-bot  |   File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
matrix-stt-bot  |     return self._loop.run_until_complete(task)
matrix-stt-bot  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
matrix-stt-bot  |   File "/usr/local/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
matrix-stt-bot  |     return future.result()
matrix-stt-bot  |            ^^^^^^^^^^^^^^^
matrix-stt-bot  |   File "/app/src/bot.py", line 613, in main
matrix-stt-bot  |     await bot.import_keys()
matrix-stt-bot  |   File "/app/src/bot.py", line 537, in import_keys
matrix-stt-bot  |     resp = await self.client.import_keys(
matrix-stt-bot  |                  ^^^^^^^^^^^^^^^^^^^^^^^^
matrix-stt-bot  |   File "/usr/local/lib/python3.11/site-packages/nio/client/base_client.py", line 115, in inner
matrix-stt-bot  |     raise LocalProtocolError("Matrix store and olm account is not loaded.")
matrix-stt-bot  | nio.exceptions.LocalProtocolError: Matrix store and olm account is not loaded.

Error validating event: 'file' is a required property

Hey,

Thanks so much for your work. I really appreciate this!

I've just setup the bot and encryption seems to be working correctly. But there is a problem with the message events. The schema requires the file attribute of the event which is according to the matrix spec required for encrypted messages. But somehow even though the message should be encrypted it is not there. I don't know if it is a problem with the bot or my matrix server instance but it happens with whatever audio message I send to the bot.

This is the output of the bot:

Error validating event: 'file' is a required property

Failed validating 'required' in schema['properties']['content']:
    {'properties': {'body': {'type': 'string'},
                    'file': {'properties': {'hashes': {'properties': {'sha256': {'type': 'string'}},
                                                       'type': 'object'},
                                            'iv': {'type': 'string'},
                                            'key': {'properties': {'alg': {'type': 'string'},
                                                                   'k': {'type': 'string'}},
                                                    'required': ['alg',
                                                                 'k'],
                                                    'type': 'object'},
                                            'url': {'type': 'string'}},
                             'required': ['url', 'hashes', 'iv', 'key'],
                             'type': 'object'},
                    'info': {'properties': {'thumbnail_file': {'properties': {'hashes': {'properties': {'sha256': {'type': 'string'}},
                                                                                         'type': 'object'},
                                                                              'iv': {'type': 'string'},
                                                                              'key': {'properties': {'alg': {'type': 'string'},
                                                                                                     'k': {'type': 'string'}},
                                                                                      'required': ['alg',
                                                                                                   'k'],
                                                                                      'type': 'object'},
                                                                              'url': {'type': 'string'}},
                                                               'required': ['url',
                                                                            'hashes',
                                                                            'iv',
                                                                            'key'],
                                                               'type': 'object'}},
                             'type': 'object'},
                    'msgtype': {'enum': ['m.image',
                                         'm.audio',
                                         'm.video',
                                         'm.file'],
                                'type': 'string'}},
     'required': ['body', 'file', 'msgtype'],
     'type': 'object'}

On instance['content']:
    {'body': 'audio.ogg',
     'info': {'duration': 68000,
              'mimetype': 'audio/ogg; codecs=opus',
              'size': 152320},
     'msgtype': 'm.audio',
     'org.matrix.msc1767.audio': {'duration': 68000,
                                  'waveform': [0,
                                               986,
                                               408,
                                               646,
                                               0,
                                               663,
                                               833,
                                               68,
                                               408,
                                               969,
                                               34,
                                               0,
                                               476,
                                               255,
                                               0,
                                               697,
                                               340,
                                               272,
                                               0,
                                               0,
                                               374,
                                               0,
                                               102,
                                               0,
                                               374,
                                               85,
                                               442,
                                               0,
                                               476,
                                               0,
                                               0,
                                               85,
                                               272,
                                               0,
                                               204,
                                               238,
                                               476,
                                               0,
                                               170,
                                               0,
                                               442,
                                               119,
                                               289,
                                               0,
                                               0,
                                               476,
                                               238,
                                               595,
                                               0,
                                               0,
                                               391,
                                               0,
                                               0,
                                               646,
                                               374,
                                               238,
                                               0,
                                               0,
                                               0,
                                               0,
                                               0,
                                               799,
                                               34,
                                               0]},
     'org.matrix.msc3245.voice': {},
     'url': 'mxc://xxx.xxx/PFsnoEkSeCsjQgngRdprpoeS'}

Any idea on how to fix this?

Thanks in advance!

Getting stuck at "INFO - Login via password"

Hi! Thanks for providing this repo. Very cool idea that I would like to experiment with for deaf people.

I am using the Yunohost package synapse_ynh. I followed the instructions and edited the config.json according to my server dates. Unfortunately when starting the the docker image with sudo docker compose up this is the output (won't change in 1 hour):

[+] Running 1/0
 โœ” Container matrix-stt-bot  Created                                                                                                                                0.0s 
Attaching to matrix-stt-bot
matrix-stt-bot  | 2023-07-19 18:15:05,645 - INFO - Bot started!
matrix-stt-bot  | 2023-07-19 18:15:11,946 - INFO - Login via password

I restarted the system and double checked the login credentials. Using Cinny I can login just fine.

This is my current config.json

{
    "homeserver": "https://matrix.MYDOMAIN.de",
    "user_id": "@botwhisper:MYDOMAIN.de",
    "password": "************",
    "device_id": "GMIAZSVFF",
    "room_id": "!mDqFzeYMAuCTDOlrBh:MYDOMAIN.de",
    "model_size": "medium",
    "import_keys_path": "element-keys.txt",
    "import_keys_password": "************"
}

Any idea? How can I get more verbose logging on why the login doesn't work?

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.