Skip to content

Commit

Permalink
Update for Pulse input to achieve better latency.
Browse files Browse the repository at this point in the history
  • Loading branch information
garyscavone committed Aug 23, 2023
1 parent 3b260be commit b6edd70
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion RtAudio.cpp
Expand Up @@ -9521,7 +9521,10 @@ bool RtApiPulse::probeDeviceOpen( unsigned int deviceId, StreamMode mode,
pa_buffer_attr buffer_attr;
case INPUT:
buffer_attr.fragsize = bufferBytes;
buffer_attr.maxlength = -1;
if ( options && options->numberOfBuffers > 0 )
buffer_attr.maxlength = bufferBytes * (options->numberOfBuffers + 1);
else
buffer_attr.maxlength = bufferBytes * 4;

pah->s_rec = pa_simple_new( NULL, streamName.c_str(), PA_STREAM_RECORD,
dev_input, "Record", &ss, NULL, &buffer_attr, &error );
Expand Down

0 comments on commit b6edd70

Please sign in to comment.