I'm trying to record audio (using Xcode) and when I reach the command recorder.start() I'm getting EXC_BAD_ACCESS(code=1, address=0x0). I've made a small example that still gives me the error:
#include <iostream>
#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>
using namespace std;
using namespace sf;
int main(int argc, char const** argv)
{
// Create the main window
RenderWindow window(sf::VideoMode(800, 600), "My new window");
if (!SoundBufferRecorder::isAvailable()) {
return EXIT_FAILURE;
}
sf::SoundBufferRecorder recorder;
recorder.start();
recorder.stop();
return EXIT_SUCCESS;
}
Any help would be very greatly appreciated! :D
Do you also get a stack trace similar to this?
0 libsystem_c.dylib 0x00007fff91c7c152 strlen + 18
1 org.sfml-dev.OpenAL 0x0000000101da3a8c al_string_copy_cstr + 28
2 org.sfml-dev.OpenAL 0x0000000101db21b3 ca_open_capture + 2115
3 org.sfml-dev.OpenAL 0x0000000101d9451b alcCaptureOpenDevice + 587
4 libsfml-audio.2.3.dylib 0x0000000101d3ac98 sf::SoundRecorder::start(unsigned int) + 296
5 sound-capture 0x0000000101d2c894 main + 228
6 libdyld.dylib 0x00007fff917c95c9 start + 1
Note that this is an issue with the OpenAL version shipped with SFML since https://github.com/SFML/SFML/commit/ce16554763177d7285248e81e9b0e0201f0c43e3. You can revert that commit, remove /Library/Frameworks/OpenAl.frameworks, recompile SFML and use it.
However you might have other issues, namely https://github.com/SFML/SFML/issues/541.