kopia lustrzana https://gitlab.com/eliggett/wfview
Tell rtaudio not to hog device
rodzic
69a34f1c00
commit
462551838d
|
@ -123,10 +123,12 @@ bool audioHandler::init(const quint8 bits, const quint8 radioChan, const quint16
|
|||
|
||||
int resample_error = 0;
|
||||
|
||||
options.flags = !RTAUDIO_HOG_DEVICE | RTAUDIO_MINIMIZE_LATENCY;
|
||||
|
||||
if (isInput) {
|
||||
resampler = wf_resampler_init(devChannels, this->nativeSampleRate, samplerate, resampleQuality, &resample_error);
|
||||
try {
|
||||
audio.openStream(NULL, &aParams, RTAUDIO_SINT16, this->nativeSampleRate, &this->chunkSize, &staticWrite, this);
|
||||
audio.openStream(NULL, &aParams, RTAUDIO_SINT16, this->nativeSampleRate, &this->chunkSize, &staticWrite, this, &options);
|
||||
audio.startStream();
|
||||
}
|
||||
catch (RtAudioError& e) {
|
||||
|
@ -138,7 +140,7 @@ bool audioHandler::init(const quint8 bits, const quint8 radioChan, const quint16
|
|||
{
|
||||
resampler = wf_resampler_init(devChannels, samplerate, this->nativeSampleRate, resampleQuality, &resample_error);
|
||||
try {
|
||||
audio.openStream(&aParams, NULL, RTAUDIO_SINT16, this->nativeSampleRate, &this->chunkSize, &staticRead, this);
|
||||
audio.openStream(&aParams, NULL, RTAUDIO_SINT16, this->nativeSampleRate, &this->chunkSize, &staticRead, this, &options);
|
||||
audio.startStream();
|
||||
}
|
||||
catch (RtAudioError& e) {
|
||||
|
|
|
@ -82,6 +82,7 @@ private:
|
|||
RtAudio audio;
|
||||
int audioDevice = 0;
|
||||
RtAudio::StreamParameters aParams;
|
||||
RtAudio::StreamOptions options;
|
||||
RtAudio::DeviceInfo info;
|
||||
|
||||
SpeexResamplerState* resampler = Q_NULLPTR;
|
||||
|
|
Ładowanie…
Reference in New Issue