diff --git a/README.md b/README.md index e46247e..4d2dc3c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Speech Box +# Vox Box A text-to-speech and speech-to-text server compatible with the OpenAI API, powered by backend support from Whisper, FunASR, Bark, and CosyVoice. diff --git a/hack/lib/windows/init.ps1 b/hack/lib/windows/init.ps1 index 813b1c8..2cc6f3b 100644 --- a/hack/lib/windows/init.ps1 +++ b/hack/lib/windows/init.ps1 @@ -13,5 +13,5 @@ Get-ChildItem -Path "$ROOT_DIR/hack/lib/windows" -File | ForEach-Object { } } -SpeechBox.Log.Errexit -Get-SpeechBoxVersionVar +VoxBox.Log.Errexit +Get-VoxBoxVersionVar diff --git a/hack/lib/windows/log.ps1 b/hack/lib/windows/log.ps1 index c3a4134..980685e 100644 --- a/hack/lib/windows/log.ps1 +++ b/hack/lib/windows/log.ps1 @@ -3,18 +3,18 @@ $log_level = $env:LOG_LEVEL -or "debug" $log_colorful = $env:LOG_COLORFUL -or $true -function SpeechBox.Log.Errexit { +function VoxBox.Log.Errexit { trap { $ErrorMessage = $_.Exception.Message $ErrorCode = $_.Exception.HResult - SpeechBox.Log.Panic -message $ErrorMessage -code $ErrorCode + VoxBox.Log.Panic -message $ErrorMessage -code $ErrorCode continue } } # Debug level logging. -function SpeechBox.Log.Debug { +function VoxBox.Log.Debug { param ( [Parameter(Position = 0)] [string]$message @@ -27,7 +27,7 @@ function SpeechBox.Log.Debug { } # Info level logging. -function SpeechBox.Log.Info { +function VoxBox.Log.Info { param ( [Parameter(Position = 0)] [string]$message @@ -47,7 +47,7 @@ function SpeechBox.Log.Info { } # Warn level logging. -function SpeechBox.Log.Warn { +function VoxBox.Log.Warn { param ( [Parameter(Position = 0)] [string]$message @@ -64,7 +64,7 @@ function SpeechBox.Log.Warn { } # Error level logging, log an error but keep going, don't dump the stack or exit. -function SpeechBox.Log.Error { +function VoxBox.Log.Error { param ( [Parameter(Position = 0)] [string]$message @@ -81,7 +81,7 @@ function SpeechBox.Log.Error { } # Fatal level logging, log an error but exit with 1, don't dump the stack or exit. -function SpeechBox.Log.Fatal { +function VoxBox.Log.Fatal { param ( [Parameter(Position = 0)] [string]$message @@ -99,7 +99,7 @@ function SpeechBox.Log.Fatal { } # Panic level logging, dump the error stack and exit. -function SpeechBox.Log.Panic { +function VoxBox.Log.Panic { param ( [string]$message, [int]$code = 1 diff --git a/hack/lib/windows/version.ps1 b/hack/lib/windows/version.ps1 index 24d5cb9..4976e19 100755 --- a/hack/lib/windows/version.ps1 +++ b/hack/lib/windows/version.ps1 @@ -1,5 +1,5 @@ # Define the function to get version variables -function Get-SpeechBoxVersionVar { +function Get-VoxBoxVersionVar { # Get the build date $BUILD_DATE = Get-Date -Format 'yyyy-MM-ddTHH:mm:ssZ' diff --git a/hack/windows/build.ps1 b/hack/windows/build.ps1 index 4f6b006..90b3ab3 100644 --- a/hack/windows/build.ps1 +++ b/hack/windows/build.ps1 @@ -13,12 +13,12 @@ function Build { Ignore-Thirdparty-InvalidFile poetry build if ($LASTEXITCODE -ne 0) { - SpeechBox.Log.Fatal "failed to run poetry build." + VoxBox.Log.Fatal "failed to run poetry build." } $whlFiles = Get-ChildItem -Path $distDir -Filter "*.whl" -File if ($whlFiles.Count -eq 0) { - SpeechBox.Log.Fatal "no wheel files found in $distDir" + VoxBox.Log.Fatal "no wheel files found in $distDir" } foreach ($whlFile in $whlFiles) { @@ -28,7 +28,7 @@ function Build { $newFilePath = Join-Path -Path $distDir -ChildPath $newName Remove-Item -Path $newFilePath -Force -ErrorAction SilentlyContinue Rename-Item -Path $whlFile.FullName -NewName $newFilePath -Force - SpeechBox.Log.Info "renamed $orginalName to $newName" + VoxBox.Log.Info "renamed $orginalName to $newName" } } @@ -42,8 +42,8 @@ function Set-Version { $gitCommit = if ($null -ne $global:GIT_COMMIT) { $global:GIT_COMMIT } else { "HEAD" } $gitCommitShort = $gitCommit.Substring(0, [Math]::Min(7, $gitCommit.Length)) - SpeechBox.Log.Info "setting version to $version" - SpeechBox.Log.Info "setting git commit to $gitCommitShort" + VoxBox.Log.Info "setting version to $version" + VoxBox.Log.Info "setting git commit to $gitCommitShort" # Replace the __version__ variable in the __init__.py file $fileContent = Get-Content -Path $versionFile @@ -60,7 +60,7 @@ function Restore-Version-File { git checkout -- $versionFile if ($LASTEXITCODE -ne 0) { - SpeechBox.Log.Fatal "failed restore version file." + VoxBox.Log.Fatal "failed restore version file." } } @@ -68,13 +68,13 @@ function Restore-Version-File { # main # -SpeechBox.Log.Info "+++ BUILD +++" +VoxBox.Log.Info "+++ BUILD +++" try { Install-Dependency Set-Version Build Restore-Version-File } catch { - SpeechBox.Log.Fatal "failed to build: $($_.Exception.Message)" + VoxBox.Log.Fatal "failed to build: $($_.Exception.Message)" } -SpeechBox.Log.Info "--- BUILD ---" +VoxBox.Log.Info "--- BUILD ---" diff --git a/hack/windows/ci.ps1 b/hack/windows/ci.ps1 index 90c38e0..50a1510 100644 --- a/hack/windows/ci.ps1 +++ b/hack/windows/ci.ps1 @@ -30,10 +30,10 @@ function Invoke-CI { # main # -SpeechBox.Log.Info "+++ CI +++" +VoxBox.Log.Info "+++ CI +++" try { Invoke-CI $args } catch { - SpeechBox.Log.Fatal "failed run ci: $($_.Exception.Message)" + VoxBox.Log.Fatal "failed run ci: $($_.Exception.Message)" } -SpeechBox.Log.Info "--- CI ---" +VoxBox.Log.Info "--- CI ---" diff --git a/hack/windows/install.ps1 b/hack/windows/install.ps1 index 6747500..11d37c7 100644 --- a/hack/windows/install.ps1 +++ b/hack/windows/install.ps1 @@ -14,17 +14,17 @@ function Install-Dependency { pip install poetry==1.8.3 pre-commit==4.0.1 if ($LASTEXITCODE -ne 0) { - SpeechBox.Log.Fatal "failed to install poetry." + VoxBox.Log.Fatal "failed to install poetry." } poetry install if ($LASTEXITCODE -ne 0) { - SpeechBox.Log.Fatal "failed run poetry install." + VoxBox.Log.Fatal "failed run poetry install." } poetry run pre-commit install if ($LASTEXITCODE -ne 0) { - SpeechBox.Log.Fatal "failed run pre-commint install." + VoxBox.Log.Fatal "failed run pre-commint install." } } @@ -32,11 +32,11 @@ function Install-Dependency { # main # -SpeechBox.Log.Info "+++ DEPENDENCIES +++" +VoxBox.Log.Info "+++ DEPENDENCIES +++" try { Install-Dependency } catch { - SpeechBox.Log.Fatal "failed to download dependencies: $($_.Exception.Message)" + VoxBox.Log.Fatal "failed to download dependencies: $($_.Exception.Message)" } -SpeechBox.Log.Info "-- DEPENDENCIES ---" +VoxBox.Log.Info "-- DEPENDENCIES ---" diff --git a/hack/windows/lint.ps1 b/hack/windows/lint.ps1 index 28809b6..716ec06 100644 --- a/hack/windows/lint.ps1 +++ b/hack/windows/lint.ps1 @@ -18,33 +18,33 @@ function Lint { [string]$path ) - SpeechBox.Log.Info "linting $path" + VoxBox.Log.Info "linting $path" $result = Invoke-ScriptAnalyzer -Path $ROOT_DIR -Recurse -EnableExit -ExcludeRule PSUseBOMForUnicodeEncodedFile,PSAvoidUsingPlainTextForPassword,PSAvoidUsingInvokeExpression, PSReviewUnusedParameter, PSUseApprovedVerbs, PSAvoidGlobalVars, PSUseShouldProcessForStateChangingFunctions, PSAvoidUsingWriteHost $result | Format-Table -AutoSize if ($result.Length -ne 0) { - SpeechBox.Log.Fatal "failed with Invoke-ScriptAnalyzer lint." + VoxBox.Log.Fatal "failed with Invoke-ScriptAnalyzer lint." } poetry run pre-commit run flake8 --all-files if ($LASTEXITCODE -ne 0) { - SpeechBox.Log.Fatal "failed with flake8 lint." + VoxBox.Log.Fatal "failed with flake8 lint." } poetry run pre-commit run black --all-files if ($LASTEXITCODE -ne 0) { - SpeechBox.Log.Fatal "failed with black lint." + VoxBox.Log.Fatal "failed with black lint." } poetry run pre-commit run check-yaml --all-files if ($LASTEXITCODE -ne 0) { - SpeechBox.Log.Fatal "failed with check-yaml lint." + VoxBox.Log.Fatal "failed with check-yaml lint." } poetry run pre-commit run debug-statements --all-files if ($LASTEXITCODE -ne 0) { - SpeechBox.Log.Fatal "failed with debug-statements lint." + VoxBox.Log.Fatal "failed with debug-statements lint." } poetry run pre-commit run end-of-file-fixer --all-files if ($LASTEXITCODE -ne 0) { - SpeechBox.Log.Fatal "failed with end-of-file-fixer lint." + VoxBox.Log.Fatal "failed with end-of-file-fixer lint." } } @@ -52,12 +52,12 @@ function Lint { # main # -SpeechBox.Log.Info "+++ LINT +++" +VoxBox.Log.Info "+++ LINT +++" try { Get-PSScriptAnalyzer Lint "vox_box" } catch { - SpeechBox.Log.Fatal "failed to lint: $($_.Exception.Message)" + VoxBox.Log.Fatal "failed to lint: $($_.Exception.Message)" } -SpeechBox.Log.Info "--- LINT ---" +VoxBox.Log.Info "--- LINT ---" diff --git a/hack/windows/publish-pypi.ps1 b/hack/windows/publish-pypi.ps1 index 2f98538..d6f3d74 100644 --- a/hack/windows/publish-pypi.ps1 +++ b/hack/windows/publish-pypi.ps1 @@ -11,7 +11,7 @@ function Publish-Pypi { poetry run twine check dist/*.whl poetry run twine upload dist/*.whl if ($LASTEXITCODE -ne 0) { - SpeechBox.Log.Fatal "twine upload failed." + VoxBox.Log.Fatal "twine upload failed." } } @@ -19,11 +19,11 @@ function Publish-Pypi { # main # -SpeechBox.Log.Info "+++ Publish Pypi +++" +VoxBox.Log.Info "+++ Publish Pypi +++" try { Publish-Pypi } catch { - SpeechBox.Log.Fatal "failed to publish Pypi: $($_.Exception.Message)" + VoxBox.Log.Fatal "failed to publish Pypi: $($_.Exception.Message)" } -SpeechBox.Log.Info "--- Publish Pypi ---" +VoxBox.Log.Info "--- Publish Pypi ---" diff --git a/hack/windows/test.ps1 b/hack/windows/test.ps1 index 033687e..62938aa 100644 --- a/hack/windows/test.ps1 +++ b/hack/windows/test.ps1 @@ -9,7 +9,7 @@ $ROOT_DIR = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent | Split- function Test { poetry run pytest if ($LASTEXITCODE -ne 0) { - SpeechBox.Log.Fatal "failed to run poetry run pytest." + VoxBox.Log.Fatal "failed to run poetry run pytest." } } @@ -17,10 +17,10 @@ function Test { # main # -SpeechBox.Log.Info "+++ TEST +++" +VoxBox.Log.Info "+++ TEST +++" try { Test } catch { - SpeechBox.Log.Fatal "failed to test: $($_.Exception.Message)" + VoxBox.Log.Fatal "failed to test: $($_.Exception.Message)" } -SpeechBox.Log.Info "--- TEST ---" +VoxBox.Log.Info "--- TEST ---"