hey mario-
i have a couple feature requests for psychportaudio:
1) allow 'start' to take a non-integer number of repetitions
reason: i preload my buffers before my realtime screen loop to avoid
framedrops. within the loop, i need to be able to play sounds whose
durations are not determined until just before they start. i want to
avoid the framedrops that might result from having to create a new
buffer of the proper length. the sound duration may outlast the
realtime loop, so i can't just loop the sound, keep track of the
elapsed time, and stop it myself (which would unnecessarily clutter
the code anyway).
2) allow sequential calls to 'start' with no intervening 'stop', with
each call resetting the 'repetitions' parameter (ie, start over from
the beginning as if there were a 'stop' immediately followed by a
'start' with a new 'repetitions' parameter.)
reason: convenience. currently, one must call stop even if a finite
sound has completed, and keep track of the sound status manually, to
determine whether a 'stop' is necessary. plus, requiring a manual
'stop' eliminates the possibility of deciding to lengthen a sound once
it has started without an undesired gap.
3) automatically 'stop' a finite sound that has completed, including
unsetting status.Active (currently it remains set until 'stop' is
called manually).
let me know if these sound reasonable, and thanks again for the
excellent ptb!
-erik
i have a couple feature requests for psychportaudio:
1) allow 'start' to take a non-integer number of repetitions
reason: i preload my buffers before my realtime screen loop to avoid
framedrops. within the loop, i need to be able to play sounds whose
durations are not determined until just before they start. i want to
avoid the framedrops that might result from having to create a new
buffer of the proper length. the sound duration may outlast the
realtime loop, so i can't just loop the sound, keep track of the
elapsed time, and stop it myself (which would unnecessarily clutter
the code anyway).
2) allow sequential calls to 'start' with no intervening 'stop', with
each call resetting the 'repetitions' parameter (ie, start over from
the beginning as if there were a 'stop' immediately followed by a
'start' with a new 'repetitions' parameter.)
reason: convenience. currently, one must call stop even if a finite
sound has completed, and keep track of the sound status manually, to
determine whether a 'stop' is necessary. plus, requiring a manual
'stop' eliminates the possibility of deciding to lengthen a sound once
it has started without an undesired gap.
3) automatically 'stop' a finite sound that has completed, including
unsetting status.Active (currently it remains set until 'stop' is
called manually).
let me know if these sound reasonable, and thanks again for the
excellent ptb!
-erik