Skip to content

Commit f70fea8

Browse files
authored
Replace BASS with minimp3+kissfft for audio decoding (#177)
This removes the proprietary BASS library and replaces it with: - minimp3: Header-only MP3 decoder (public domain) - kissfft: Small FFT library (BSD license) Benefits: - No more proprietary dependencies - Enables universal macOS builds (BASS lacked arm64 support) - Simpler distribution (no DLLs/dylibs to bundle) Changes: - Remove external/bass/ directory and all binaries - Add external/minimp3/ and external/kissfft/ - Simplify CMakeLists.txt (remove USE_MINIMP3 option) - Update MusicDecode.c to use only minimp3+kissfft - Remove BASS_Init from Editor.c - Update release workflow (no bass.dll copy) - Update README (remove libbass installation steps) Closes #157
1 parent 8556815 commit f70fea8

File tree

18 files changed

+4226
-1240
lines changed

18 files changed

+4226
-1240
lines changed

.github/workflows/release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ jobs:
4949
run: |
5050
New-Item -ItemType Directory -Force -Path package
5151
Copy-Item build/Release/RocketEditor.exe package/
52-
Copy-Item external/bass/win64/bass.dll package/
5352
Compress-Archive -Path package/* -DestinationPath RocketEditor-Windows.zip
5453
5554
- name: Upload artifact

CMakeLists.txt

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ set(VERSION_PATCH "0")
1313

1414
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR})
1515

16+
1617
if (APPLE)
1718
add_definitions(-DMACOSX -DEMGUI_MACOSX)
1819
add_compile_options(-Wall -Wno-format-security -Wno-deprecated-declarations)
@@ -71,19 +72,16 @@ set(RKT_PROJECT_INCLUDES ${RKT_PROJECT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/ext
7172
set(RKT_PROJECT_LIBS ${RKT_PROJECT_LIBS} rkt_tinycthread)
7273

7374
##############################################################################
74-
# BASS
75-
set(RKT_PROJECT_INCLUDES ${RKT_PROJECT_INCLUDES} ${CMAKE_SOURCE_DIR}/external/bass)
76-
if (APPLE)
77-
set(RKT_PROJECT_LIBS ${RKT_PROJECT_LIBS} ${CMAKE_SOURCE_DIR}/external/bass/mac/libbass.dylib)
78-
elseif (UNIX)
79-
set(RKT_PROJECT_LIBS ${RKT_PROJECT_LIBS} ${CMAKE_SOURCE_DIR}/external/bass/linux/libbass.so)
80-
elseif (MSVC)
81-
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
82-
set(RKT_PROJECT_LIBS ${RKT_PROJECT_LIBS} ${CMAKE_SOURCE_DIR}/external/bass/win64/bass.lib)
83-
else()
84-
set(RKT_PROJECT_LIBS ${RKT_PROJECT_LIBS} ${CMAKE_SOURCE_DIR}/external/bass/win32/bass.lib)
85-
endif()
86-
endif ()
75+
# AUDIO DECODING (minimp3+kissfft)
76+
77+
# kissfft library
78+
add_library(rkt_kissfft ${CMAKE_SOURCE_DIR}/external/kissfft/kiss_fft.c)
79+
target_include_directories(rkt_kissfft PUBLIC ${CMAKE_SOURCE_DIR}/external/kissfft)
80+
set(RKT_PROJECT_LIBS ${RKT_PROJECT_LIBS} rkt_kissfft)
81+
82+
# minimp3 is header-only
83+
set(RKT_PROJECT_INCLUDES ${RKT_PROJECT_INCLUDES} ${CMAKE_SOURCE_DIR}/external/minimp3)
84+
set(RKT_PROJECT_INCLUDES ${RKT_PROJECT_INCLUDES} ${CMAKE_SOURCE_DIR}/external/kissfft)
8785

8886
##############################################################################
8987
# EMGUI
@@ -185,10 +183,6 @@ if (APPLE)
185183

186184
set_source_files_properties(${RKT_RESOURCES_DATA} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
187185

188-
set(OSX_LIB_FILES ${CMAKE_SOURCE_DIR}/external/bass/mac/libbass.dylib)
189-
set_source_files_properties(${OSX_LIB_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION MacOS)
190-
set(RKT_PROJECT_SRCS ${RKT_PROJECT_SRCS} ${OSX_LIB_FILES})
191-
192186
set(RKT_PROJECT_SRCS ${GUI_TYPE} ${RKT_PROJECT_SRCS} ${CMAKE_CURRENT_SOURCE_DIR}/data/macosx/appnib.xib)
193187

194188
find_library(COCOA_FRAMEWORK Cocoa)
@@ -250,10 +244,6 @@ if (APPLE)
250244
COMMENT "Compiling appnib.xib")
251245
endif ()
252246

253-
# move the bass dll close to the executable
254-
if (MSVC)
255-
add_custom_command(TARGET ${RKT_EXE_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/external/bass/win32/bass.dll" $<TARGET_FILE_DIR:${RKT_EXE_NAME}>)
256-
endif ()
257247

258248

259249
##############################################################################

README.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -103,20 +103,10 @@ cd rocket
103103
tundra2 linux-gcc-release
104104
```
105105

106-
(optional) Install `libbass.so` from the repo folder:
107-
108-
```
109-
sudo cp external/bass/linux/libbass.so /usr/local/lib/
110-
sudo chmod a+rx /usr/local/lib/libbass.so
111-
sudo ldconfig
112-
```
113-
114-
115-
116106
Start rocket:
117107

118108
```
119-
LD_LIBRARY_PATH=external/bass/linux/ ./t2-output/linux-gcc-release-default/editor
109+
./t2-output/linux-gcc-release-default/editor
120110
```
121111
Start the basic example:
122112

0 commit comments

Comments
 (0)