This article applies to:
E-Prime 3.0
Symptoms
The SoundBuffer.Status property does not return the correct value when the SoundBuffer's playback has been paused and then resumed.
Detail
The SoundBuffer.Status property reflects the current status of the specified SoundBuffer and returns one of the following values: 0 (not playing), 1 (playing), or 2 (paused). However, after pausing and resuming playback, the SoundBuffer.Status incorrectly returns 1 instead of 0 when playback reaches the end of the sound file for some time period after the SoundBuffer's playback has completed. Therefore, the SoundBuffer.Status property cannot be used to determine when the playback has completed if the playback had been previously paused.
When sound buffers are played using a loop in E-Basic script, SoundBuffer.Status is often used to define the exit condition of the playback loop. For example, to keep the experiment from proceeding further until the contents of the sound buffer have been presented, a loop can be defined that executes until the SoundBuffer.Status no longer returns a value of 1. This approach will not work with E-Prime 3 due to the Status property bug. Defining the loop's exit condition based on the SoundBuffer.Status property results in the script remaining in the loop despite the sound file having completed its playback. The script remains stuck in the loop for as long as the Status property returns the incorrect value.
Workaround
E-Prime 3 users should identify the total sound file duration and the elapsed time before a pause is called in order to exit the loop once the sound file has played. More specifically:
- Determine the sound file's duration in milliseconds (e.g., 5000 ms) using a sound-editing utility outside of E-Prime.
- Immediately before pausing the playback with SoundBuffer.Pause, determine the elapsed playing time thus far (e.g., 1500 ms of the sound file has been played).
- Calculate the remaining time in the sound file by subtracting the elapsed playback time from Step 2 from the total sound file duration in Step 1 (e.g., 5000 ms - 1500 ms = 3500 ms).
- Define the loop's exit condition as the remaining playback time in Step 3 after resuming playback with SoundBuffer.Resume. (e.g., 3500 ms)
See Also:
RELEASE INFO: Known Issues in E-Prime 3.0 [27789]
BUG: CoreAudio sometimes jumps back in playback when using pause and continue [42818]
Comments
0 comments
Please sign in to leave a comment.