import sys
from psychopy import logging, prefs
logging.console.setLevel(logging.DEBUG)#get messages about the sound lib as it loads
from psychopy import sound,core, visual
if prefs.general['audioLib'][0] == 'pyo':
#if pyo is the first lib in the list of preferred libs then we could use small buffer
#pygame sound is very bad with a small buffer though
sound.init(48000,buffer=128)
print 'Using %s(with %s) for sounds' %(sound.audioLib, sound.audioDriver)
highA = sound.Sound(523, sampleRate=44100, secs=0.8, bits=8)
highA.setVolume(0.5)
highA.play()
core.wait(2)
highA.play().fadeOut(800) #a lot of crackling here as well, maybe we are not using the fadeOut() function correctly?
core.wait(2)
print 'done'
core.quit()##### Running: C:\Users\Benjamin\workspace\CillephD\nyt_script\soundStimuli2.py #####
Using pygame(with None) for sounds
done
0.6719 ERROR avbin.dll failed to load. Try importing psychopy.visual as the first
library (before anything that uses scipy) and make sure that avbin is installed.
0.9309 EXP Set sound=523.0
0.9309 EXP Set Sound volume=0.500
0.9309 EXP Sound started
2.9310 EXP Sound started--
You received this message because you are subscribed to the Google Groups "psychopy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psychopy-user...@googlegroups.com.
To post to this group, send email to psychop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/e61a784b-7361-4463-b7f3-72337ef37207%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
-- Jonathan Peirce Nottingham Visual Neuroscience http://www.peirce.org.uk
This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.
This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system, you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.
from psychopy import core, sound
octaves = [3, 6]
notes = ['A','B']
sampleRates = [22050, 44100]
bits = [4, 16]
buffers = [64, 1024]
for buffer in buffers:
for sampleRate in sampleRates:
sound.init(sampleRate, buffer)
for bit in bits:
for octave in octaves:
for note in notes:
stim = sound.Sound(value=note, octave=octave, bits=bit, secs=0.2)
stim.play()
print 'playing params:', buffer, sampleRate, bit
core.wait(0.4)
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/5602516e-b28e-4e0e-b6ed-c179e4647d85%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/51BEDE79.8050109%40nottingham.ac.uk.
Benjamin Christensen--
--
You received this message because you are subscribed to a topic in the Google Groups "psychopy-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/psychopy-users/zn6Gqp1ehvM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to psychopy-user...@googlegroups.com.
To post to this group, send email to psychop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/b2d433ab-972e-435c-8088-dfb2898bf972%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/CAGBir42sO7qEn%2BRtkKpAnGVENqaW6mvEb%2B5666KD4MCjHVtD_g%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/CANqwJFgJizVC0KmHwDz8WorEdGod_EDm9Pv4e3hKkKtZYCeXhA%40mail.gmail.com.
Many thanks Jeremy. My stimuli are all WAV files, and so I guess PsychoPy would not hamming-window them.
Each stimulus has a smoothfade-in&-out built into the waveform itself, so the on/offset crackling is most likely just due to that master audio channel (or whatever it's called) getting switched on and off, and it probably makes no sense to add additional windowing to the WAVs. I understand there's nothing to do at the moment to prevent that?
And same for the general crackling superimposed upon playback?
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/CAGBir41JFdS-AANHJrd84_E%3DDuMWBtsPiChP_i2zipmWxc8keQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/CANqwJFiz39_cMG89UM%3DRFE3jQBahaYkTX2k4NmPSBfQET%3D_BdQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/CAGBir43aZmJTuOrEaLh2cz1K0qMXmCVcqwiGTkRxvhumFykrpA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/CANqwJFhETKcZPyFAcw2H2dU2%3DKJ0rvrfmVZ_-uvaRstUmfUe1g%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/CAGBir42e36ab2vG5uYx4%2BA-8X0u59Jfo1ixE9OsLBFi_5kR4aA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/CANqwJFgUbgX7itd6AWVZgyn5qEuE0OrZi7dDYrazyx-Q2%2Bea8A%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/CAGBir43CsEE-Xd_JCOsAqxjJ1PXcLtAPxkTSahDQSW7_T-9XQA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/CANqwJFiMNjn%2B_xjm6DX61DsKHvNA5cx4T%3DrdBTS29r6Uh5k-DA%40mail.gmail.com.