-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
150 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
cmake-build* | ||
build*/ | ||
.idea/ | ||
.idea/ | ||
modules/OpenBLAS* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
[submodule "modules/JUCE"] | ||
path = modules/JUCE | ||
url = https://github.com/juce-framework/JUCE | ||
[submodule "modules/SAF"] | ||
path = modules/SAF | ||
url = https://github.com/leomccormack/Spatial_Audio_Framework |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
if(MSVC) | ||
set(OPEN_BLAS_VERSION 0.3.26) | ||
set(OPEN_BLAS_DIR_NAME "OpenBLAS-${OPEN_BLAS_VERSION}") | ||
set(OPEN_BLAS_ROOTDIR ${CMAKE_CURRENT_SOURCE_DIR}/modules/${OPEN_BLAS_DIR_NAME}) | ||
|
||
if(EXISTS ${OPEN_BLAS_ROOTDIR}/) | ||
message(STATUS "OpenBLAS found at ${OPEN_BLAS_ROOTDIR}") | ||
else() | ||
file(MAKE_DIRECTORY ${OPEN_BLAS_ROOTDIR}/) | ||
message(STATUS "OpenBLAS library not found - preparing to download.") | ||
|
||
set(OPEN_BLAS_LIB_NAME "OpenBLAS-${OPEN_BLAS_VERSION}-x64.zip") | ||
set(OPEN_BLAS_URL "https://github.com/OpenMathLib/OpenBLAS/releases/download/v${OPEN_BLAS_VERSION}/${OPEN_BLAS_LIB_NAME}") | ||
set(OPEN_BLAS_PATH ${CMAKE_BINARY_DIR}/import/${OPEN_BLAS_LIB_NAME}) | ||
|
||
message(STATUS "Downloading: ${OPEN_BLAS_URL}") | ||
|
||
file(DOWNLOAD ${OPEN_BLAS_URL} ${OPEN_BLAS_PATH} | ||
STATUS OPEN_BLAS_DOWNLOAD_STATUS | ||
SHOW_PROGRESS) | ||
|
||
list(GET OPEN_BLAS_DOWNLOAD_STATUS 0 OPEN_BLAS_DOWNLOAD_STATUS_NO) | ||
|
||
if(OPEN_BLAS_DOWNLOAD_STATUS_NO EQUAL 0) | ||
message(STATUS "Successfully downloaded OpenBLAS library.") | ||
file(ARCHIVE_EXTRACT | ||
INPUT ${OPEN_BLAS_PATH} | ||
DESTINATION ${OPEN_BLAS_ROOTDIR}) | ||
|
||
message(STATUS "Extracted OpenBLAS to ${OPEN_BLAS_ROOTDIR}") | ||
else() | ||
message(WARNING "Failed to download OpenBLAS. Check your internet connection and try again.") | ||
file(REMOVE_RECURSE ${OPEN_BLAS_ROOTDIR}) | ||
file(REMOVE ${OPEN_BLAS_PATH}) | ||
endif() | ||
endif() | ||
|
||
get_directory_property(hasParent PARENT_DIRECTORY) | ||
if(hasParent) | ||
set(OPEN_BLAS_VERSION_USED "${OPEN_BLAS_VERSION}" PARENT_SCOPE) | ||
else () | ||
set(OPEN_BLAS_VERSION_USED "${OPEN_BLAS_VERSION}") | ||
endif() | ||
|
||
endif () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// | ||
// Created by Valentin Ackva on 13/04/2024. | ||
// | ||
|
||
#ifndef BINAURALPANNER_SOFAREADER_H | ||
#define BINAURALPANNER_SOFAREADER_H | ||
|
||
#include <JuceHeader.h> | ||
#include <saf.h> | ||
|
||
class SofaReader { | ||
public: | ||
SofaReader() { | ||
// SOFA_TEST_FILE_PATH defined in CMakeLists.txt - TODO load as Binary if possible | ||
error = saf_sofa_open(&sofa, SOFA_TEST_FILE_PATH, SAF_SOFA_READER_OPTION_DEFAULT); | ||
|
||
switch (error) { | ||
case SAF_SOFA_OK: | ||
std::cout << "Successfully loaded Sofa File" << std::endl; | ||
std::cout << "APIName: " << sofa.APIName << std::endl; | ||
std::cout << "APIVersion: " << sofa.APIVersion << std::endl; | ||
std::cout << "DataSamplingRate: " << sofa.DataSamplingRate << std::endl; | ||
break; | ||
case SAF_SOFA_ERROR_INVALID_FILE_OR_FILE_PATH: | ||
std::cout << "Not a SOFA file, or no such file was found in the specified location" << std::endl; | ||
break; | ||
case SAF_SOFA_ERROR_DIMENSIONS_UNEXPECTED: | ||
std::cout << "Dimensions of the SOFA data were not as expected" << std::endl; | ||
break; | ||
case SAF_SOFA_ERROR_FORMAT_UNEXPECTED: | ||
std::cout << "The data-type of the SOFA data was not as expected" << std::endl; | ||
break; | ||
case SAF_SOFA_ERROR_NETCDF_IN_USE: | ||
std::cout << "NetCDF is not thread safe!" << std::endl; | ||
break; | ||
} | ||
|
||
|
||
} | ||
|
||
private: | ||
SAF_SOFA_ERROR_CODES error; | ||
saf_sofa_container sofa; | ||
}; | ||
|
||
#endif //BINAURALPANNER_SOFAREADER_H |