mirror of
https://github.com/romanz/amodem.git
synced 2026-03-06 23:05:57 +08:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user