Hi,<br><br>I think David described the most straightforward method to do this, so you should try that first. I know there is also an alternative method, which I used a few years ago. I don't remember if I had to work around any problems with the built-in sound objects, but here is what I did:<br>
<br>I inserted the following script in the global user script section. The inserted script uses low-level windows functions to play an audio file.<br><br><br><font size="1"><span style="font-family:courier new,monospace">' Sound suppport by using the windows multimedia library directly (i.e. bypassing EPrime)<br>
Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long<br>Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long<br>
<br>' Some constants for playing sounds<br>Const SND_LOOP = &H8 ' loop the sound until next sndPlaySound<br>Const SND_ASYNC = &H1 ' play asynchronously<br>Const SND_NOSTOP = &H10 ' don't stop any currently playing sound<br>
Const SND_SYNC = &H0 ' play synchronously (default)<br>Const SND_NODEFAULT = &H2 ' silence not default, if sound not found<br>Const SND_PURGE = &H40 ' purge non-static events for task<br>
<br>' Remarks<br>' If the specified sound cannot be found, sndPlaySound plays the system default sound.<br>' If there is no system default entry in the registry or WIN.INI file, or if the<br>' default sound cannot be found, the function makes no sound and returns FALSE.<br>
'<br>' The specified sound must fit in available physical memory and be playable<br>' by an installed waveform-audio device driver. If sndPlaySound does not find<br>' the sound in the current directory, the function searches for it using the<br>
' standard directory-search order.<br><br>' Plays a sound from filename ans optionally wait until ready.<br>Function PlaySoundFile(ByVal filename As String, bWaitReady as boolean) as Boolean<br> PlaySoundFile = sndPlaySound(filename, iif(bWaitReady, SND_SYNC, SND_ASYNC) )<br>
End Function<br><br>' Plays a repeating sound from filename.<br>Function RepeatSoundFile(ByVal filename As String) as Boolean<br> RepeatSoundFile = sndPlaySound(filename, (SND_LOOP Or SND_ASYNC) )<br>End Function<br>
<br>Sub StopSoundFile()<br> dim ret as boolean<br> ret = sndPlaySound(ebNullString, SND_SYNC)<br>End Sub<br></span></font><br>Then call one of the the Play functions somewhere in your script to start playing the music:<br>
<br><font size="1"><span style="font-family:courier new,monospace">if (Not PlaySoundFile("media\\classic.wav", false)) then<br> MsgBox "Cannot play sound"<br>end if</span></font><br><br>And simply call StopSoundFile to stop at any point. Note that this was used on a windows XP machine, so I'm not sure if it works on the latest Windows releases.<br>
<br>Best<br>Paul<br><br><br><br><div class="gmail_quote">On 10 December 2012 20:42, Nicolette <span dir="ltr"><<a href="mailto:nicolettenoonan@gmail.com" target="_blank">nicolettenoonan@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Hi,</div><div> </div><div>I am *very* new to EPrime, so I am looking for some guidance and have been unable to find an answer to my question in any tutorial I have come across.</div>
<div> </div><div>I am running an n-back task in EPrime 2.0 (no problems making that), but I would also like auditory stimuli to play "overhead" of the ongoing task. I have been unable to figure out how to do this. So, a 7-min audio file I want running continuously while my participant is engaged in doing the n-back. Almost like I don't want my "sound" to know what my "image" is doing.</div>
<div> </div><div>If anyone could offer me some guidance (and not make it <i>too</i> technical!), I'd really appreciate it.</div><div> </div><div>Thanks</div><span class="HOEnZb"><font color="#888888">
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups "E-Prime" group.<br>
To post to this group, send email to <a href="mailto:e-prime@googlegroups.com" target="_blank">e-prime@googlegroups.com</a>.<br>
To unsubscribe from this group, send email to <a href="mailto:e-prime%2Bunsubscribe@googlegroups.com" target="_blank">e-prime+unsubscribe@googlegroups.com</a>.<br>
To view this discussion on the web visit <a href="https://groups.google.com/d/msg/e-prime/-/GRyKaY8V3oIJ" target="_blank">https://groups.google.com/d/msg/e-prime/-/GRyKaY8V3oIJ</a>.<br>
For more options, visit <a href="https://groups.google.com/groups/opt_out" target="_blank">https://groups.google.com/groups/opt_out</a>.<br>
<br>
<br>
</font></span></blockquote></div><br>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups "E-Prime" group.<br />
To post to this group, send email to e-prime@googlegroups.com.<br />
To unsubscribe from this group, send email to e-prime+unsubscribe@googlegroups.com.<br />
For more options, visit <a href="https://groups.google.com/groups/opt_out">https://groups.google.com/groups/opt_out</a>.<br />
<br />
<br />