diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index 008a646..ad398c4 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -33,7 +33,19 @@ jobs: mkdir upload\lib\debug mkdir upload\include copy build\windows\x64\release\alt-voice.lib upload\lib\release + copy build\windows\x64\release\opus.lib upload\lib\release + copy build\windows\x64\release\rnnoise.lib upload\lib\release + copy build\windows\x64\release\bass.lib upload\lib\release + copy build\windows\x64\release\bass_fx.lib upload\lib\release copy build\windows\x64\debug\alt-voice.lib upload\lib\debug + copy build\windows\x64\debug\opus.lib upload\lib\debug + copy build\windows\x64\debug\rnnoise.lib upload\lib\debug + copy build\windows\x64\debug\bass.lib upload\lib\debug + copy build\windows\x64\debug\bass_fx.lib upload\lib\debug + copy build\windows\x64\release\bass_fx.dll upload\bin\release + copy build\windows\x64\release\bass.dll upload\bin\release + copy build\windows\x64\debug\bass_fx.dll upload\bin\debug + copy build\windows\x64\debug\bass.dll upload\bin\debug copy include\alt-voice.h upload\include copy include\IAudioFilter.h upload\include copy include\IOpusDecoder.h upload\include diff --git a/include/alt-voice.h b/include/alt-voice.h index 1dc8b3e..49f799a 100644 --- a/include/alt-voice.h +++ b/include/alt-voice.h @@ -11,36 +11,14 @@ constexpr int AUDIO_CHANNELS = 1; constexpr int FRAME_SIZE_SAMPLES = SAMPLE_RATE / 10; constexpr int FRAME_SIZE_BYTES = FRAME_SIZE_SAMPLES * sizeof(int16_t); -#ifndef ALT_VOICE_API - #if defined(ALT_LIB_STATIC) - #define ALT_VOICE_API - #elif defined(_WIN32) - #if defined(ALT_VOICE_LIB) - #define ALT_VOICE_API __declspec(dllexport) - #else - #define ALT_VOICE_API __declspec(dllimport) - #endif - #else - #define ALT_VOICE_API extern - #endif -#endif - -#if defined(__cplusplus) -extern "C" { -#endif - -ALT_VOICE_API AltVoiceError AV_Initialize(); -ALT_VOICE_API AltVoiceError AV_CreateSoundOutput(int bitrate, ISoundIO** soundOutput); -ALT_VOICE_API AltVoiceError AV_CreateSoundInput(int bitrate, ISoundIO** soundInput); -ALT_VOICE_API void AV_DestroySoundInput(ISoundIO* input); -ALT_VOICE_API const char* AV_GetVoiceErrorText(AltVoiceError error); -ALT_VOICE_API AltVoiceError AV_CreateOpusEncoder(IOpusEncoder** opusEncoder, int bitRate); -ALT_VOICE_API AltVoiceError AV_CreateOpusDecoder(IOpusDecoder** opusDecoder); -ALT_VOICE_API void AV_DestroyOpusEncoder(IOpusEncoder* opusEncoder); -ALT_VOICE_API void AV_DestroyOpusDecoder(IOpusDecoder* opusDecoder); -ALT_VOICE_API AltVoiceError AV_CreateAudioFilter(IAudioFilter** audioFilter); -ALT_VOICE_API void AV_DestroyAudioFilter(IAudioFilter* audioFilter); - -#if defined(__cplusplus) -} -#endif \ No newline at end of file +AltVoiceError AV_Initialize(); +AltVoiceError AV_CreateSoundOutput(int bitrate, ISoundIO** soundOutput); +AltVoiceError AV_CreateSoundInput(int bitrate, ISoundIO** soundInput); +void AV_DestroySoundInput(ISoundIO* input); +const char* AV_GetVoiceErrorText(AltVoiceError error); +AltVoiceError AV_CreateOpusEncoder(IOpusEncoder** opusEncoder, int bitRate); +AltVoiceError AV_CreateOpusDecoder(IOpusDecoder** opusDecoder); +void AV_DestroyOpusEncoder(IOpusEncoder* opusEncoder); +void AV_DestroyOpusDecoder(IOpusDecoder* opusDecoder); +AltVoiceError AV_CreateAudioFilter(IAudioFilter** audioFilter); +void AV_DestroyAudioFilter(IAudioFilter* audioFilter); diff --git a/src/alt-voice.cpp b/src/alt-voice.cpp index 847a942..0b89f00 100644 --- a/src/alt-voice.cpp +++ b/src/alt-voice.cpp @@ -91,7 +91,7 @@ const char * AV_GetVoiceErrorText(const AltVoiceError error) } } -ALT_VOICE_API AltVoiceError AV_CreateOpusEncoder(IOpusEncoder** opusEncoder, int bitRate) +AltVoiceError AV_CreateOpusEncoder(IOpusEncoder** opusEncoder, int bitRate) { try { @@ -105,7 +105,7 @@ ALT_VOICE_API AltVoiceError AV_CreateOpusEncoder(IOpusEncoder** opusEncoder, int } } -ALT_VOICE_API AltVoiceError AV_CreateOpusDecoder(IOpusDecoder** opusDecoder) +AltVoiceError AV_CreateOpusDecoder(IOpusDecoder** opusDecoder) { try { @@ -119,7 +119,7 @@ ALT_VOICE_API AltVoiceError AV_CreateOpusDecoder(IOpusDecoder** opusDecoder) } } -ALT_VOICE_API AltVoiceError AV_CreateAudioFilter(IAudioFilter** audioFilter) +AltVoiceError AV_CreateAudioFilter(IAudioFilter** audioFilter) { try { @@ -133,17 +133,17 @@ ALT_VOICE_API AltVoiceError AV_CreateAudioFilter(IAudioFilter** audioFilter) } } -ALT_VOICE_API void AV_DestroyOpusEncoder(const IOpusEncoder* opusEncoder) +void AV_DestroyOpusEncoder(const IOpusEncoder* opusEncoder) { delete opusEncoder; } -ALT_VOICE_API void AV_DestroyOpusDecoder(const IOpusDecoder* opusDecoder) +void AV_DestroyOpusDecoder(const IOpusDecoder* opusDecoder) { delete opusDecoder; } -ALT_VOICE_API void AV_DestroyAudioFilter(const IAudioFilter* audioFilter) +void AV_DestroyAudioFilter(const IAudioFilter* audioFilter) { delete audioFilter; } diff --git a/xmake.lua b/xmake.lua index 5c9c5b6..cb88b32 100644 --- a/xmake.lua +++ b/xmake.lua @@ -18,7 +18,6 @@ target("alt-voice") add_headerfiles("src/**.h", "include/**.h") add_includedirs("src/", "include/", { public = true }) add_packages("bass", "bass-fx", "libopus", "rnnoise") - add_defines("ALT_LIB_STATIC") after_build(function (target) for pkg, pkg_details in pairs(target:pkgs()) do if os.isdir(pkg_details._INFO.installdir) then @@ -36,6 +35,5 @@ target("devicetests") add_files("examples/devicetests.cpp") add_packages("bass", "bass-fx", "libopus") add_deps("alt-voice") - add_defines("ALT_LIB_STATIC") add_rules("plugin.vsxmake.autoupdate") \ No newline at end of file