Speech framework tips

Speech framework tips

speech framework tips

D4f04ef104c8fbfc9caa3c80e41692fd?s=128

Ryo Tsuzukihashi

July 10, 2020
Tweet

Transcript

  1. 5TV[VLJIBTIJ3ZP !UTV[VLJ 4QFFDIGSBNFXPSLUJQT <0OMJOF>QPUBUPUJQTJ04"OESPJE։ൃ5JQTڞ༗ձ

  2. ࣗݾ঺հ w!UTV[VLJ w:BIPP+"1"/ 1BZ1BZϑϦϚJ04ΞϓϦ։ൃ wݸਓΞϓϦ։ൃͱࣸਅ wݱࡏݸ໨ͷΞϓϦ։ൃத✌ bТ ✌

  3. 4QFFDIGSBNFXPSLͱ͸ w"QQMF੡ wԻ੠ೝࣝ ϦΞϧλΠϜɺ࿥ԻͲͪΒ΋ରԠ wJ04 J1BE04 NBD04ରԠ 4XJGU6*Λ࢖͏ͱಉ࣌ʹશ෦࡞Εͯඒຯ͍͠

  4. ϦΫΤετͷํ๏ αʔόʔ ΦϑϥΠϯ J04Ҏ߱ ੑೳ #FTU (PPE

  5. ϦΫΤετͷํ๏ αʔόʔ ΦϑϥΠϯ J04Ҏ߱ ੑೳ #FTU (PPE "1*੍ݶ ͋Γ ͳ͠

  6. ϦΫΤετͷํ๏ αʔόʔ ΦϑϥΠϯ J04Ҏ߱ ੑೳ #FTU (PPE "1*੍ݶ ͋Γ ͳ͠

    ରԠݴޠ Ҏ্ Ҏ্
  7. ϦΫΤετͷํ๏ αʔόʔ ΦϑϥΠϯ J04Ҏ߱ ੑೳ #FTU (PPE "1*੍ݶ ͋Γ ͳ͠

    ରԠݴޠ Ҏ্ Ҏ্ ೔ຊޠ ˓ ❌
  8. "1*ͷ੍ݶ wΦϑϥΠϯͰ͸੍ݶͳ͠ w4'4QFFDI3FDPHOJUJPO3FRVFTU wϦΫΤετඵ w࣌ؒʹճ ΞϓϦ͝ͱͰ͸ͳ͘ɺσόΠε͝ͱͷ੍ݶ

  9. ࣮૷ w 4QFFDIΛΠϯϙʔτ w -PDBMFΛࢦఆ ಛఆͷݴޠΛࢦఆ͢Δํ๏ Ϣʔβʔͷݱࡏͷ-PDBMFΛઃఆ͢Δํ๏ SFSpeechRecognizer(locale: Locale(identifier: "ja_JP"))

    SFSpeechRecognizer(locale: Locale.current) import Speech
  10. ࣮૷ ΞΫηεڐՄ SFSpeechRecognizer.requestAuthorization {status in switch status { case .authorized:

    case .denied: case .restricted: case .notDetermined: } }
  11. ࣮૷ w ϦΞϧλΠϜԻ੠ղੳ w ࿥Իͨ͠Ի੠Λղੳ SFSpeechAudioBufferRecognitionRequest() SFSpeechURLRecognitionRequest(url: URL) Ի੠ιʔεͷఆٛ

  12. ࣮૷ 3FRVFTUͷ݁ՌΛॲཧ speechRecognizer?.recognitionTask(with: speechRequest, resultHandler: { (speechResult, error) in if

    speechResult.isFinal { print("Speech in the file is \ (speechResult.bestTranscription.formattedString)") }
  13. Ի੠ೝࣝ݁Ռ J04·Ͱ w ॻ͖ى͜͠ 5SBOTDSJQUJPO  ༩͑ΒΕͨԻ੠શମΛςΩετͰදͨ͠΋ͷ w ୅ସղऍ "MUFSOBUJWFJOUFSQSFUBUJPOT

     ॻ͖ى͜͠ͷҟͳΔղऍ w ৴པ౓ $POpEFODFMFWFMT  ॻ͖ى͕͜͠Ϣʔβʔͷ4QFFDIͱਖ਼֬ʹҰக͢Δͱ͍͏৴པ౓ w λΠϛΠϯά৘ใ 5JNJOHJOGPSNBUJPO  ೝࣝͨ͠Ի੠ͷதͰ࿩͍ͯͨ͠୯ޠͳͲͷ։͔࢝Βͷඵ਺
  14. Ի੠ೝࣝ݁Ռ J04Ҏ߱ w ଎౓ TQFBLJOH3BUF  ෼ؒʹ࿩͞ΕΔݴ༿ͷ਺ w ฏۉٳࢭ࣌ؒ BWFSBHF1BVTF%VSBUJPO

     ୯ޠؒͷҰ࣌తͳఀࢭ࣌ؒͷฏۉɺ୯Ґ͸ඵ w Ի੠ղੳػೳ SFTVMUCFTU5SBOTDSJQUJPOTFHNFOUT͔Βऔಘ
  15. 4'5SBOTDSJQUJPO4FHNFOU w શମͷҰ෦Λৄࡉʹऔಘ͢ΔͨΊʹར༻ w ҰͭͷҙຯΛද͢୯ޠɺ୯ޠͷάϧʔϓͷԻ੠ w FYڞ༗ձɹˠࠓ೔༠սɺڞ༗ճɹͳͲʣ

  16. 4'7PJDF"OBMZUJDT J04Ҏ߱ w +JUUFSϐονͷมԽΛɺϑϨʔϜͷجຊप೾਺ͷύʔηϯςʔδͰදͨ͠΋ͷ TFHNFOUWPJDF"OBMZUJDT KJUUFSBDPVTUJD'FBUVSF7BMVF1FS'SBNF w 4IJNNFS֤ϑϨʔϜʹ͓͚Δ੠ྔ҆ఆੑʢৼ෯ʣͷมԽΛσγϕϧͰද͢ TFHNFOUWPJDF"OBMZUJDT TIJNNFSBDPVTUJD'FBUVSF7BMVF1FS'SBNF

    w 1JUDI֤ϑϨʔϜʹ͓͚ΔԻ৭ʢجຊप೾਺ʣͷߴ௿Λର਺Ͱදͨ͠΋ͷ TFHNFOUWPJDF"OBMZUJDT QJUDIBDPVTUJD'FBUVSF7BMVF1FS'SBNF w 7PJDJOHεϐʔνͷதͰൃੜͨ͠ԻҬ < >ͷൣғͷ֬཰Ͱදͨ͠΋ͷ TFHNFOUWPJDF"OBMZUJDT WPJDJOHBDPVTUJD'FBUVSF7BMVF1FS'SBNF
  17. ࣗ෼ͷ੿͍ൃԻͰࢼͯ͠Έͨ w ʮڞ༗ձʯൃԻ ग़ྗ CFTU5SBOTDSJQUJPO GPSNBUUFE4USJOH ڞ༗ձ TQFBLJOH3BUF  BWFSBHF1BVTF%V

    SBUJPO  TFHNFOU   BMUFSOBUJWF4VCTUSJOH T ࠓ೔༠ս ڞ༗ճ DPOpEFODF   UJNJOH  
  18. ࣮૷࣌ͷ஫ҙ఺ w *OGPQMJTU ɹ/44QFFDI3FDPHOJUJPO6TBHF%FTDSJQUJPO ɹ/4.JDSPQIPOF6TBHF%FTDSJQUJPO w ௨࿩த͸࿥Ի͕Ͱ͖ͳ͍ͷͰσόοά࣌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