You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
filename = '../data/20150312094043_voice_ID1000_S001_T001_R001_pataka'
microphone.switchOn()
core.wait(3)
mic.microphone.AdvAudioCapture(name='mic', stereo = False)
mic.record(sec=20, block=False, filename = filename + '.wav')
Using this line to specify file name results in 20150312094043_voice_ID1000_S001_T001_R001_patak.wav instead of 20150312094043_voice_ID1000_S001_T001_R001_pataka.wav
Note the dropped 'a' at the end of pataka
However, by adding an intermediate character in the concatenation, all characters are used.
This is a bug, will fix. The issue is not the length of the filename, but the fact that it ends with an 'a'. The bug is that if a filename is given to .record(), any trailing '.wav' is supposed to be removed, but that is done incorrectly and removes any of the characters w, a, v, or .
Possible work arounds:
end your filenames with another character, e.g., x:
mic.record(sec=20, block=False, filename = filename + 'x.wav')
It does not have to be 'x'. This will give you filenames like
20150312094043_voice_ID1000_S001_T001_R001_patakax.wav
Set the filename prior to calling .record()
mic.wavOutFilename = filename + '.wav'
mic.record(sec=20, block=False)
This will give you file names with extra stufff (a timestamp, in unix epoch time), like
20150312094043_voice_ID1000_S001_T001_R001_pataka-1426173235.230.wav
Hi,
filename = '../data/20150312094043_voice_ID1000_S001_T001_R001_pataka'
microphone.switchOn()
core.wait(3)
mic.microphone.AdvAudioCapture(name='mic', stereo = False)
mic.record(sec=20, block=False, filename = filename + '.wav')
Using this line to specify file name results in 20150312094043_voice_ID1000_S001_T001_R001_patak.wav instead of 20150312094043_voice_ID1000_S001_T001_R001_pataka.wav
Note the dropped 'a' at the end of pataka
However, by adding an intermediate character in the concatenation, all characters are used.
mic.record(sec=20, block=False, filename = filename + '123456' + '.wav')
20150312094043_voice_ID1000_S001_T001_R001_pataka123456.wav
This could be my misunderstanding of how python concatenate works somehow.
This error does not happen with a shorter filename e.g. filename = '../data/mySubject1234' writes out as mySubject1234.wav
Using Psychop v1.81.03 on mac 10.8.2
Thanks.
The text was updated successfully, but these errors were encountered: