lsy0314 / sintoburi

:fish: 신토불이 - 우리 몸에는 우리 땅에서 자란 전통음식이 체질에 잘맞고 건강에 이롭다라는 뜻을 가지고 있습니다.
3 stars 2 forks source link

[테스트, 완료] Google Speech API 기능 테스트 작업 #14

Open lsy0314 opened 6 years ago

lsy0314 commented 6 years ago
lsy0314 commented 6 years ago

.m4a 음성파일을 테스트하기 위한 스크립트

#!/usr/bin/env bash

# Configuration variables
google_speech=~/google-speech-api/php-docs-samples/speech/speech.php

# Check if required commands are prepared
which ffmpeg
which php

# Check if an user types argument1 and argument2.
if [[  $1 == "" $2 == "" ]]; then
    echo -e "Ooops.!!! Run $0 correctly."
    echo -e "For example, > $0  {raw|flac} {file_name}."
    echo -e "Do not type .m4a in case of {file_name}."
fi

# Running sequence: .m4a --> .flac --> korean text
if [[ $1 == "flac" ]]; then
    lang_locale=ko-KR
    sample_rate=44100
    media_type=FLAC
    sudo ffmpeg -i $2.m4a -af aformat=s16:$sample_rate  $2.flac
    php $google_speech transcribe  --encoding $media_type --language-code $lang_locale --sample-rate $sample_rate $2.flac
fi

# Running sequence: .m4a --> .raw --> korean text
if [[ $1 == "raw" ]]; then
    lang_locale=ko-KR
    sample_rate=16000
    media_type=LINEAR16
    sudo ffmpeg -y -i $2.m4a -acodec pcm_s16le -f s16le -ac 1 -ar $sample_rate $2.raw
    php $google_speech transcribe  --encoding $media_type --language-code $lang_locale --sample-rate $sample_rate $2.raw
fi
hjoon0510 commented 6 years ago

.m4a -> .flac 변환후 정확도 확률

1.Press [q] to stop, [?] for help size= 234kB time=00:00:07.74 bitrate= 247.3kbits/s speed=55.8x video:0kB audio:225kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 3.631198% hjoon0510@hjoon0510-desktop:/var/www/html/sintoburi/webapp/audio/20180804$ peech=/home/hjoon0510/google-speech-api/php-docs-samples/speech/speech.php hjoon0510@hjoon0510-desktop:/var/www/html/sintoburi/webapp/audio/20180804$ /usr/bin/php $speech transcribe 201808040030_4446e67ef725df8bb6da2f502a0df0e8.flac --encoding FLAC --language-code ko-KR --sample-rate 44100

Transcript: 지금 반찬 가게 오시면 두 개 반찬을 사시면 상기 반찬 내 공짜로 그렇게 해 드립니다 Confidence: 0.6876752

2.Press [q] to stop, [?] for help size= 367kB time=00:00:08.45 bitrate= 355.9kbits/s speed=55.7x video:0kB audio:359kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.281303% hjoon0510@hjoon0510-desktop:/var/www/html/sintoburi/webapp/audio/20180804$ peech=/home/hjoon0510/google-speech-api/php-docs-samples/speech/speech.php hjoon0510@hjoon0510-desktop:/var/www/html/sintoburi/webapp/audio/20180804$ /usr/bin/php $speech transcribe 201808041310_55c27107501d5ac7a77fcb4373ee0396.flac --encoding FLAC --language-code ko-KR --sample-rate 44100

Transcript: 8월 6일 10시부터 선물을 방문하시는 두들기는 노트 한 번씩 증정해 드립니다 Confidence: 0.73318917

3.Press [q] to stop, [?] for help size= 143kB time=00:00:05.02 bitrate= 232.5kbits/s speed=56.1x video:0kB audio:135kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 6.084445% hjoon0510@hjoon0510-desktop:/var/www/html/sintoburi/webapp/audio/20180804$ speech=/home/hjoon0510/google-speechapi/php-docs-samples/speech/speech.php hjoon0510@hjoon0510-desktop:/var/www/html/sintoburi/webapp/audio/20180804$ /usr/bin/php $speech transcribe 20188040030_8fc06b7d0901a31949aba028c45e1eac.flac --encoding FLAC --language-code ko-KR --sample-rate 44100

Transcript: 지금 오시면 뻥튀기를 더 드립니다 Confidence: 0.85691804

4.Press [q] to stop, [?] for help size= 636kB time=00:00:14.07 bitrate= 370.4kbits/s speed=55.2x video:0kB audio:628kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.304021% hjoon0510@hjoon0510-desktop:/var/www/html/sintoburi/webapp/audio/20180804$ eech=/home/hjoon0510/google-speech-ai/php-docs-samples/speech/speech.php hjoon0510@hjoon0510-desktop:/var/www/html/sintoburi/webapp/audio/20180804$ /usr/bin/php $speech transcribe 20188041140_0a8950b211a83403ca524b2ed75868b2.flac --encoding FLAC --language-code ko-KR --sample-rate 44100

Transcript: 오늘 저희 병원은 토요일인 관계로 2시에 진료를 마칩니다 방문하시는 손님들은 잘 하시기 바랍니다 Confidence: 0.85981905

5.Press [q] to stop, [?] for help size= 234kB time=00:00:07.74 bitrate= 247.3kbits/s speed=56.2x video:0kB audio:225kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 3.631198% hjoon0510@hjoon0510-desktop:/var/www/html/sintoburi/webapp/audio/20180804$ peech=/home/hjoon0510/google-speech-pi/php-docs-samples/speech/speech.php hjoon0510@hjoon0510-desktop:/var/www/html/sintoburi/webapp/audio/20180804$ /usr/bin/php $speech transcribe 20188040030_4446e67ef725df8bb6da2f502a0df0e8.flac --encoding FLAC --language-code ko-KR --sample-rate 44100

Transcript: 지금 반찬 가게 오시면 두 개 반찬을 사시면 상기 반찬 내 공짜로 그렇게 해 드립니다 Confidence: 0.6876752

6.Press [q] to stop, [?] for help size= 122kB time=00:00:04.17 bitrate= 238.8kbits/s speed=56.7x video:0kB audio:113kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 7.216326% hjoon0510@hjoon0510-desktop:/var/www/html/sintoburi/webapp/audio/20180804$ speech=/home/hjoon0510/google-speechapi/php-docs-samples/speech/speech.php hjoon0510@hjoon0510-desktop:/var/www/html/sintoburi/webapp/audio/20180804$ /usr/bin/php $speech transcribe 20188040030_2309a64b26b8a2a5d61aff62bd6fd7d0.flac --encoding FLAC --language-code ko-KR --sample-rate 44100

Transcript: 지금 물총을 사시면 민희는 조금 하나 더 드림 Confidence: 0.6828361

7.Press [q] to stop, [?] for help size= 458kB time=00:00:10.24 bitrate= 366.2kbits/s speed=55.5x video:0kB audio:450kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.821820% hjoon0510@hjoon0510-desktop:/var/www/html/sintoburi/webapp/audio/20180804$ peech=/home/hjoon0510/google-speech-pi/php-docs-samples/speech/speech.php hjoon0510@hjoon0510-desktop:/var/www/html/sintoburi/webapp/audio/20180804$ /usr/bin/php $speech transcribe 20188041310_80440fc6f39faa8f20ccc1fbaff7c9f0.flac --encoding FLAC --language-code ko-KR --sample-rate 44100

Transcript: 오늘 한다 가방에서는 Confidence: 0.64758575

8.Press [q] to stop, [?] for help size= 458kB time=00:00:10.24 bitrate= 366.2kbits/s speed=55.5x video:0kB audio:450kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.821820% hjoon0510@hjoon0510-desktop:/var/www/html/sintoburi/webapp/audio/20180804$ peech=/home/hjoon0510/google-speech-pi/php-docs-samples/speech/speech.php hjoon0510@hjoon0510-desktop:/var/www/html/sintoburi/webapp/audio/20180804$ /usr/bin/php $speech transcribe 20188041310_80440fc6f39faa8f20ccc1fbaff7c9f0.flac --encoding FLAC --language-code ko-KR --sample-rate 44100

Transcript: 여름 가방을 세일합니다 아울러 가을 신상품이 출시되었으니 많은 방문 바랍니다 Confidence: 0.8729274

9.Press [q] to stop, [?] for help size= 521kB time=00:00:11.37 bitrate= 375.1kbits/s speed=55.2x video:0kB audio:513kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.597184% hjoon0510@hjoon0510-desktop:/var/www/html/sintoburi/webapp/audio/20180804$ eech=/home/hjoon0510/google-speech-api/php-docs-samples/speech/speech.php hjoon0510@hjoon0510-desktop:/var/www/html/sintoburi/webapp/audio/20180804$ /usr/bin/php $speech transcribe 201808042130_45e234af17ecda8a63889767053b1b89.flac --encoding FLAC --language-code ko-KR --sample-rate 44100

Transcript: 오늘 9시 30분부터 팔라독 집을 방문하신 분들께 너한테는 구입하시면 탄생을 축하드립니다 Confidence: 0.8250587

10.Press [q] to stop, [?] for help size= 332kB time=00:00:07.33 bitrate= 370.7kbits/s speed=55.3x video:0kB audio:324kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.529050% hjoon0510@hjoon0510-desktop:/var/www/html/sintoburi/webapp/audio/20180804$ peech=/home/hjoon0510/google-speech-api/php-docs-samples/speech/speech.php hjoon0510@hjoon0510-desktop:/var/www/html/sintoburi/webapp/audio/20180804$ /usr/bin/php $speech transcribe 201808041130_9ff12d7739e1c1e3cfd0cf711c6e03c3.flac --encoding FLAC --language-code ko-KR --sample-rate 44100

Transcript: 오늘 활동도 미소는 부득이한 사정으로 휴무입니다 감사합니다 Confidence: 0.849288

11.Press [q] to stop, [?] for help size= 503kB time=00:00:10.75 bitrate= 383.2kbits/s speed=55.4x video:0kB audio:495kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.655232% hjoon0510@hjoon0510-desktop:/var/www/html/sintoburi/webapp/audio/20180804$ peech=/home/hjoon0510/google-speech-api/php-docs-samples/speech/speech.php hjoon0510@hjoon0510-desktop:/var/www/html/sintoburi/webapp/audio/20180804$ /usr/bin/php $speech transcribe 201808041110_c541fbea54d08ab1572a55c4d222446b.flac --encoding FLAC --language-code ko-KR --sample-rate 44100 Transcript: 오늘부터 나이야 가라 양말에서 원 플러스 원 행사를 합니다 정말 필요하신 분 꼭 방문하세요 Confidence: 0.87415504

12.Press [q] to stop, [?] for help size= 536kB time=00:00:11.79 bitrate= 372.4kbits/s speed=55.8x video:0kB audio:528kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.551073% hjoon0510@hjoon0510-desktop:/var/www/html/sintoburi/webapp/audio/20180804$ peech=/home/hjoon0510/google-speech-api/php-docs-samples/speech/speech.php hjoon0510@hjoon0510-desktop:/var/www/html/sintoburi/webapp/audio/20180804$ /usr/bin/php $speech transcribe 201808041150_95a8d906b1313ba9442b9347379a8ba3.flac --encoding FLAC --language-code ko-KR --sample-rate 44100 Transcript: 오늘부터 진진 한국에서는 직송 배달해 드립니다 5만원이상 무료배송입니다 Confidence: 0.739075

14.Press [q] to stop, [?] for help size= 217kB time=00:00:06.20 bitrate= 286.5kbits/s speed=53.5x video:0kB audio:209kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 3.921862% hjoon0510@hjoon0510-desktop:/var/www/html/sintoburi/webapp/audio/20180804$ peech=/home/hjoon0510/google-speech-api/php-docs-samples/speech/speech.php hjoon0510@hjoon0510-desktop:/var/www/html/sintoburi/webapp/audio/20180804$ /usr/bin/php $speech transcribe 201808040030_a8897f886167e1bbdd33b59ce8e985d4.flac --encoding FLAC --language-code ko-KR --sample-rate 44100

Transcript: 지금 글쎄 세트로 사 줘야지 추가 그릇을네 개 더 드립니다 Confidence: 0.7347818

15.Press [q] to stop, [?] for help size= 671kB time=00:00:15.48 bitrate= 354.7kbits/s speed=54.7x video:0kB audio:662kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.236430% hjoon0510@hjoon0510-desktop:/var/www/html/sintoburi/webapp/audio/20180804$ eech=/home/hjoon0510/google-speech-api/php-docs-samples/speech/speech.php hjoon0510@hjoon0510-desktop:/var/www/html/sintoburi/webapp/audio/20180804$ /usr/bin/php $speech transcribe 201808041210_62dfd016b95d742e6d124a20ce20a87a.flac --encoding FLAC --language-code ko-KR --sample-rate 44100

Transcript: 복분자로 만든 새로운 뻥튀기를 출시를 앞두고 오늘 여러분들께 취직할 수 있는 기회를 드립니다 어서 오셔서 복분자 뻥튀기를 맛 보세요 Confidence: 0.854694

16.Press [q] to stop, [?] for help size= 597kB time=00:00:12.84 bitrate= 380.8kbits/s speed=54.9x video:0kB audio:589kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.391048% hjoon0510@hjoon0510-desktop:/var/www/html/sintoburi/webapp/audio/20180804$ eech=/home/hjoon0510/google-speech-api/php-docs-samples/speech/speech.php hjoon0510@hjoon0510-desktop:/var/www/html/sintoburi/webapp/audio/20180804$ /usr/bin/php $speech transcribe 201808041050_0d2fe4f5a8736fa1c1ff17d59c486347.flac --encoding FLAC --language-code ko-KR --sample-rate 44100

Transcript: 오늘 하나만 점을 방문하시는 고객분들께는 짜장면 보통은 시키셔도 짜장면 곱빼기로 드립니다 많이 방문해 주세요 Confidence: 0.7495023

17.Press [q] to stop, [?] for help size= 618kB time=00:00:13.46 bitrate= 375.9kbits/s speed=55.3x video:0kB audio:610kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.342864% hjoon0510@hjoon0510-desktop:/var/www/html/sintoburi/webapp/audio/20180804$ eech=/home/hjoon0510/google-speech-api/php-docs-samples/speech/speech.php hjoon0510@hjoon0510-desktop:/var/www/html/sintoburi/webapp/audio/20180804$ /usr/bin/php $speech transcribe 201808041920_78de0f87c1e566335268825351363f40.flac --encoding FLAC --language-code ko-KR --sample-rate 44100

Transcript: 오늘 저녁 7시부터 저희 횟집을 방문하시면 멍게 한 세트를 찍어 보냅니다 맛있게 드세요 Confidence: 0.6687052

18.Press [q] to stop, [?] for help size= 367kB time=00:00:08.45 bitrate= 355.9kbits/s speed=55.9x video:0kB audio:359kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.281303% hjoon0510@hjoon0510-desktop:/var/www/html/sintoburi/webapp/audio/20180804$ peech=/home/hjoon0510/google-speech-api/php-docs-samples/speech/speech.php hjoon0510@hjoon0510-desktop:/var/www/html/sintoburi/webapp/audio/20180804$ /usr/bin/php $speech transcribe 201808041340_5a25af2b9dddbbfa83b5a9daf2f807ed.flac --encoding FLAC --language-code ko-KR --sample-rate 44100

Transcript: 8월 6일 10시부터 선물을 방문하시는 두들기는 노트 한 번씩 증정해 드립니다 Confidence: 0.73318934