2017-09-24 8 views
1

나는 ASR 시스템을 수행하려고한다. 칼디 매뉴얼과 librispeech corpus를 사용하고 있습니다.칼디 (Kaldi) librispeech 데이터 준비 오류

6295-64301-0002 flac -c -d -s /home/tinin/kaldi/egs/librispeech/s5/LibriSpeech/dev-clean/6295/64301/6295-64301-0002.flac | 

: 은 데이터 준비 단계에서이 오류

utils/data/get_utt2dur.sh: segments file does not exist so getting durations 
from wave files 
utils/data/get_utt2dur.sh: could not get utterance lengths from sphere-file 
headers, using wav-to-duration 
utils/data/get_utt2dur.sh: line 99: wav-to-duration: command not found 

그리고 여기이 오류가 난 같은 라인을 가지고 wav.scp 파일에서

if cat $data/wav.scp | perl -e ' 
    while (<>) { s/\|\s*$/ |/; # make sure final | is preceded by space. 

     @A = split; 
     if (!($#A == 5 && $A[1] =~ m/sph2pipe$/ && 
          $A[2] eq "-f" && $A[3] eq "wav" && $A[5] eq "|")) { exit (1); } 

     $utt = $A[0]; $sphere_file = $A[4]; 
     if (!open(F, "<$sphere_file")) { die "Error opening sphere file $sphere_file"; } 
      $sample_rate = -1; $sample_count = -1; 
      for ($n = 0; $n <= 30; $n++) { 
       $line = <F>; 
       if ($line =~ m/sample_rate -i (\d+)/) { $sample_rate = $1; } 
       if ($line =~ m/sample_count -i (\d+)/) { $sample_count = $1; 
      } 
      if ($line =~ m/end_head/) { break; } 
     } 
     close(F); 
     if ($sample_rate == -1 || $sample_count == -1) { 
      die "could not parse sphere header from $sphere_file"; 
     } 
     $duration = $sample_count * 1.0/$sample_rate; 
     print "$utt $duration\n"; 
} ' > $data/utt2dur; then 
echo "$0: successfully obtained utterance lengths from sphere-file headers" 
    else 
     echo "$0: could not get utterance lengths from sphere-file headers, 
using wav-to-duration" 
    if command -v wav-to-duration >/dev/null; then 
     echo "$0: wav-to-duration is not on your path" 
     exit 1; 
    fi 

을 occures 코드의 조각을 얻을 이 데이터 세트에는 flac 파일 (제공된 스크립트를 통해 다운로드 한 파일) 만 있고 왜 우리가 검색하는지 이해하지 못합니다 wav 파일? 그리고 데이터 준비를 올바르게 실행하는 방법 (이 설명서에서 소스 코드를 변경하지 못했습니다.)

또한이 코드에서 어떤 일이 발생했는지 설명하면 다음에 익숙하지 않기 때문에 매우 감사 할 것입니다. 배쉬와 펄.

당신에게 많이 감사합니다!

+0

perl이 일을 처리하게하려면'$ data/wav.scp' 파일이 있어야합니다. 현재, else 부분을 출력하고 있으며,'wav-to-duration'이 발견되지 않아 실패합니다. – bytepusher

답변

1

나는이 라인에서 볼 수있는 문제가 당신이 당신의 경로에 KALDI 도구를 추가하지 않은 것을

utils/data/get_utt2dur.sh: line 99: wav-to-duration: command not found 

입니다. 파일 경로를 확인합니다. sh 디렉토리에 추가 할 디렉토리가 있는지 확인하십시오. 경로가 올바른지 (../../ .. 내부에 있기 때문에 현재 폴더 설정과 일치하지 않을 수도 있음)

perl 스크립트의 경우 사운드 파일의 샘플을 계산 한 다음이를 나눕니다 기간을 얻기 위해 샘플 속도로 'wav'단어에 대해 걱정하지 마십시오. 파일이 다른 형식 일 수도 있습니다. 단지 kaldi 기능의 이름 일뿐입니다.