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 - AndyOrange

Pages: [1]
1
Feature requests / Support floating point wav files
« on: November 02, 2017, 10:21:26 am »
For projects where users can include files of their choice, floating point wav should definitely be supported. This is basically the default for apps such as Audacity, other apps (Nero) don't even offer integer wav file format as output. And instructing customers to convert is not an option imho.

Cheers,
Andy

2
To me this sounds more like a workaround for a problem that should be solved elsewhere.

Completely agreed, but for the time being even vendors build their drivers such that plugging in and out headphones changes the sound device's state (mentioning realtek onboard sound here). Concerning this:

"Restarting" OpenAL is possible, but just as with OpenGL, the user will need to recreate all SFML audio resources in order for the context and device to be recreated.

I would be thankful for a link or for mentioning resources within sfml where this happens, so that one can "copy" that. This at least allows a reset when we know things have been dis-/enabled.

Thanks in advance,
Andy

3
I absolutely support this feature request: One needs to be able to "restart" the device without closing the app...

4
Audio / Re: Test sound device
« on: August 16, 2017, 10:00:02 am »
Yes, I did that. Creative on one system, Realtek on the other. Vendor. See attached image for an example when things are unplugged, this is really normal behaviour, the state of a sound device is different when having no output device attached!

Be things as they are, a check for audio device readyness would really help. I will do it by eluding sfml now and accessing openal directly -- this is, however, by far not the prefered option.

Best regards,
Andy

5
Audio / Re: Test sound device
« on: August 16, 2017, 09:01:03 am »
It is like this with basically all sound card/ on board sound with connectors currently. I don't like it either, but this is the way it is and it is quite normal, actually. Plug headphones out, sound device gets deactivated...

6
Audio / Re: Test sound device
« on: August 16, 2017, 08:42:43 am »
I will try your updated library. The problem is not just related to one machine. As soon as no audio device is available, which on windows happens if for instance you disconnect all chinch cables from output channels of your sound card/onboard device, openAL dumps those messages. It would help a lot, really, to be able to just test the audio device before accessing it.

Using openal directly, something like
device = alcOpenDevice(NULL);
if (!device)
        ...
might work, and sfml could offer such a test for instance...

7
Audio / Re: Test sound device
« on: August 16, 2017, 08:09:29 am »
Greetings,
first of all I absolutely agree with your proposal of chosing a playback device in the same manner as the recording device!

Now for the problems: I get masses of internal errors, as my CI machines have no headphones plugged in. See below. I really would need some way to check for validity of the main audio device at least initially...

Those errors spam my log:

MMDevApiOpenPlayback: Device init failed: 0x80070490
Failed to open the audio device
(and another lots of hundreds when trying to access the device)

and lots of those:

 Failed to open the audio device
[07:34:46][Step 2/6] An internal OpenAL call failed in SoundSource.cpp(37).
[07:34:46][Step 2/6] Expression:
[07:34:46][Step 2/6]    alGenSources(1, &m_source)
[07:34:46][Step 2/6] Error description:
[07:34:46][Step 2/6]    AL_INVALID_OPERATION
[07:34:46][Step 2/6]    The specified operation is not allowed in the current state.
[07:34:46][Step 2/6]
[07:34:46][Step 2/6] An internal OpenAL call failed in SoundSource.cpp(38).
[07:34:46][Step 2/6] Expression:
[07:34:46][Step 2/6]    alSourcei(m_source, AL_BUFFER, 0)
[07:34:46][Step 2/6] Error description:
[07:34:46][Step 2/6]    AL_INVALID_OPERATION
[07:34:46][Step 2/6]    The specified operation is not allowed in the current state.
[07:34:46][Step 2/6]
[07:34:46][Step 2/6] An internal OpenAL call failed in SoundBuffer.cpp(46).
[07:34:46][Step 2/6] Expression:
[07:34:46][Step 2/6]    alGenBuffers(1, &m_buffer)
[07:34:46][Step 2/6] Error description:
[07:34:46][Step 2/6]    AL_INVALID_OPERATION
[07:34:46][Step 2/6]    The specified operation is not allowed in the current state.
[07:34:46][Step 2/6]
[07:34:46][Step 2/6] An internal OpenAL call failed in SoundSource.cpp(103).
[07:34:46][Step 2/6] Expression:
[07:34:46][Step 2/6]    alSourcef(m_source, AL_REFERENCE_DISTANCE, distance)
[07:34:46][Step 2/6] Error description:
[07:34:46][Step 2/6]    AL_INVALID_OPERATION
[07:34:46][Step 2/6]    The specified operation is not allowed in the current state.
:
:
:
(and another 400 of those)

8
Audio / Test sound device
« on: August 15, 2017, 12:54:28 pm »
Greetings,
I really hope this is not some kind of duplicate, but I could not find a similar question. How can I test for validity of a sound device both initially and during playback of a file (in my case Windows)? I other words, consider, when no headphones or speakers are connected I am getting tons of openAL error message logs, and if I unplug them during playback, things even crash. I would prefer an sfml only sfml way without having to fal back to openal.
Looking forward to hearing from you,
Andy

9
Marvellous, thanks a lot!

10
Can you hint at a place in sourcCode where I can debug into some reader and it's read() metohd for instance when opening a wav file? Might help to compare debugging to a working implementation with sf::Sound...

Thanks,
Andy

11
I am basically using this code and unlegacying it a little:

https://github.com/hansiC/sfml-soundfileReader-example

Most important changes concern the swap sf::music for sf::Sound as follows in the main routine:


        std::shared_ptr<sf::Sound> m_soundSource = std::make_shared<sf::Sound>();
        std::shared_ptr<sf::SoundBuffer> m_soundBuffer = std::make_shared<sf::SoundBuffer>();

        if (!m_soundBuffer->loadFromFile(filename)) {
                ...
        }
        m_soundSource->setBuffer(*m_soundBuffer);
        m_soundSource->setVolume(0.8f);

 


and later in the loop:

togglePlayPause(*m_soundSource);
 

Best regards and thanks  alot for your assistance!
Andy

12
Greetings and thanks for your reply. If I understand things correctly, the read function is called periodically. hence, when intending to work with sf::Sound and intending to read the whole file into memory, I first have to read the complete file in the open method, I guess. When I use sf::music, read gets called and delivers sound snippets as expected. When I use sf:Sound, it gets called exactly once and maxCount is just far to small to reference the whole file. However, I have no access to the caller of read and to for instance set maxCount to the complete size of the file I read...

I think about posting some snippet...

atb,

Andy

13
Greetings all,

due to real time demans in a current project I need to read an mp3-file (now that the license is free) into a buffer from where to play it, intending to use sf::Sound and sf::SoundBuffer. However, the callback of sfml which calls the "read" methode seems to only work with sf::Music and thus only offers reading from files while playing (worse, it seems to automatically stop playing when macCount bytes are read...). That is a no go in my case -- any idea how to combine a custom player/reader/opener with sf::Sound and sf::SoundBuffer such that I can preallocate the buffer (unique_ptr for instance) and play from memory?

Thanks a lot for help,
Andy

P.S.: I tried using sf::Sound::loadFromFile and sf::Music::openFromFile, only the latter worked.


Pages: [1]