Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1 from occ-ai/roy.fix_crash_missing_langage
Browse files Browse the repository at this point in the history
Add KMP_DUPLICATE_LIB_OK flag to .env file for Windows and Linux builds
  • Loading branch information
royshil authored Apr 29, 2024
2 parents c1db5e3 + 1bd6114 commit 0226695
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,15 @@ jobs:
run: |
echo "LOCAL_RELEASE_TAG=${GITHUB_REF_NAME}" >> .env
echo "LOCAL_RELEASE_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> .env
echo "KMP_DUPLICATE_LIB_OK=TRUE" >> .env
- name: Write .env file Windows
if: matrix.os == 'windows-latest'
run: |
@"
LOCAL_RELEASE_TAG=$env:GITHUB_REF_NAME
LOCAL_RELEASE_DATE=$(Get-Date -Format 'yyyy-MM-ddTHH:mm:ssZ')
KMP_DUPLICATE_LIB_OK=TRUE
"@ | Out-File -FilePath .env -Encoding ASCII
shell: pwsh

Expand Down
12 changes: 9 additions & 3 deletions audio_capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,19 @@ def get_chunk_size_frames(self):

@staticmethod
def get_audio_devices() -> list[AudioSource]:
devices = sd.query_devices(kind="input")
devices = sd.query_devices()
devices_list = []
if type(devices) is dict:
devices = [devices]
devices_list = [devices]
else:
for device in devices:
if device["max_input_channels"] > 0:
logger.debug(f"Audio device: {device}")
devices_list.append(device)
return [
AudioSource(
sourceName=device["name"],
sourceType=AudioSource.SourceType.DEVICE,
)
for device in devices
for device in devices_list
]
1 change: 1 addition & 0 deletions transcription.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def __init__(self):
self.input_queue = queue.Queue()
self.model = None
self.running = False
self.language = None
# check if model has been downloaded already
checkAndDownloadModel(ModelDownloadInfo.FASTER_WHISPER_TINY_CT2)

Expand Down

0 comments on commit 0226695

Please sign in to comment.