I currently have something like this. Player is supposed to be something like pseudo winamp, and everything is staged this way now.
player = new QMediaPlayer; //creating QMediaPlayer instance
probe = new QAudioProbe;
probe->setSource(player);
connect(probe, SIGNAL(audioBufferProbed(QAudioBuffer)), this, SLOT(processBuffer(QAudioBuffer)));
player = new QMediaPlayer; //creating QMediaPlayer instance
probe = new QAudioProbe;
probe->setSource(player);
connect(probe, SIGNAL(audioBufferProbed(QAudioBuffer)), this, SLOT(processBuffer(QAudioBuffer)));
To copy to clipboard, switch view to plain text mode
From what I understand - when probe has it's internal buffer full it emits it as signal which I catch with adequate slot function, which would look like that:
void qtplayer::processBuffer(QAudioBuffer buffer)
{
// do something with data in buffer
// I want for example copy insides of this buffer to Vector of Ints, how can I do that?
}
void qtplayer::processBuffer(QAudioBuffer buffer)
{
// do something with data in buffer
// I want for example copy insides of this buffer to Vector of Ints, how can I do that?
}
To copy to clipboard, switch view to plain text mode
Am I right to this point? I assume that when I use QMediaPlayer, then it uses native system audio format (in my case 44100 Hz, 16 bit, 2 channel), so I assume that probe gets exaclty same format of audio. But what about buffer size? I want probe to get for example 44100 samples of audio, which would be 1 second, can I change that? How do I even know how big is it's internal buffer?
Bookmarks