Skip to content

Conversation

@vfjpl
Copy link
Contributor

@vfjpl vfjpl commented Nov 24, 2018

Thanks a lot for making a contribution to SFML! 🙂

Before you create the pull request, we ask you to check the follow boxes. (For small changes not everything needs to ticked, but the more the better!)

  • Has this change been discussed on the forum or in an issue before?
  • Does the code follow the SFML Code Style Guide?
  • Have you provided some example/test code for your changes?
  • If you have additional steps which need to be performed list them as tasks!

Description

This patch bring similar functionality that is available in SoundRecorder. It is useful to be able to change it when you have your own waiting/blocking calls in onGetData function. That way sleep in SoundRecorder don't get in your way. After this patch default behaviour is the same.

Tasks

  • Tested on Linux
  • Tested on Windows
  • Tested on macOS
  • Tested on iOS
  • Tested on Android

How to test this PR?

Describe how to best test these changes. Please provide a minimal, complete and verifiable example if possible, you can use the follow template as a start:

#include <SFML/Audio/SoundStream.hpp>
class FastSoundStreamt: public sf::SoundStream
{
    FastSoundStream()
    {
         sf::SoundRecorder::setProcessingInterval(sf::Time::Zero);
    }
    void onSeek(sf::Time timeOffset) {}
    bool onGetData(sf::SoundStream::Chunk& data)
    {
        //custom blocking calls for samples
    }
};
/// \brief Set the processing interval
///
/// The processing interval controls the period
/// between calls to the fillAndPushBuffer function. You may
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should rather talk about getData, fillAndPushBuffer means nothing for the user.

@vfjpl vfjpl closed this Nov 25, 2018
@eXpl0it3r
Copy link
Member

Did you intentionally close this PR?

@vfjpl
Copy link
Contributor Author

vfjpl commented Nov 26, 2018

Yes, to think about it more when I will have more time. Do you have any suggestions about this PR? :)

eXpl0it3r pushed a commit that referenced this pull request Jun 18, 2020
Resurrection of previous PR with updated documentation. Added setter to
adjust processing interval in SoundStream for low-latency streams.
@eXpl0it3r eXpl0it3r added this to the 2.6 milestone Jun 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment