audio: don't specify framesPerBuffer.

from "Pa_OpenStream" documentation:

 @param framesPerBuffer The number of frames passed to the stream callback
 function, or the preferred block granularity for a blocking read/write stream.
 The special value paFramesPerBufferUnspecified (0) may be used to request that
 the stream callback will receive an optimal (and possibly varying) number of
 frames based on host requirements and the requested latency settings.
 Note: With some host APIs, the use of non-zero framesPerBuffer for a callback
 stream may introduce an additional layer of buffering which could introduce
 additional latency. PortAudio guarantees that the additional latency
 will be kept to the theoretical minimum however, it is strongly recommended
 that a non-zero framesPerBuffer value only be used when your algorithm
 requires a fixed number of frames per stream callback.
This commit is contained in:
Roman Zeyde
2015-02-02 20:53:37 +02:00
parent 221c7c03b9
commit 5b6d1881ab

View File

@@ -92,7 +92,7 @@ class Stream(object):
ctypes.byref(self.params) if read else None,
ctypes.byref(self.params) if write else None,
ctypes.c_double(config.Fs),
ctypes.c_ulong(config.samples_per_buffer),
ctypes.c_ulong(0), # (paFramesPerBufferUnspecified)
ctypes.c_ulong(0), # no flags (paNoFlag)
self.stream_callback,
self.user_data)