Skip to content

Commit

Permalink
Merge pull request #36 from MohammedShalan/master
Browse files Browse the repository at this point in the history
  • Loading branch information
yshalsager authored Aug 5, 2022
2 parents 6a45e83 + c953829 commit e88a7d8
Show file tree
Hide file tree
Showing 30 changed files with 985 additions and 180 deletions.
66 changes: 51 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,56 +2,92 @@ name: Package Application with Pyinstaller

on:
push:
branches: [master]
branches: [ master ]
tags: [ v* ]
pull_request:
branches: [master]
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, '(deps') }}


steps:
- uses: actions/checkout@v2
- uses: hmarr/debug-action@v2

- name: Package Application for Windows
- name: Package CLI Application for Windows
uses: yshalsager/pyinstaller-action-windows@main
with:
path: .
spec: wit_transcriber.spec
requirements: requirements.txt

- name: Package GUI Application for Windows
uses: yshalsager/pyinstaller-action-windows@main
with:
path: .
spec: pyinstaller/wit_transcriber.spec
requirements: pyinstaller/requirements.txt
spec: wit_transcriber_gui.spec
requirements: requirements.txt

- uses: actions/upload-artifact@v2
if: github.actor != 'dependabot[bot]'
with:
name: wit_transcriber.exe
path: dist/windows

- name: Package Application for Linux
- uses: actions/upload-artifact@v2
if: github.actor != 'dependabot[bot]'
with:
name: wit_transcriber_gui.exe
path: dist/windows

- name: Package CLI Application for Linux
uses: yshalsager/pyinstaller-action-linux@main
with:
path: .
spec: pyinstaller/wit_transcriber.spec
requirements: pyinstaller/requirements.txt
spec: wit_transcriber.spec
requirements: requirements.txt

- name: Package GUI Application for Linux
uses: yshalsager/pyinstaller-action-linux@tkinter
with:
path: .
spec: wit_transcriber_gui.spec
requirements: requirements.txt
tkinter: true

- uses: actions/upload-artifact@v2
if: github.actor != 'dependabot[bot]'
with:
name: wit_transcriber
path: dist/linux

- name: Get datetime
id: datetime
run: echo ::set-output name=datetime::$(date +'%Y%m%d-%H%M%S')
- uses: actions/upload-artifact@v2
if: github.actor != 'dependabot[bot]'
with:
name: wit_transcriber_gui
path: dist/linux

- name: Set release name to tag name or datetime
id: release
run: |
echo ${{ github.ref }}
ref='refs/tags/v'
if [[ ${{ github.ref }} == *${ref}* ]]; then
echo ::set-output name=version::${GITHUB_REF/refs\/tags\//}
else
echo ::set-output name=version::$(date +'%Y%m%d-%H%M%S')
fi
- name: Release
if: github.actor != 'dependabot[bot]'
if: github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.datetime.outputs.datetime }}
name: ${{ steps.datetime.outputs.datetime }}
tag_name: ${{ steps.release.outputs.version }}
name: ${{ steps.release.outputs.version }}
files: |
dist/windows/wit_transcriber.exe
dist/linux/wit_transcriber
dist/windows/wit_transcriber_gui.exe
dist/linux/wit_transcriber_gui
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,5 @@ config.json
*.txt
*.mp*
*.m4a
*.exe
*.exe
last_run.log*
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ repos:
hooks:
- id: system
name: Requirements
entry: poetry export --format=requirements.txt --without-hashes --output=pyinstaller/requirements.txt
entry: poetry export --format=requirements.txt --without-hashes --output=requirements.txt
pass_filenames: false
language: system

Expand Down
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
pyinstaller-cli:
pyinstaller -F wit_transcriber/cli/app.py \
--clean -y \
--add-data="pyproject.toml:." \
-n wit_transcriber
pyinstaller-gui:
pyinstaller -F wit_transcriber/gui/app.py \
--clean -y \
--add-data="pyproject.toml:." \
--windowed \
-n wit_transcriber_gui
98 changes: 86 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,71 +1,145 @@
# wit_transcriber



A mini command line tool to transcribe media files using [wit.ai](https://wit.ai)



[![GitHub release](https://img.shields.io/github/release/yshalsager/wit_transcriber.svg)](https://github.com/yshalsager/wit_transcriber/releases/)



[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.png?v=103)](https://github.com/ellerbrock/open-source-badges/)

[![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/)



[![PayPal](https://img.shields.io/badge/PayPal-Donate-00457C?style=flat&labelColor=00457C&logo=PayPal&logoColor=white&link=https://www.paypal.me/yshalsager)](https://www.paypal.me/yshalsager)

[![Patreon](https://img.shields.io/badge/Patreon-Support-F96854?style=flat&labelColor=F96854&logo=Patreon&logoColor=white&link=https://www.patreon.com/XiaomiFirmwareUpdater)](https://www.patreon.com/XiaomiFirmwareUpdater)

[![Liberapay](https://img.shields.io/badge/Liberapay-Support-F6C915?style=flat&labelColor=F6C915&logo=Liberapay&logoColor=white&link=https://liberapay.com/yshalsager)](https://liberapay.com/yshalsager)



## Configuring Wit.ai



- Open [wit.ai](https://wit.ai/) and sign with Facebook account.

- Go to [wit.ai/apps](https://wit.ai/apps) and click on New App.

- Choose a name and select a language, set the app visibility to private, then press Create.

- Go to Management > Settings (`https://wit.ai/apps/<App ID>/settings`).

- Under the Client Access Token section click on the token to copy it, this is the API key.



## Usage



**Note**: ffmpeg must be installed!



Copy config example file to `config.json` and add required languages API keys you got from the previous step.



```bash

usage: wit_transcriber.py [-h] -i INPUT [-o OUTPUT] [-c CONFIG] [-x CONNECTIONS] [-l LANG] [-v]



options:
-h, --help show this help message and exit
-i INPUT, --input INPUT
Path of media file to be transcribed.
-o OUTPUT, --output OUTPUT
Path of output file.
-c CONFIG, --config CONFIG
Path of config file.
-x CONNECTIONS, --connections CONNECTIONS
Number of API connections limit.
-l LANG, --lang LANG Language to use.
-v, --verbose Print API responses.

-h, --help show this help message and exit

-i INPUT, --input INPUT

Path of media file to be transcribed.

-o OUTPUT, --output OUTPUT

Path of output file.

-c CONFIG, --config CONFIG

Path of config file.

-x CONNECTIONS, --connections CONNECTIONS

Number of API connections limit.

-l LANG, --lang LANG Language to use.

-v, --verbose Print API responses.

```



---



# أداة التفريغ النصي بواسطة wit.ai



أداة صغيرة لتفريغ الصوتيات عبر [wit.ai](https://wit.ai).



## إعداد Wit.ai



- افتح [wit.ai](https://wit.ai/) وسجل الدخول بحساب فيس بوك.

- افتح [wit.ai/apps](https://wit.ai/apps) واضغط على New App لإنشاء تطبيق جديد.

- اختر اسمًا للتطبيق واختر لغةَ ثم عدل إعدادات ظهور التطبيق إلى خاص واضغط إنشاء.

- افتح قسم اﻹدارة ثم اﻹعدادات Management > Settings (`https://wit.ai/apps/<App ID>/settings`).

- أسفل قسم Client Access Token section ستجد مفتاح استخدام الواجهة البرمجية، انسخه لتستخدمه في الخطوة التالية.



## الاستخدام



انسخ ملف config example إلى ملف باسم `config.json` ثم أضف مفاتيح استخدام الواجهة البرمجية الخاصة باللغات المطلوبة.



### تشغيل اﻷداة على ويندوز

#### من خلال الواجهة الرسومية
يمكن تحميل الاداة بواجهة رسومية [من هنا](/release/TranscribeArabic_v1.0.0.zip)
![main_window](/screenshots/1.png)
ثم اضافة مفتاح التشغيل الخاص بموقع wit.at من خلال شاشة الاعدادات كالتالي:
![settings_window](/screenshots/2.png)


#### من خلال اوامر التشغيل CMD

- حمل أحدث نسخة من الملف التنفيذي للأداة من [هنا](https://github.com/yshalsager/wit_transcriber/releases/latest).

- حمل ملفات ffmpeg إذا لم يكن مثبتا عندك من [هنا](https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.7z) وفك الضغط عن الملف ثم انقل `ffmpeg.exe` و `ffprobe.exe` إلى نفس المجلد الذي به الأداة.
- شغل الملف التنفيذي عبر سطر/موجه اﻷوامر مع استبدال كلمة filename باسم الملف المراد تفريغه.

- شغل الملف التنفيذي عبر سطر/موجه اﻷوامر مع استبدال كلمة filename باسم الملف المراد تفريغه.
```powershell
./wit_transcriber.exe -i filename
```
Binary file added main.ico
Binary file not shown.
Loading

0 comments on commit e88a7d8

Please sign in to comment.