Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SoundBufferRecorder recorder.start() returns EXC_BAD_ACCESS(code=1, address=0x0)  (Read 2758 times)

0 Members and 1 Guest are viewing this topic.

blakemac

  • Newbie
  • *
  • Posts: 3
    • View Profile
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
« Last Edit: May 25, 2015, 04:15:36 pm by blakemac »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10819
    • View Profile
    • development blog
    • Email
Do you mean recorder.start()?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

blakemac

  • Newbie
  • *
  • Posts: 3
    • View Profile
Whoops, yeah that meant to say recorder.start() like in the code sample, fixed it now, but the problem is still the same

Hapax

  • Hero Member
  • *****
  • Posts: 3351
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Your code, and the example code in the documentation for SoundBufferRecorder both fail for me too. Both fail (for me) at recorder.start() with "Failed to open the audio capture device..." and, in the example code, the buffer.saveToFile fails with "Format not recognised".
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
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.
SFML / OS X developer

blakemac

  • Newbie
  • *
  • Posts: 3
    • View Profile
That did the trick, you rock! And it got me to learn a lot about Cmake and Git haha, thanks

 

anything