Search code examples
python-2.7csvmachine-learningpyaudioanalysis

'line contains NULL byte' error while using pyAudioAnalysis


I'm trying to run a regression on some audio data using pyAudioAnalysis, going off of the instructions here. However, when I run aT.featureAndTrainRegression(args), I get Error: line contains NULL byte as it scans through my csv file.

I've done some digging online, and there's a lot of advice on how to delete or ignore null bytes from your csv, but I didn't have a lot of luck with those approaches; going through and deleting all the null bytes left me with a csv of pure gobbledygook that had no resemblance to the original, and I'm hesitant to try the other side: modifying the audioTrainTest code in pyAudioAnalysis. I mean, enough people use this that I can't believe everyone encounters the error, so there must be a way to solve it without tinkering with the guts of the library.

I'm running a mac with OS10.9, and using Python 2.7 on PyCharm. Any advice would be greatly appreciated. Thanks in advance!


Solution

  • Figured it out! Turns out the csv filetype I was using (the mac one) wasn't compatible with python, hence the errors. When I saved my csv as a Windows csv all the problems disappeared.