2014-06-16 11 views
1

비슷한 오류 메시지를 확인했지만 내 상황에 맞는 것을 찾지 못했습니다. HTK, Prosodylab-aligner 및 SoX를 사용하여 .wab 파일을 .lab 파일과 시간을 맞추려고합니다.초기화 중 ... 'sox'명령이 0이 아닌 종료 상태 2를 반환했습니다.

./align.py /path/to/files 

모든 그 등장이 코드 라인 :

Command 'sox' returned non-zero exit status 2 

이 코드가 무엇을 의미하는지 고개를 분명히 그 의미 여기

은 (Prosodylab-정렬을 사용) 내 입력 명령이나 키워드가 누락되었습니다

나는이 문제가 align.py 파일에 있다고 생각하지만 정확히 어디 있는지 모르겠습니다. 다음은 SoX를 참조하는 파일 영역입니다. cmd 같은 변수로 pids.append(Popen(...)) 호출에서 sox 명령 라인 출력

def _check_aud(self, wav_list, train=False): 
    """ 
    Check audio files, mixing down to mono and downsampling if 
    necessary. Writes copy_scp and the training or testing SCP files 
    """ 
    copy_scp = open(self.copy_scp, 'a') 
    check_scp = open(self.train_scp if train else self.test_scp, 'w') 
    i = 0 
    if self.has_sox: 
     for wav in wav_list: 
      head = os.path.splitext(os.path.split(wav)[1])[0] 
      mfc = os.path.join(self.aud_dir, head + '.mfc') 
      w = wave.open(wav, 'r') 
      pids = [] # pids 
      if (w.getframerate() != self.sr) or (w.getnchannels() > 1): 
       new_wav = os.path.join(self.aud_dir, head + '.wav') 
       pids.append(Popen(['sox', '-G', wav, '-b', '16', 
            new_wav, 'remix', '-', 
            'rate', str(self.sr), 
            'dither', '-s'], stderr=PIPE)) 
       wav = new_wav 
      for pid in pids: # do a join 
       retcode = pid.wait() 
       if retcode != 0: 
        raise CalledProcessError(retcode, 'sox') 
      print >> copy_scp, '"{0}" "{1}"'.format(wav, mfc) 
      print >> check_scp, '"{0}"'.format(mfc) 
      w.close() 
    else: 
     for wav in wav_list: 
      head = os.path.splitext(wav)[0] 
      mfc = os.path.join(self.aud_dir, head + '.mfc') 
      w = wave.open(wav, 'r') 
      if (w.getframerate() != self.sr) or (w.getnchannels() != 1): 
       error('File {0} needs resampled but Sox not found ', w) 
      print >> copy_scp, '"{0}" "{1}"'.format(wav, mfc) 
      print >> check_scp, '"{0}"'.format(mfc) 
      w.close() 
    copy_scp.close() 
    check_scp.close() 

답변

0

요인 및 인쇄이 그것을 실행하기 전에.

그러면 문제를 재현 할 수있는 명령 줄이 생기고 더 자세한 오류 메시지가 표시되며 인수를 조정하여 문제를 좁힐 수 있습니다.

  # ... 
      new_wav = os.path.join(self.aud_dir, head + '.wav') 

      cmd = ['sox', '-G', wav, '-b', '16', 
        new_wav, 'remix', '-', 'rate', 
        str(self.sr), 'dither', '-s'] 
      print "About to execute command:\n%s" % ' '.join(cmd) 
      pids.append(Popen(cmd, stderr=PIPE)) 

      wav = new_wav 
      # ...