schlechter Anfang

This commit is contained in:
Cedric
2025-10-04 01:46:19 +02:00
parent a79212b525
commit 3693e47357
9 changed files with 95796 additions and 4 deletions

5
src/LrcLibCrypt.cpp Normal file
View File

@@ -0,0 +1,5 @@
#include "../include/LrcLibCrypt.hpp"
LrcLibCrypt::LrcLibCrypt()
{
}

View File

@@ -1,10 +1,102 @@
#include "../include/miniaudio.h"
#include <iostream>
#include "../include/cube.hpp"
int main()
/*
int main(int argc, char **argv)
{
std::cout << "so und nicht anders" << std::endl;
cube erstercube;
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;
}

2
src/miniaudio.c Normal file
View File

@@ -0,0 +1,2 @@
#define MINIAUDIO_IMPLEMENTATION
#include "../include/miniaudio.h"

0
src/playaudio.cpp Normal file
View File