From 952720f173434ffc5ae0614a834fa5cce7c2a005 Mon Sep 17 00:00:00 2001 From: Gary Scavone Date: Fri, 27 Dec 2013 15:09:26 -0800 Subject: PulseAudio update for input buffer size support. --- RtAudio.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'RtAudio.cpp') diff --git a/RtAudio.cpp b/RtAudio.cpp index 7e04e98..baaf24e 100644 --- a/RtAudio.cpp +++ b/RtAudio.cpp @@ -6816,9 +6816,15 @@ bool RtApiPulse::probeDeviceOpen( unsigned int device, StreamMode mode, pah = static_cast( stream_.apiHandle ); int error; + std::string streamName = "RtAudio"; + if ( !options->streamName.empty() ) streamName = options->streamName; switch ( mode ) { case INPUT: - pah->s_rec = pa_simple_new( NULL, "RtAudio", PA_STREAM_RECORD, NULL, "Record", &ss, NULL, NULL, &error ); + pa_buffer_attr buffer_attr; + buffer_attr.fragsize = bufferBytes; + buffer_attr.maxlength = -1; + + pah->s_rec = pa_simple_new( NULL, streamName.c_str(), PA_STREAM_RECORD, NULL, "Record", &ss, NULL, &buffer_attr, &error ); if ( !pah->s_rec ) { errorText_ = "RtApiPulse::probeDeviceOpen: error connecting input to PulseAudio server."; goto error; -- cgit v1.2.3