Fixed compiling on linux

This commit is contained in:
2023-02-03 06:11:31 -08:00
parent 3c0fa9d602
commit 7db25fc659
4 changed files with 10 additions and 6 deletions

View File

@ -25,4 +25,7 @@ target_include_directories(stb INTERFACE stb)
# OpenAL
set(LIBTYPE "STATIC")
add_subdirectory(openal-soft)
set(BUILD_TESTS OFF CACHE BOOL "Build tests")
set(BUILD_EXAMPLES OFF CACHE BOOL "Build examples")
add_subdirectory(AudioFile)

View File

@ -6,7 +6,7 @@
#pragma once
#include "scene/SceneItemComponent.hpp"
#include "display/RenderTarget.hpp"
#include "scene/Scene.hpp "
#include "scene/Scene.hpp"
namespace Dawn {
enum CameraType {

View File

@ -33,7 +33,7 @@ int main(int argc, char *argv[]) {
}
// Load input file
AudioFile<double_t> audioFile;
AudioFile<double> audioFile;
if(!audioFile.load(strFileIn)) {
printf("Failed to load audio file.\n");
return 1;
@ -61,9 +61,9 @@ int main(int argc, char *argv[]) {
fwrite(buffer, sizeof(char), bufferLength, fileOut);
// Convert Data to 16 bit audio
for (int i = 0; i < audioFile.getNumSamplesPerChannel(); i++) {
for(int y = 0; y < audioFile.getNumChannels(); y++) {
double_t sample = audioFile.samples[y][i];
for (int32_t i = 0; i < audioFile.getNumSamplesPerChannel(); i++) {
for(int32_t y = 0; y < audioFile.getNumChannels(); y++) {
double sample = audioFile.samples[y][i];
sample = sample < -1 ? -1 : sample > 1 ? 1 : sample;
auto q = static_cast<int16_t> (sample * 32767.);

View File

@ -10,4 +10,5 @@
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include <stdlib.h>
#include <stdlib.h>
#include <float.h>