Presentation is loading. Please wait.

Presentation is loading. Please wait.

SpeechRecognition 20111687 최해진 20111651 이동규.

Similar presentations


Presentation on theme: "SpeechRecognition 20111687 최해진 20111651 이동규."— Presentation transcript:

1 SpeechRecognition 최해진 이동규

2 목표 1. 앱에서 소리파일의 음성을 인식하여 transcription

3 Transcription Basics(1)
1. SFSpeechRecognizer: 음성인식 프레임워크의 주 컨트롤러이다. 주 역 할은 recognition task를 생성하고, 그 결과를 리턴받는 것이다. 2. SFSpeechRecognitionRequest: 음성인식을 요청하는 기본 클래스이 다. 역할은 인식기를 오디오 소스에 가리키게 하고, 트랜스크립션을 발생 시키는 요청을 하는것이다. 오디오 소스는 크게 두가지로 나눌 수 있다. SFSpeechURLRecognitionRequest: 소리파일 SFSpeechAudioBufferRecognitionRequest: 버퍼

4 Transcription Basics(2)
3. SFSpeechRecognitionTask: 이 오브젝트는 인식기가 요청을 했을 때 만들어지고 진행과정을 tracking한다. Transcription result를 만들어내 게 된다. 4. SFSpeechRecognitionResult: 이 오브젝트는 오디오의 한 chunk transcription을 갖는다. 각각의 결과는 single word에 대응된다.

5 Audio file speech transcription(1)
사용할 라이브러리: Speech ( import Speech ) Info.plist: Privacy – Speech Recognition Usage Description을 추가

6 Audio file speech transcription(2)
1. Recognizer를 설정. Locale(지역) 을 지정하지 않으면 default로 해당 device의 locale로 설정된다. isAvailable은 준비가 되었는지를 체 크해주는 역할이다. 2. updateUI는 예제 프로젝트에서 transcribe 버튼을 눌렀을때 애니메 이션을 시작하게 하는 코드이고, 파 일 음성인식이므로 URL을 사용한다.

7 Audio file speech transcription(3)
3. 2번에서 만든 요청을 매개변수로 넣어 task를 만든다. Result, error를 만들고, error일 경우 에러메시지를 띄워준다. 4. isFinal 프로퍼티는 모든 transcription이 끝났을 때 True이다. 완료된 후 UI업데이트를 해주고, bestTranscription은 가장 정확도 높 은 transcription을 포함하고 있 다.formattedString은 text view로 화면에 display한다.

8 Audio file speech transcription(4)
Locale 지역을 설정해주어, 정확도를 높일 수 있다. 위의 코드를 아래처럼 바꾸면 파라미터로 locale을 지정할 수 있다. 만약 locale을 지정하지 않으면 현재 device의 locale로 설정되도록 한다.

9 Live speech recognition(1)
사용할 라이브러리: Speech ( import Speech ) Live transcription은 Audio transcription과 유사하다. 큰 차이점은 request type이 SFSpeechAudioBufferRecognitionRequest Connection audio buffer : audio engine을 구성하고 recognition request를 연결해야함. Open Info.plist : Privacy – Microphone Usage Description을 추가

10 Live speech recognition(2)
Speech Recognition에 접근권한을 얻기 위해 requestAuthorization 호 출. 실패할 경우 에러메시지 호출.

11 Live speech recognition(3)
1. 마이크로부터 오는 input audio node들을 가져옴 2. 노드의 output bus의 tap을 설치하 고 버퍼가 채워지면 SFSpeechAudioBufferRecognitionRe quest에 append된 live input node들 을 closure가 반환해줌. 3. recording을 준비하고 시작한다.

12 Live speech recognition(4)
Live audio가 transcription이 시작 되면 호출된다. 결과로부터 bestTrascription을 얻어 transcription을 출력하는 Label을 update한다.

13 Live speech recognition(5)
Stop: releases all resources endAudio : stop listening Cancel : free up resources


Download ppt "SpeechRecognition 20111687 최해진 20111651 이동규."

Similar presentations


Ads by Google