schlechter Anfang
This commit is contained in:
@@ -14,15 +14,34 @@ set(CMAKE_CXX_STANDARD 17)
|
|||||||
set(CMAKE_BUILD_TYPE Debug)
|
set(CMAKE_BUILD_TYPE Debug)
|
||||||
|
|
||||||
#set(CMAKE_BUILD_TYPE Release)
|
#set(CMAKE_BUILD_TYPE Release)
|
||||||
|
|
||||||
add_compile_options(-fsanitize=address)
|
add_compile_options(-fsanitize=address)
|
||||||
add_link_options(-fsanitize=address)
|
add_link_options(-fsanitize=address)
|
||||||
|
|
||||||
|
|
||||||
|
add_compile_options(-ldl)
|
||||||
|
add_link_options(-ldl)
|
||||||
|
|
||||||
|
add_compile_options(-lpthread)
|
||||||
|
add_link_options(-lpthread)
|
||||||
|
|
||||||
|
|
||||||
|
add_compile_options(-lm)
|
||||||
|
add_link_options(-lm)
|
||||||
|
|
||||||
|
add_compile_options(-mavx2)
|
||||||
|
add_link_options(-mavx2)
|
||||||
|
|
||||||
|
|
||||||
|
add_compile_options(-msse2)
|
||||||
|
add_link_options(-msse2)
|
||||||
# Füge Includeverzeichnisse hinzu
|
# Füge Includeverzeichnisse hinzu
|
||||||
include_directories(include)
|
include_directories(include)
|
||||||
# Legt die Variable SRC_FILES an, die alle
|
# Legt die Variable SRC_FILES an, die alle
|
||||||
# .cpp-Dateien des Projekts benennt,
|
# .cpp-Dateien des Projekts benennt,
|
||||||
# die in Verzeichnis src/ liegen.
|
# die in Verzeichnis src/ liegen.
|
||||||
file(GLOB SRC_FILES
|
file(GLOB SRC_FILES
|
||||||
${PROJECT_SOURCE_DIR}/src/*.cpp)
|
${PROJECT_SOURCE_DIR}/src/*)
|
||||||
|
|
||||||
# Use CMakes FetchContent
|
# Use CMakes FetchContent
|
||||||
# Workaround for CMake >= 3.24
|
# Workaround for CMake >= 3.24
|
||||||
@@ -32,4 +51,4 @@ if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
add_executable(erstertest src/main.cpp ${SRC_FILES})
|
add_executable(${PROJECT_NAME} src/main.cpp ${SRC_FILES})
|
||||||
|
|||||||
14
include/LrcLibCrypt.hpp
Normal file
14
include/LrcLibCrypt.hpp
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#include <string>
|
||||||
|
|
||||||
|
class LrcLibCrypt
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
std::string PublishToken;
|
||||||
|
std::string prefix;
|
||||||
|
std::string nonce;
|
||||||
|
|
||||||
|
public:
|
||||||
|
LrcLibCrypt();
|
||||||
|
};
|
||||||
|
|
||||||
|
// https://lrclib.net/docs
|
||||||
95649
include/miniaudio.h
Normal file
95649
include/miniaudio.h
Normal file
File diff suppressed because it is too large
Load Diff
11
include/playaudio.hpp
Normal file
11
include/playaudio.hpp
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#include <string>
|
||||||
|
#include "miniaudio.h"
|
||||||
|
|
||||||
|
class audio
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
void data_callback(ma_device *pDevice, void *pOutput, const void *pInput, ma_uint32 frameCount);
|
||||||
|
|
||||||
|
public:
|
||||||
|
audio(std::string eingabe);
|
||||||
|
};
|
||||||
5
src/LrcLibCrypt.cpp
Normal file
5
src/LrcLibCrypt.cpp
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#include "../include/LrcLibCrypt.hpp"
|
||||||
|
|
||||||
|
LrcLibCrypt::LrcLibCrypt()
|
||||||
|
{
|
||||||
|
}
|
||||||
96
src/main.cpp
96
src/main.cpp
@@ -1,10 +1,102 @@
|
|||||||
|
#include "../include/miniaudio.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "../include/cube.hpp"
|
#include "../include/cube.hpp"
|
||||||
|
/*
|
||||||
int main()
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
std::cout << "so und nicht anders" << std::endl;
|
std::cout << "so und nicht anders" << std::endl;
|
||||||
cube erstercube;
|
cube erstercube;
|
||||||
std::cout << erstercube.linkeecke << std::endl;
|
std::cout << erstercube.linkeecke << std::endl;
|
||||||
|
ma_result result;
|
||||||
|
ma_engine engine;
|
||||||
|
|
||||||
|
if (argc < 2)
|
||||||
|
{
|
||||||
|
printf("No input file.");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
result = ma_engine_init(NULL, &engine);
|
||||||
|
if (result != MA_SUCCESS)
|
||||||
|
{
|
||||||
|
printf("Failed to initialize audio engine.");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
ma_engine_play_sound(&engine, argv[1], NULL);
|
||||||
|
|
||||||
|
printf("Press Enter to quit...");
|
||||||
|
getchar();
|
||||||
|
|
||||||
|
ma_engine_uninit(&engine);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
void data_callback(ma_device *pDevice, void *pOutput, const void *pInput, ma_uint32 frameCount)
|
||||||
|
{
|
||||||
|
ma_decoder *pDecoder = (ma_decoder *)pDevice->pUserData;
|
||||||
|
if (pDecoder == NULL)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ma_decoder_read_pcm_frames(pDecoder, pOutput, frameCount, NULL);
|
||||||
|
|
||||||
|
(void)pInput;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
ma_result result;
|
||||||
|
ma_decoder decoder;
|
||||||
|
ma_device_config deviceConfig;
|
||||||
|
ma_device device;
|
||||||
|
|
||||||
|
if (argc < 2)
|
||||||
|
{
|
||||||
|
printf("No input file.\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
result = ma_decoder_init_file(argv[1], NULL, &decoder);
|
||||||
|
if (result != MA_SUCCESS)
|
||||||
|
{
|
||||||
|
printf("Could not load file: %s\n", argv[1]);
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
|
|
||||||
|
deviceConfig = ma_device_config_init(ma_device_type_playback);
|
||||||
|
deviceConfig.playback.format = decoder.outputFormat;
|
||||||
|
deviceConfig.playback.channels = decoder.outputChannels;
|
||||||
|
deviceConfig.sampleRate = decoder.outputSampleRate;
|
||||||
|
deviceConfig.dataCallback = data_callback;
|
||||||
|
deviceConfig.pUserData = &decoder;
|
||||||
|
|
||||||
|
if (ma_device_init(NULL, &deviceConfig, &device) != MA_SUCCESS)
|
||||||
|
{
|
||||||
|
printf("Failed to open playback device.\n");
|
||||||
|
ma_decoder_uninit(&decoder);
|
||||||
|
return -3;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ma_device_start(&device) != MA_SUCCESS)
|
||||||
|
{
|
||||||
|
printf("Failed to start playback device.\n");
|
||||||
|
ma_device_uninit(&device);
|
||||||
|
ma_decoder_uninit(&decoder);
|
||||||
|
return -4;
|
||||||
|
}
|
||||||
|
|
||||||
|
// hier drin könnte dann das Lyric tracking stattfinden.
|
||||||
|
// argv kann auch als array und dann kann das zweite die lrc datei sein.
|
||||||
|
for (int i = 0; i < 1000000; i++)
|
||||||
|
{
|
||||||
|
std::cout << i << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
ma_device_uninit(&device);
|
||||||
|
ma_decoder_uninit(&decoder);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
2
src/miniaudio.c
Normal file
2
src/miniaudio.c
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
#define MINIAUDIO_IMPLEMENTATION
|
||||||
|
#include "../include/miniaudio.h"
|
||||||
0
src/playaudio.cpp
Normal file
0
src/playaudio.cpp
Normal file
Reference in New Issue
Block a user