Skip to content

Commit

Permalink
Merge pull request #2 from locaal-ai/roy.aws_transcribe
Browse files Browse the repository at this point in the history
AWS transcribe
  • Loading branch information
royshil authored Dec 18, 2024
2 parents 8c12d98 + c13ab90 commit fd27e65
Show file tree
Hide file tree
Showing 42 changed files with 5,567 additions and 113 deletions.
2 changes: 1 addition & 1 deletion .github/actions/build-plugin/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ runs:
run: |
Write-Host "::group::Build Windows Dependencies"
conan profile detect --force
conan install ${{github.workspace}}/conanfile_win.txt --output-folder=${{github.workspace}}/build_conan --build=missing -g CMakeDeps
conan install ${{github.workspace}} --output-folder=${{github.workspace}}/build_conan --build=missing -g CMakeDeps
Write-Host "::endgroup::"
- name: Run macOS Build
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ jobs:
name: Build for Ubuntu 🐧
runs-on: ubuntu-22.04
needs: check-event
if: false
defaults:
run:
shell: bash
Expand Down
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,11 @@ target_sources(
src/cloud-providers/cloud-provider.cpp
src/cloud-providers/clova/clova-provider.cpp
src/cloud-providers/google/google-provider.cpp
src/ssl-utils/ssl-utils.cpp
src/utils/ssl-utils.cpp
src/utils/curl-helper.cpp
src/timed-metadata/timed-metadata-utils.cpp)

add_subdirectory(src/cloud-translation)
add_subdirectory(src/cloud-providers/aws)

set_target_properties_plugin(${CMAKE_PROJECT_NAME} PROPERTIES OUTPUT_NAME ${_name})
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Build the plugin:
If you're developing the plugin, I find this command to be useful for direct deploymet into OBS after building:

```powershell
> .\.github\scripts\Build-Windows.ps1 -Configuration RelWithDebInfo -SkipDeps && Copy-Item -Force -Recurse .\release\RelWithDebInfo\* "C:\Program Files\obs-studio\"
> pwsh -ExecutionPolicy Bypass -File .\.github\scripts\Build-Windows.ps1 -Configuration RelWithDebInfo -SkipDeps && Copy-Item -Force -Recurse .\release\RelWithDebInfo\* "C:\Program Files\obs-studio\"
```

### Other Plugins
Expand Down
6 changes: 3 additions & 3 deletions buildspec.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
},
"name": "cloudvocal",
"displayName": "Realtime Professional-Grade Cloud Transcription and Translation Plugin",
"version": "0.0.1",
"version": "0.0.2",
"author": "Roy Shilkrot",
"website": "https://locaal.ai",
"website": "https://github.com/locaal-ai/cloudvocal",
"email": "[email protected]",
"uuids": {
"windowsApp": "00000000-0000-0000-0000-000000000000"
"windowsApp": "EC013006-E8B6-4A17-B6E5-C8DC66853231"
}
}
175 changes: 113 additions & 62 deletions cmake/BuildDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,76 +2,127 @@ cmake_minimum_required(VERSION 3.14)

list(APPEND CMAKE_PREFIX_PATH ${CMAKE_SOURCE_DIR}/build_conan)

if(WIN32)
set(GRPC_VERSION v1.68.0)

# get the prebuilt version from https://github.com/thommyho/Cpp-gRPC-Windows-PreBuilts/releases/
include(FetchContent)

set(grpc_url
"https://github.com/thommyho/Cpp-gRPC-Windows-PreBuilts/releases/download/${GRPC_VERSION}/MSVC143_64.zip")
FetchContent_Declare(grpc URL ${grpc_url} DOWNLOAD_EXTRACT_TIMESTAMP 1)
FetchContent_MakeAvailable(grpc)

find_package(OpenSSL CONFIG REQUIRED)
find_package(gRPC CONFIG REQUIRED)
find_package(protobuf CONFIG REQUIRED)
find_package(absl CONFIG REQUIRED)
find_package(ZLIB REQUIRED)
find_package(OpenSSL CONFIG REQUIRED)
find_package(c-ares CONFIG REQUIRED)
find_package(re2 CONFIG REQUIRED)
find_package(Boost CONFIG REQUIRED)
find_package(AWSSDK CONFIG REQUIRED)
find_package(BZip2 CONFIG REQUIRED)

# Specify include directories and link libraries for your project
list(APPEND DEPS_INCLUDE_DIRS ${grpc_SOURCE_DIR}/${CMAKE_BUILD_TYPE}/include ${openssl_INCLUDE_DIRS_RELEASE})
set(DEPS_LIB_DIRS ${grpc_SOURCE_DIR}/${CMAKE_BUILD_TYPE}/lib)
set(PROTOC_EXECUTABLE ${grpc_SOURCE_DIR}/${CMAKE_BUILD_TYPE}/bin/protoc.exe)
set(GRPC_PLUGIN_EXECUTABLE ${grpc_SOURCE_DIR}/${CMAKE_BUILD_TYPE}/bin/grpc_cpp_plugin.exe)

# get all .lib files in the lib directory
file(GLOB DEPS_LIBRARIES ${DEPS_LIB_DIRS}/*.lib)
else()
find_package(gRPC CONFIG REQUIRED)
find_package(protobuf CONFIG REQUIRED)
find_package(absl CONFIG REQUIRED)
find_package(ZLIB REQUIRED)
find_package(OpenSSL CONFIG REQUIRED)
find_package(c-ares CONFIG REQUIRED)
find_package(re2 CONFIG REQUIRED)

set(PROTOC_EXECUTABLE
${Protobuf_PROTOC_EXECUTABLE}
CACHE STRING "protoc executable")
set(GRPC_PLUGIN_EXECUTABLE
${GRPC_CPP_PLUGIN_PROGRAM}
CACHE STRING "gRPC plugin executable")
set(PROTOC_EXECUTABLE
${Protobuf_PROTOC_EXECUTABLE}
CACHE STRING "protoc executable")
set(GRPC_PLUGIN_EXECUTABLE
${GRPC_CPP_PLUGIN_PROGRAM}
CACHE STRING "gRPC plugin executable")
list(
APPEND
DEPS_LIBRARIES
${grpc_LIBS_RELEASE}
${abseil_LIBS_RELEASE}
${protobuf_LIBS_RELEASE}
${ZLIB_LIBRARIES}
${openssl_LIBS_RELEASE}
openssl::openssl
${c-ares_LIBS_RELEASE}
${re2_LIBS_RELEASE}
${boost_Boost_url_LIBS_RELEASE}
${aws-c-auth_LIBS_RELEASE}
${aws-c-cal_LIBS_RELEASE}
${aws-c-common_LIBS_RELEASE}
${aws-c-compression_LIBS_RELEASE}
${aws-c-event-stream_LIBS_RELEASE}
${aws-c-http_LIBS_RELEASE}
${aws-c-io_LIBS_RELEASE}
${aws-c-mqtt_LIBS_RELEASE}
${aws-c-s3_LIBS_RELEASE}
${aws-c-sdkutils_LIBS_RELEASE}
${aws-checksums_LIBS_RELEASE}
${aws-crt-cpp_LIBS_RELEASE}
${aws-sdk-cpp_LIBS_RELEASE}
${bzip2_LIBS_RELEASE})
if(WIN32)
list(
APPEND
DEPS_LIBRARIES
${grpc_LIBS_RELEASE}
${abseil_LIBS_RELEASE}
${protobuf_LIBS_RELEASE}
${ZLIB_LIBRARIES}
${openssl_LIBS_RELEASE}
${c-ares_LIBS_RELEASE}
${re2_LIBS_RELEASE})
list(
APPEND
DEPS_LIB_DIRS
${grpc_LIB_DIRS_RELEASE}
${abseil_LIB_DIRS_RELEASE}
${protobuf_LIB_DIRS_RELEASE}
${zlib_LIB_DIRS_RELEASE}
${openssl_LIB_DIRS_RELEASE}
${c-ares_LIB_DIRS_RELEASE}
${re2_LIB_DIRS_RELEASE})
list(
APPEND
DEPS_INCLUDE_DIRS
${gRPC_INCLUDE_DIRS}
${absl_INCLUDE_DIRS}
${protobuf_INCLUDE_DIRS_RELEASE}
${ZLIB_INCLUDE_DIRS}
${openssl_INCLUDE_DIRS_RELEASE}
${c-ares_INCLUDE_DIRS}
${re2_INCLUDE_DIRS})
userenv
advapi32
ws2_32
crypt32
bcrypt
winhttp
shlwapi
wininet
secur32
iphlpapi
netapi32
rpcrt4
shell32
version
ncrypt)
endif()
if(APPLE)
list(APPEND DEPS_LIBRARIES resolv)
endif()

list(
APPEND
DEPS_LIB_DIRS
${grpc_LIB_DIRS_RELEASE}
${abseil_LIB_DIRS_RELEASE}
${protobuf_LIB_DIRS_RELEASE}
${zlib_LIB_DIRS_RELEASE}
${openssl_LIB_DIRS_RELEASE}
${c-ares_LIB_DIRS_RELEASE}
${re2_LIB_DIRS_RELEASE}
${boost_LIB_DIRS_RELEASE}
${aws-c-auth_LIB_DIRS_RELEASE}
${aws-c-cal_LIB_DIRS_RELEASE}
${aws-c-common_LIB_DIRS_RELEASE}
${aws-c-compression_LIB_DIRS_RELEASE}
${aws-c-event-stream_LIB_DIRS_RELEASE}
${aws-c-http_LIB_DIRS_RELEASE}
${aws-c-io_LIB_DIRS_RELEASE}
${aws-c-mqtt_LIB_DIRS_RELEASE}
${aws-c-sdkutils_LIB_DIRS_RELEASE}
${aws-c-s3_LIB_DIRS_RELEASE}
${aws-checksums_LIB_DIRS_RELEASE}
${aws-crt-cpp_LIB_DIRS_RELEASE}
${aws-sdk-cpp_LIB_DIRS_RELEASE}
${bzip2_LIB_DIRS_RELEASE})
list(
APPEND
DEPS_INCLUDE_DIRS
${Boost_INCLUDE_DIRS}
${gRPC_INCLUDE_DIRS}
${absl_INCLUDE_DIRS}
${protobuf_INCLUDE_DIRS_RELEASE}
${ZLIB_INCLUDE_DIRS}
${openssl_INCLUDE_DIRS_RELEASE}
${c-ares_INCLUDE_DIRS}
${re2_INCLUDE_DIRS}
${aws-c-auth_INCLUDE_DIRS_RELEASE}
${aws-c-cal_INCLUDE_DIRS_RELEASE}
${aws-c-common_INCLUDE_DIRS_RELEASE}
${aws-c-compression_INCLUDE_DIRS_RELEASE}
${aws-c-event-stream_INCLUDE_DIRS_RELEASE}
${aws-c-http_INCLUDE_DIRS_RELEASE}
${aws-c-io_INCLUDE_DIRS_RELEASE}
${aws-c-mqtt_INCLUDE_DIRS_RELEASE}
${aws-c-sdkutils_INCLUDE_DIRS_RELEASE}
${aws-c-s3_INCLUDE_DIRS_RELEASE}
${aws-checksums_INCLUDE_DIRS_RELEASE}
${aws-crt-cpp_INCLUDE_DIRS_RELEASE}
${aws-sdk-cpp_INCLUDE_DIRS_RELEASE}
${bzip2_INCLUDE_DIRS_RELEASE})

message(STATUS "Dependencies include directories: ${DEPS_INCLUDE_DIRS}")
message(STATUS "Dependencies library directories: ${DEPS_LIB_DIRS}")
message(STATUS "Dependencies libraries: ${DEPS_LIBRARIES}")
message(STATUS "protoc executable: ${PROTOC_EXECUTABLE}")
message(STATUS "grpc_cpp_plugin executable: ${GRPC_PLUGIN_EXECUTABLE}")

Expand Down
3 changes: 2 additions & 1 deletion cmake/common/compiler_common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ set(_obs_clang_c_options
-Wfour-char-constants
-Winfinite-recursion
-Wint-conversion
-Wnewline-eof
-Wno-conversion
-Wno-error=newline-eof
-Wno-float-conversion
-Wno-implicit-fallthrough
-Wno-missing-braces
-Wno-missing-field-initializers
-Wno-missing-prototypes
-Wno-newline-eof
-Wno-semicolon-before-method-body
-Wno-shadow
-Wno-sign-conversion
Expand Down
2 changes: 1 addition & 1 deletion cmake/macos/xcode.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ set(CMAKE_XCODE_ATTRIBUTE_CLANG_WARN__DUPLICATE_METHOD_MATCH YES)
set(CMAKE_XCODE_ATTRIBUTE_GCC_NO_COMMON_BLOCKS YES)
set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_64_TO_32_BIT_CONVERSION YES)
set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS NO)
set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_ABOUT_MISSING_NEWLINE YES)
set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_ABOUT_MISSING_NEWLINE NO)
set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_ABOUT_RETURN_TYPE YES_ERROR)
set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_CHECK_SWITCH_STATEMENTS YES)
set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_FOUR_CHARACTER_CONSTANTS YES)
Expand Down
13 changes: 9 additions & 4 deletions conanfile.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
[requires]
grpc/1.67.1
protobuf/5.27.0
abseil/20240116.2
boost/1.86.0
grpc/1.48.4
protobuf/3.21.12
abseil/20230125.3
openssl/3.3.2
c-ares/1.34.3
c-ares/1.19.1
zlib/1.3.1
aws-sdk-cpp/1.11.352

[generators]
CMakeDeps

[options]
aws-sdk-cpp/1.11.352:transcribestreaming=True
5 changes: 0 additions & 5 deletions conanfile_win.txt

This file was deleted.

1 change: 1 addition & 0 deletions data/locale/en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ none_no_output="None (no output)"
language="Language"
translate_cloud="Translation"
transcription_cloud_provider_api_key="API Key"
transcription_cloud_provider_secret_key="Secret Key"
translate_cloud_explaination="Real-time translation. Requires an API key."
translate_cloud_provider="Translation provider"
target_language="Target language"
Expand Down
Loading

0 comments on commit fd27e65

Please sign in to comment.