raysan5 / raudio Goto Github PK
View Code? Open in Web Editor NEWA simple and easy-to-use audio library based on miniaudio
License: zlib License
A simple and easy-to-use audio library based on miniaudio
License: zlib License
I'm trying to compile raudio on it's own for a CLI based game, but I am getting a lot of undefined references, which tells me it's a linker problem.
I have tried to compile raudio.c into an object file, compile my main.cpp file into main.o and from there compile them together. I also tried to it all in one swoop with g++ main.cpp include/raudio.c -I include/ -I include/external -DRAUDIO_STANDALONE -DSUPPORT_FILEFORMAT_WAV
I also noticed that when I did -DRAUDIO_STANDALONE, I had to comment out the definition in raudio.h otherwise I would get a redefinition error, but if I didn't do DRAUDIO_STANDALONE and I left the definition in raudio.h, it would look for raylib.h.
I'm sure this is a big case of my just know enough to case damage.
I'm trying to build raudio as a DLL to use in my project with GCC 12.2.0 on MSYS2 mingw64:
gcc -DRAUDIO_STANDALONE -DSUPPORT_FILEFORMAT_WAV -DSUPPORT_FILEFORMAT_OGG -DSUPPORT_FILEFORMAT_MP3 -DSUPPORT_FILEFORMAT_FLAC -Wall raudio.c -shared -o raudio.dll
However, the result DLL doesn't have any exports according to dumpbin
:
Section contains the following exports for raudio.dll
00000000 characteristics
64C4D182 time date stamp Sat Jul 29 10:44:50 2023
0.00 version
1 ordinal base
0 number of functions
0 number of names
What would be the correct way to build it as a shared DLL?
The main problem is how to inform the main thread about the music stream update, because the option to add an audio processor does not work at all for me.
SetAudioStreamCallback
function works correctly, since there is no possibility of iterating over callbacks.
Tested in GCC 12.2.0, Debian 12 (bookworm)
From my code:
void AudioDecoder::output(char* pFileName) {
gStreamTs = new StreamTimestamp();
gSpectrum = new AudioSpectrum();
SetMasterVolume(1.0);
PlayMusicStream(gMusic);
AttachAudioStreamProcessor(gMusic.stream, audioCallback);
while(true) {
UpdateMusicStream(gMusic);
}
}
void AudioDecoder::audioCallback(void *bufferData, unsigned int frames) {
/* Callback is here, regardless of the structure,
* we get SIGSEGV at the input of this pointer. */
}
Right now WAV files can only be full loaded as Sound
.
It will be desirable to load them for streaming, like we can do with other audio file-formats.
it seem that raudio mismatch with the raylib main branch
Hello. I haven't seen any functions that expose any asynchronous functionality. It is doable in this library? I understand that it's based on miniaudio which itself allows for async sound loading.
Hello
I'm using raudio for a project, and I would like to have the ability to 'render' a wav file faster than realtime.
What I have done for now is to modify raudio_standalone.c example, and save the pFramesOut content to wav, at the end of OnSendAudioDataToDevice.
So I can save raylib output to .wav, but the rendering time is still the real time.
What I'd like to do now is to call OnSendAudioDataToDevice() manually, and save the output data to .wav.
When I tried this, I get some output but it sounds like very small buffers repeated again and again.
Is there anything else I have to do to 'simulate' the callback from miniAudio, except calling it ?
Thanks for you help
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.