๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
โœ’๏ธ Kibwa Voice Phishing Prev Project/Project Development & Ideas

[Project Development & Ideas] ํ”„๋กœ์ ํŠธ ๋ฐœ์ „_์‹œ๊ฐ ์žฅ์• ์ธ ๋ถ„๋“ค์„ ์œ„ํ•œ ์ถ”๊ฐ€ ์•„์ด๋””์–ด ์ œ์•ˆ

by A Lim Han 2023. 5. 28.

# ํ”„๋กœ์ ํŠธ ๋ฐœ์ „_์‹œ๊ฐ ์žฅ์• ์ธ ๋ถ„๋“ค์„ ์œ„ํ•œ ์ถ”๊ฐ€ ์•„์ด๋””์–ด ์ œ์•ˆ

 

1. ์•ฑ์—์„œ ๋ณด์ด์Šคํ”ผ์‹ฑ ํŒ๋ณ„ ๊ฒฐ๊ณผ๋ฅผ ์Œ์„ฑ์œผ๋กœ ์•ˆ๋‚ด

: App ์ œ์ž‘ ์‹œ ์Œ์„ฑ ์ถœ๋ ฅ ๊ธฐ๋Šฅ ์ถ”๊ฐ€

 

A. ์Œ์„ฑ ํ•ฉ์„ฑ API ์‚ฌ์šฉ

-->  API๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ํ…์ŠคํŠธ๋ฅผ ์Œ์„ฑ์œผ๋กœ ๋ณ€ํ™˜ํ•˜๊ณ , ์›น ์•ฑ์—์„œ ํ•ด๋‹น ์Œ์„ฑ์„ ์žฌ์ƒํ•  ์ˆ˜ ์žˆ์Œ

 

  •  ๋Œ€ํ‘œ์ ์ธ ์Œ์„ฑ ํ•ฉ์„ฑ API
Google Cloud Text-to-Speech Microsoft Azure Text-to-Speech Amazon Polly

 

 

 

B. JavaScript์™€ Web Audio API

: ์›น ์•ฑ์˜ ํด๋ผ์ด์–ธํŠธ ์ธก์—์„œ JavaScript์™€ Web Audio API๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์Œ์„ฑ์„ ์ƒ์„ฑํ•˜๊ณ  ์žฌ์ƒํ•  ์ˆ˜ ์žˆ์Œ. ์ด๋ฅผ ํ†ตํ•ด ํ…์ŠคํŠธ๋ฅผ ์Œ์„ฑ์œผ๋กœ ๋ณ€ํ™˜ํ•˜๊ณ , ์›น ์•ฑ์—์„œ ํ•ด๋‹น ์Œ์„ฑ์„ ์ถœ๋ ฅํ•  ์ˆ˜ ์žˆ์Œ

 

-->  ์˜ˆ๋ฅผ ๋“ค์–ด, Text-to-Speech ์—”์ง„์„ ๊ตฌํ˜„ํ•˜๊ณ  ์ด๋ฅผ ์›น ์•ฑ์— ํ†ตํ•ฉ

// JavaScript ์ฝ”๋“œ ์˜ˆ์‹œ

// ์Œ์„ฑ ํ•ฉ์„ฑ API ๋˜๋Š” ์œ„ํ—˜๋„๋ฅผ ํ…์ŠคํŠธ๋กœ ๋ณ€ํ™˜ํ•˜๋Š” ํ•จ์ˆ˜
function convertToText(riskPercentage) {
  // ์œ„ํ—˜๋„๋ฅผ ํ…์ŠคํŠธ๋กœ ๋ณ€ํ™˜ํ•˜๋Š” ๋กœ์ง ๊ตฌํ˜„
  return "๋ฐฉ๊ธˆ ์ „ํ™”์˜ ๋ณด์ด์Šคํ”ผ์‹ฑ ์œ„ํ—˜๋„๋Š” " + riskPercentage + "% ์ž…๋‹ˆ๋‹ค.";
}

// ์Œ์„ฑ ์ถœ๋ ฅ ํ•จ์ˆ˜
function playVoice(text) {
  // Web Audio API๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ํ…์ŠคํŠธ๋ฅผ ์Œ์„ฑ์œผ๋กœ ๋ณ€ํ™˜ํ•˜์—ฌ ์žฌ์ƒํ•˜๋Š” ๋กœ์ง ๊ตฌํ˜„
}

// ์œ„ํ—˜๋„๋ฅผ ์Œ์„ฑ์œผ๋กœ ์•Œ๋ฆฌ๋Š” ํ•จ์ˆ˜
function notifyRisk(riskPercentage) {
  var text = convertToText(riskPercentage);
  playVoice(text);
}

// ์‚ฌ์šฉ ์˜ˆ์‹œ
var riskPercentage = 70;
notifyRisk(riskPercentage);

 

 

 

 

2. ์‹œ๊ฐ ์žฅ์• ์ธ๋ถ„๋“ค์„ ์œ„ํ•œ ์ ์ž ๋„์ž…

: ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด ์ž์ฒด์— ์‹œ์Šคํ…œ ๋ฐ ์•ฑ ์‚ฌ์šฉ ๋ฐฉ๋ฒ•์„ ์ ์ž๋กœ ๋ช…์‹œ (์Šคํ‹ฐ์ปค ํ˜•์‹์œผ๋กœ ๋ถ€์ฐฉ)

-->  ์•„๋ž˜ ์ ์ž ํ”„๋ฆฐํ„ฐ๋กœ ์›ํ•˜๋Š” ๋‚ด์šฉ ์ธ์‡„ ๊ฐ€๋Šฅ

-->  ๊ตฌ๋งค ๋ชฉ๋ก์— ์ถ”๊ฐ€ํ•ด๋ณด๋Š” ๊ฑด ์–ด๋–จ๊นŒ?

https://www.coupang.com/vp/products/1803089365?itemId=3067831726&vendorItemId=71055756828&q=%EC%A0%90%EC%9E%90%EB%B3%BC%EB%A1%9C%EA%B8%B0&itemsCount=17&searchId=93dc9ac46bf24d858fbb569608648a71&rank=1&isAddedCart= 

 

๋ณผ๋กœ๊ธฐ ํœด๋Œ€์šฉ ์ ์ž ์ธ์‡„๊ธฐ

COUPANG

www.coupang.com

 

 

 

 

3. ์•ฑ & ์‹œ์Šคํ…œ ์œ„์น˜์™€ ์‚ฌ์šฉ๋ฒ• ์•ˆ๋‚ด๋ฅผ ์œ„ํ•œ ์†”๋ฃจ์…˜

A. ์Œ์„ฑ ์ธ์‹ ์‹œ ๊ธฐ๊ธฐ์˜ ์œ„์น˜๋ฅผ ์•Œ๋ฆฌ๊ธฐ ์œ„ํ•œ ์†Œ๋ฆฌ ์ถœ๋ ฅ

-->  ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด์— ์Œ์„ฑ ์ถœ๋ ฅ ๊ธฐ๊ธฐ ๋ถ€์ฐฉํ•ด๋ณด๋Š” ๊ฑด ์–ด๋–จ๊นŒ?

 

ex) "00์•ผ ์–ด๋”” ์žˆ์–ด?" --> ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด๊ฐ€ ์Œ์„ฑ ์ธ์‹ ํ›„ '์‚์‚์‚' ์†Œ๋ฆฌ ์ถœ๋ ฅ

 

 

 

B. ์•ฑ ํ„ฐ์น˜ ์‹œ ๋ญ˜ ํ„ฐ์น˜ํ–ˆ๋Š”์ง€ ํ•˜๋‚˜ํ•˜๋‚˜ ์Œ์„ฑ์œผ๋กœ ์•ˆ๋‚ดํ•ด์ฃผ๋Š” ์‹œ์Šคํ…œ

: ์•ฑ์—์„œ ์‚ฌ์šฉ์ž ์ธํ„ฐํŽ˜์ด์Šค ์ด๋ฒคํŠธ๋ฅผ ๊ฐ์ง€ํ•˜๊ณ , ํ•ด๋‹น ๋ฒ„ํŠผ์˜ ์ •๋ณด๋ฅผ ์Œ์„ฑ์œผ๋กœ ์ถœ๋ ฅ

-->  ์‹œ๊ฐ ์žฅ์• ์ธ ๋ถ„๋“ค๋ฟ ์•„๋‹ˆ๋ผ ๋…ธ์ธ ๋ถ„๋“ค๊ป˜๋„ ์œ ์šฉํ•  ๋“ฏ

 

ex) '00' ๋ฒ„ํŠผ ํ„ฐ์น˜ ์‹œ -->  ์Œ์„ฑ์œผ๋กœ "์„ ํƒํ•œ ๋ฒ„ํŠผ์€ 00์ž…๋‹ˆ๋‹ค." ๋“ฑ์˜ ๋ฌธ๊ตฌ ์ถœ๋ ฅ

# Django ์ฝ”๋“œ ์˜ˆ์‹œ

import pyttsx3
from django.shortcuts import render

# ์Œ์„ฑ ์ถœ๋ ฅ์„ ์œ„ํ•œ ์ดˆ๊ธฐํ™”
engine = pyttsx3.init()

def button_click(request):
    # ๋ฒ„ํŠผ ํด๋ฆญ ์ด๋ฒคํŠธ ์ฒ˜๋ฆฌ ๋กœ์ง
    button_id = request.POST.get('button_id')  # ๋ฒ„ํŠผ์˜ ID๋ฅผ ๊ฐ€์ ธ์˜ด

    # ์Œ์„ฑ์œผ๋กœ ๋ฒ„ํŠผ ์ •๋ณด ์ถœ๋ ฅ
    speak_text = "์„ ํƒํ•œ ๋ฒ„ํŠผ์€ " + button_id + "์ž…๋‹ˆ๋‹ค."
    engine.say(speak_text)
    engine.runAndWait()

    return render(request, 'your_template.html')