I have a Python script that is using Mac OS X's built in speech synthesis API to create aiff files of some processed text via PyObjC/AppKit. Everything is working fine, but I can't get the aiff files to concatenate together after creation. After searching for awhile, I discovered a call to a Bash script running SoX would be the best solution for me. I am currently not planning on deploying this, but rather this is an internal project, so I don't mind the dependency. SoX is working fine to concatenate what I need, but I am getting this error on some of the files (about .1%: there doesn't seem to be anything special about these files):
sox FAIL formats: can't open input file 'folder/subfolder/file.aif': missing SSND chunk in AIFF file
The weird thing is that these are files being created by the Objective C API in real time, theoretically they are all very similar, and yet only a small seemingly random portion are failing?
I looked at the source code for any clues, and it seems like the SSND chunk is at the end of the file, so I tried adding a wait to my python script in case the files just weren't done being created to no avail.