bin: add more shortcuts
This commit is contained in:
parent
6e6b35629a
commit
87b000c390
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/sh
|
||||||
|
note "box/$(date +%F)-$1"
|
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
|
steam >/dev/null 2>&1 &
|
||||||
|
discord >/dev/null 2>&1 &
|
||||||
|
|
Binary file not shown.
|
@ -0,0 +1,36 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
from vosk import Model, KaldiRecognizer, SetLogLevel
|
||||||
|
import sys
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
import wave
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
SetLogLevel(0)
|
||||||
|
|
||||||
|
modelBase = '/home/janek/data/projects/_forks/vosk-api/python/example/models'
|
||||||
|
modelPath = os.path.join(modelBase, sys.argv[2] if len(sys.argv) > 2 else 'daanzu')
|
||||||
|
if not os.path.exists(modelPath):
|
||||||
|
print (f"Please download a model from https://alphacephei.com/vosk/models and unpack it to {modelPath}.", file=sys.stderr)
|
||||||
|
exit (1)
|
||||||
|
|
||||||
|
sample_rate=16000
|
||||||
|
model = Model(modelPath)
|
||||||
|
rec = KaldiRecognizer(model, sample_rate)
|
||||||
|
|
||||||
|
process = subprocess.Popen(['ffmpeg', '-loglevel', 'quiet', '-i',
|
||||||
|
sys.argv[1],
|
||||||
|
'-ar', str(sample_rate) , '-ac', '1', '-f', 's16le', '-'],
|
||||||
|
stdout=subprocess.PIPE)
|
||||||
|
|
||||||
|
while True:
|
||||||
|
data = process.stdout.read(4000)
|
||||||
|
if len(data) == 0:
|
||||||
|
break
|
||||||
|
if rec.AcceptWaveform(data):
|
||||||
|
res = json.loads(rec.Result())
|
||||||
|
print (res['text'])
|
||||||
|
|
||||||
|
res = json.loads(rec.FinalResult())
|
||||||
|
print (res['text'])
|
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/sh
|
||||||
|
launch ferdi
|
||||||
|
launch firefox MainThread
|
||||||
|
launch jetbrains-clion
|
||||||
|
timew
|
Binary file not shown.
Loading…
Reference in New Issue