Paul,
Thanks for digging into this. My efforts on PEBL now are focused on
moving to the SDL 2.0 library, which has addressed some of the audio
problems in 1.2, but I'll try to see if I can replicate this and test
whether it is fixed. If you could, please send me off-list the specific
audio file you were using that had the problem.
Shane
On Wed, 2015-11-11 at 17:44 +0000, Wright, Paul wrote:
> Aaaaand … I spoke to soon. Adding a brief clip of silence (100 ms)
> solved the problem. Or at least, worked around it. No need to load the
> sound file each time. I did stick with PlayForeground though.
>
>
> if(result==1)
> {
> targetCoord <- Nth(gBoxCoord,target)
> Move(gCorrectImage,First(targetCoord),Second(targetCoord))
> Show(gCorrectImage)
> Draw()
> PlayForeground(gCorrectSound)
> # Wait(500)
> PlayBackground(gSilenceSound)
> Hide(gCorrectImage)
> Draw()
> }
>
>
>
>
>
>
>
> From: Paul Wright <[email protected]>
> Date: Wednesday, 11 November 2015 17:18
> To: "[email protected]" <[email protected]>
> Cc: "[email protected]"
> <[email protected]>
> Subject: Re: [Pebl-list] Audio carry-over
>
>
>
> Dear Shane
>
>
> It’s been a while since I raised this issue, but have finally found
> time to test out the options.
>
>
> Initially, the code used PlayBackground then Wait(500), the duration
> of the sound. I changed it so it uses PlayForeground, keeping the wait
> there just for good measure, and got the same carryover. I then added
> a line to load the sound file at the beginning, but had the same
> problem again.
>
>
> Here’s a snippet:
>
>
> if(result==1)
> {
> targetCoord <- Nth(gBoxCoord,target)
> Move(gCorrectImage,First(targetCoord),Second(targetCoord))
> Show(gCorrectImage)
> gCorrectSound <- LoadSound(gCorrectSoundFile)
> Draw()
> PlayForeground(gCorrectSound)
> Wait(500)
> Hide(gCorrectImage)
> Draw()
> }
>
>
> Do you have any suggestions? I may try playing 500 ms of silence to
> clear the buffer.
>
>
> Cheers
> Paul
>
>
>
>
>
>
> On 28/07/2015 22:26, "Shane Mueller" <[email protected]> wrote:
>
>
> Paul,
>
>
> Whatever is happening is deep within the sound mixer. The
> sound
> information gets written to a buffer that gets sent via a
> background
> process to the sound card, but the particular code you are
> using must
> leave some of it in this buffer. Are you issuing a Stop()
> command maybe,
> or waiting only a fixed period of time before continuing that
> is shorter
> than the length of the audio? Does it happen if you use
> PlayForeground?
> If that doesn't work, you might try re-loading the sound file
> on each
> instance--the overhead is pretty low. If you can't figure it
> out, send me
> a code snippet and I'll see if I can figure something out.
>
>
> Shane
>
>
>
>
> Hi
> I have a task that has a "correct" sound and an
> "incorrect" sound. I find
> there some carry-over between trials. It's noticeable
> when the subject
> gets one incorrect then gets the next one correct.
> There's a tiny bit of
> incorrect sound at the beginning of the correct sound.
> Is there a way of
> clearing the buffer between trials? I'm using
> PlayBackground.
> Thanks
>
>
>
>
> Paul Wright, PhD
> King's College London
> Institute of Psychiatry, Psychology & Neuroscience
> (IoPPN)
> Department of Basic and Clinical Neurosciences
> http://kclpure.kcl.ac.uk/portal/p.wright.html
>
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Pebl-list mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pebl-list
>
>
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Pebl-list mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pebl-list
------------------------------------------------------------------------------
_______________________________________________
Pebl-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pebl-list