Pitch Design Issue
ovidiup13 opened this issue · 0 comments
The pitch design does not seem to work appropriately.
When the hand approaches the target speaker, the design switches quite rapidly between pitches. The sounds are loaded from local storage "on-the-go": when a sound with pitch X is required, the current playback is stopped, the file is loaded from the local storage and started.
Unfortunately, this is not a feasible option since the sounds are loaded many times during a trial and, at some points, switching between files produces a form of white noise due to the abrupt end in the middle of playback of the currently played file.
A solution to this would be to load all the files needed for the audio design when a new object is created. The streams will reside in the memory of the system without any additional loading and freeing of streams. Loading occurs at the creation of an object, with freeing at destruction. When the design has to switch to a different file, the current playback can be paused rather than stopped, and the next sound could be started easily.
Note that the stream handles must be initialized with the "repeat" BASS flag.