Fixed compiling on linux
This commit is contained in:
		| @@ -25,4 +25,7 @@ target_include_directories(stb INTERFACE stb) | |||||||
| # OpenAL | # OpenAL | ||||||
| set(LIBTYPE "STATIC") | set(LIBTYPE "STATIC") | ||||||
| add_subdirectory(openal-soft) | add_subdirectory(openal-soft) | ||||||
|  |  | ||||||
|  | set(BUILD_TESTS OFF CACHE BOOL "Build tests") | ||||||
|  | set(BUILD_EXAMPLES OFF CACHE BOOL "Build examples") | ||||||
| add_subdirectory(AudioFile) | add_subdirectory(AudioFile) | ||||||
| @@ -6,7 +6,7 @@ | |||||||
| #pragma once | #pragma once | ||||||
| #include "scene/SceneItemComponent.hpp" | #include "scene/SceneItemComponent.hpp" | ||||||
| #include "display/RenderTarget.hpp" | #include "display/RenderTarget.hpp" | ||||||
| #include "scene/Scene.hpp " | #include "scene/Scene.hpp" | ||||||
|  |  | ||||||
| namespace Dawn { | namespace Dawn { | ||||||
|   enum CameraType { |   enum CameraType { | ||||||
|   | |||||||
| @@ -33,7 +33,7 @@ int main(int argc, char *argv[]) { | |||||||
|   } |   } | ||||||
|  |  | ||||||
|   // Load input file |   // Load input file | ||||||
|   AudioFile<double_t> audioFile; |   AudioFile<double> audioFile; | ||||||
|   if(!audioFile.load(strFileIn)) { |   if(!audioFile.load(strFileIn)) { | ||||||
|     printf("Failed to load audio file.\n"); |     printf("Failed to load audio file.\n"); | ||||||
|     return 1; |     return 1; | ||||||
| @@ -61,9 +61,9 @@ int main(int argc, char *argv[]) { | |||||||
|   fwrite(buffer, sizeof(char), bufferLength,  fileOut); |   fwrite(buffer, sizeof(char), bufferLength,  fileOut); | ||||||
|  |  | ||||||
|   // Convert Data to 16 bit audio |   // Convert Data to 16 bit audio | ||||||
|   for (int i = 0; i < audioFile.getNumSamplesPerChannel(); i++) { |   for (int32_t i = 0; i < audioFile.getNumSamplesPerChannel(); i++) { | ||||||
|     for(int y = 0; y < audioFile.getNumChannels(); y++) { |     for(int32_t y = 0; y < audioFile.getNumChannels(); y++) { | ||||||
|       double_t sample = audioFile.samples[y][i]; |       double sample = audioFile.samples[y][i]; | ||||||
|       sample = sample < -1 ? -1 : sample > 1 ? 1 : sample; |       sample = sample < -1 ? -1 : sample > 1 ? 1 : sample; | ||||||
|       auto q = static_cast<int16_t> (sample * 32767.); |       auto q = static_cast<int16_t> (sample * 32767.); | ||||||
|        |        | ||||||
|   | |||||||
| @@ -10,4 +10,5 @@ | |||||||
| #include <stdint.h> | #include <stdint.h> | ||||||
| #include <stdbool.h> | #include <stdbool.h> | ||||||
| #include <string.h> | #include <string.h> | ||||||
| #include <stdlib.h> | #include <stdlib.h> | ||||||
|  | #include <float.h> | ||||||
		Reference in New Issue
	
	Block a user