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

Pages: [1]
1
Audio / Re: Does my recording pause when calling onProcessSamples?
« on: November 30, 2016, 01:02:24 pm »
Precession isn't that important, but the time between every onProcessSamples call needs to be the same for both mac and windows. And im not sure if the sampleCount i reliable.

If the sample count is "actually caught samples", when the processingInterval is not 1 ms, but instead the 31 ms for Windows. So i need to find out if i set the sample rate, and get the sample count, is the processingInterval reliable?

Eks:
4096 sample rate - i get 150 sample count - then the processing interval is actually 150 / 4096 = 0.036 s = 36 ms

Hope that makes sense :)

2
Audio / Re: Does my recording pause when calling onProcessSamples?
« on: November 29, 2016, 07:02:05 pm »
The problem with the sample count changing only occurs when sampling with a higher processing interval then the one specified above (11 ms for mac, and 31 for windows).

If the processing interval depends on the OS or the CPU power available, maybe there is some way to specify the needed sample count, instead of the processing interval in milliseconds?

3
Audio / Re: Does my recording pause when calling onProcessSamples?
« on: November 29, 2016, 05:26:35 pm »
I have tried it now on different computers, and the problem seems to wary from OS to OS.

On windows the lowest number of samples (with a sampling rate of 4096) is 128 samples, with a processing interval of 1 ms. On MacOS the lowest number of samples (with a sampling rate of 4096) is 47 samples, with a processing interval of 1 ms.

Does it mean the the OnProccesingSamples isn't called every 1 ms, but instead every:

128/4096 = 31 ms for windows
47/4096 = 11 ms for mac

Im just trying to understand what is causing this problem (Processor, architecture, etc.), and find the lowest processing interval as possible, for my program to run on both Windows and Mac.

Im new to both programming and SFML, so im having some trouble understanding this.  :)

4
Audio / Re: Does my recording pause when calling onProcessSamples?
« on: November 29, 2016, 01:17:02 pm »
This is a simple program. Im running on a macOS. Don't know if it has something to do with the OpenAL for mac.

I have just tested the program on windows, and it seem to be more stable.

5
Audio / Re: Does my recording pause when calling onProcessSamples?
« on: November 29, 2016, 01:15:04 pm »
#include "SFML/Audio.hpp"
#include <iostream>

using namespace std;





class CustomRecorder : public sf::SoundRecorder {

public:
    CustomRecorder();

    bool onStart();

    bool onProcessSamples(const sf::Int16 *samples, std::size_t sampleCount);

    void onStop();

    ~CustomRecorder();
};

CustomRecorder::CustomRecorder()
{
}

bool CustomRecorder::onStart() {

    setProcessingInterval(sf::milliseconds(10));
    return true;

}

bool CustomRecorder::onProcessSamples(const sf::Int16 *samples, std::size_t sampleCount) {

    cout << sampleCount << endl;
    return true;
}

void CustomRecorder::onStop() {

}

CustomRecorder::~CustomRecorder()
{
    stop();
}


int main() {

    CustomRecorder recorder;
    recorder.start(4048);

    while(1){

    }

    recorder.stop();

    return 0;
}

6
Audio / Re: Does my recording pause when calling onProcessSamples?
« on: November 29, 2016, 12:37:03 pm »
Sorry for the late reply. This is my CustomRecorder.cpp

#include "CustomRecorder.h"

CustomRecorder::CustomRecorder()
{
}

bool CustomRecorder::onStart() {

    setProcessingInterval(sf::milliseconds(10));
    return true;

}

bool CustomRecorder::onProcessSamples(const sf::Int16 *samples, std::size_t sampleCount) {

    cout << sampleCount << endl;
    return true;
}

void CustomRecorder::onStop() {

}

CustomRecorder::~CustomRecorder()
{
    stop();
}
 
The samplesRate is 4048 in this examples, and this i my samples count for at curtain area of time:

47
47
47
47
47
47
47
47
47
47
47
94
94
47
47
47
47
47
47
47
47

7
Audio / Re: Does my recording pause when calling onProcessSamples?
« on: November 17, 2016, 08:41:39 pm »
And is there some way to make the sample count more stable on the OnProcessSamples? There seems to be some spikes, when sampling at a curtain rate.

The samplerate i stable most of the time, but after 5-6 OnProcessSamples call, the sample count spikes to about double of the expected samples count.  :)

8
Audio / Re: Does my recording pause when calling onProcessSamples?
« on: November 17, 2016, 01:49:04 pm »
That was what i thought, but i just wanted to be sure.

Thanks for the reply.

9
Audio / Does my recording pause when calling onProcessSamples?
« on: November 16, 2016, 11:16:31 am »
Hello World

I have a question about the onProcessSamples function in the Recorder Class. I im trying to process data real time, but im having trouble finding out if the capturing of data is paused then running onProcessSamples.

It says that returning true at the end will continue the capture, but i can't figure out if that means start capturing again.

Best Regards
Alexander

Pages: [1]
anything