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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - binaryduke

Pages: [1]
1
Audio / Re: Struggling with recorder.getBuffer() - help appreciated
« on: September 08, 2018, 04:07:44 pm »
I see from this post:
https://github.com/SFML/SFML/issues/970

that globals are to be avoided so will attempt something with pointers to the Sound and SoundBufferRecorder.

I can't see any other way to make this work with a modeless dialog box that holds the audio controls but would appreciate any ideas other than the pointer route.

2
Audio / Re: Struggling with recorder.getBuffer() - help appreciated
« on: September 08, 2018, 03:52:12 pm »
Thanks for the quick response. I thought that may be the case.

When I've tested with creating the sound recorder and sound instances as globals so that they're accessible to the call back, the application hangs at startup for which I can't find any explanation :(

3
Audio / Struggling with recorder.getBuffer() - help appreciated
« on: September 08, 2018, 03:29:22 pm »
I am creating a simple modeless dialog box that deals with the recording and playback of audio and has UI controls for record and playback. In the dialog box's procedure I am trying to manage the SFML audio functions but when I try to access the buffer contents after recording, they appear to be empty. The saved .wav file is consistently only 44kb.

Here's the basics of the audio handling within the procedure. I'd appreciate a steer as to what I'm missing regarding accessing the buffer's contents.

INT_PTR CALLBACK VJWindowProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
        //declare these outside the switch statement handling button messages so they're available to the buttons
        sf::Sound sound;
        sf::SoundBufferRecorder recorder;

        switch (Message)
        {
        case WM_COMMAND:
                switch (LOWORD(wParam))
                {
                case IDC_STOP:  //this is the dialog box's End Recording button
                        recorder.stop();
                        //Now the capture has ended we can get the buffer. Test saving the file and also playing it.

                        const sf::SoundBuffer& buffer = recorder.getBuffer();
                        buffer.saveToFile("TESTRECORDING.wav");
                        sound.setBuffer(buffer);
                        sound.play();
                        break;

                case IDC_RECORD: //this is the dialog box's Start Recording button
                        recorder.start();
                        break;
                }
        }
}
 

4
Hi

I am writing a DLL that uses smfl-audio. My IDE is Visual Studio Community 2017. I believe I have the IDE set up correctly:

- additional include directories point to the SFML\include directory
- additional library directories point to the SFML \lib directory
- Preprocessor definitions specify SFML_STATIC
- all 5x sfml .lib libraries are specified as additional dependencies together with each module's dependencies specified for static linking.

Everything compiles just fine.

When my DLL is called, I get a Windows error 126 - which means the DLL has a missing dependency.

I have placed the openal32.dll file from the \bin directory in each and all of:
- the directory where the DLL resides
- the directory where the .exe that calls the DLL resides
- c:\System32
- c:\SysWOW64

and none of this makes a difference.

I have tried linking to the static versions of the .libs (-s suffix) which results in a LNK2038 mismatch detected for RuntimeLibrary: value MD_DynamicRelease doesn't match value MT_Static Release from the sfml-audio-s.lib file during compilation. This is confusing!

(I have successfully compiled and run using dynamic linking and including sfml-audio-2.dll and sfml-system-2.dll in my dll's directory and removing the preprocessor SFML_STATIC definition, but I am eager to successfully create static linking and only distribute openal32.dll with my dll file).

Any pointers will be gratefully received!

Thx BD.

5
Audio / Eliminating Opena32.dll for simple use case
« on: August 31, 2018, 08:05:46 pm »
Hi

I plan to use SMFL for a windows application where the only required functionality is selecting from multiple audio input devices to record a wav file. In this scenario is there any possibility and method to use SMFL without requiring the opena32.dll file?

Thanks

bd

Pages: [1]