Azure AI 음성에서 빠른 대화 내용 기록 API(미리 보기) 사용

참고 항목

이 기능은 현재 공개 미리 보기로 제공됩니다. 이 미리 보기는 서비스 수준 계약 없이 제공되며 프로덕션 워크로드에는 사용하지 않는 것이 좋습니다. 특정 기능이 지원되지 않거나 기능이 제한될 수 있습니다. 자세한 내용은 Microsoft Azure Preview에 대한 추가 사용 약관을 참조하세요.

빠른 대화 내용 기록 API는 음성 텍스트 변환 REST API 버전 2024-05-15-preview를 통해서만 사용할 수 있습니다. 이 미리 보기 버전은 변경될 수 있으며 프로덕션 용도로는 권장되지 않습니다. 후속 미리 보기 버전 또는 API의 GA(일반 공급) 후 90일 후에 예고 없이 사용 중지됩니다.

빠른 대화 내용 기록 API는 실시간 오디오보다 훨씬 빠르게 결과를 동기식으로 반환하여 오디오 파일을 대화 내용 기록하는 데 사용됩니다. 다음과 같이 예측 가능한 대기 시간으로 가능한 한 빨리 오디오 녹음 내용을 기록해야 하는 시나리오에서는 빠른 대화 내용 기록을 사용합니다.

  • 빠른 오디오 또는 동영상 대화 내용 기록, 자막 및 편집.
  • 동영상 번역

Azure AI 스튜디오에서 빠른 대화 내용 기록을 사용해 보세요.

필수 조건

  • 빠른 대화 내용 기록 API를 사용할 수 있는 지역 중 하나에 있는 Azure AI 음성 리소스입니다. 지원되는 지역은 인도 중부, 미국 동부, 동남 아시아 및 서유럽입니다. 기타 음성 서비스 기능이 지원되는 지역에 대한 자세한 내용은 음성 서비스 지역을 참조하세요.
  • 일괄 대화 내용 기록 API에서 지원하는 형식 및 코덱 중 하나를 사용하는 오디오 파일(길이 2시간 미만, 크기 200MB 미만). 지원되는 오디오 형식에 대한 자세한 내용은 지원되는 오디오 형식을 참조하세요.

빠른 대화 내용 기록 API 사용

빠른 대화 내용 기록 API는 multipart/form-data를 사용하여 대화 내용 기록을 위한 오디오 파일을 제출하는 REST API입니다. API는 대화 내용 기록 결과를 동기식으로 반환합니다.

다음 지침에 따라 요청 본문을 생성합니다.

  • 필수 locales 속성을 설정합니다. 이 값은 내용을 기록할 오디오 데이터의 예상 로캘과 일치해야 합니다. 지원되는 로캘은 en-US, es-ES, es-MX, fr-FR, hi-IN, it-IT, ja-JP, ko-KR, pt-BR 및 zh-CN입니다. 대화 내용 기록 요청당 하나의 로캘만 지정할 수 있습니다.
  • 선택적으로 profanityFilterMode 속성을 설정하여 인식 결과에서 욕설을 처리하는 방법을 지정합니다. 허용되는 값은 욕설 필터링을 사용하지 않으려면 None, 욕설을 별표로 바꾸려면 Masked, 결과에서 모든 욕설을 제거하려면 Removed, 욕설 태그를 추가하려면 Tags입니다. 기본값은 Masked입니다. profanityFilterMode 속성은 일괄 대화 내용 기록 API를 통한 것과 동일한 방식으로 작동합니다.
  • 선택적으로 별도로 변환할 채널의 0부터 시작하는 인덱스를 지정하려면 channels 속성을 설정합니다. 지정하지 않으면 여러 채널이 병합되어 공동으로 기록됩니다. 최대 2개의 채널만 지원됩니다. 스테레오 오디오 파일의 채널을 별도로 기록하려면 여기에서 [0,1]을 지정해야 합니다. 그렇지 않으면 스테레오 오디오가 모노로 병합되고 모노 오디오는 그대로 유지되며 단일 채널만 텍스트로 변환됩니다. 후자의 경우 단일 오디오 스트림만 복사되므로 출력에는 복사된 텍스트에 대한 채널 인덱스가 없습니다.
  • 선택적으로 diarizationSettings 속성을 설정하여 모노 채널 오디오 파일에서 여러 화자를 인식하고 구분합니다. 오디오 파일에서 말할 수 있는 최소 및 최대 사용자 수를 지정해야 합니다(예: "diarizationSettings": {"minSpeakers": 1, "maxSpeakers": 4} 지정). 그런 다음 대화 내용 기록 파일에는 기록된 각 구에 대한 speaker 항목이 포함됩니다. channels 속성을 [0,1](으)로 설정하면 스테레오 오디오에서 이 기능을 사용할 수 없습니다.

오디오 파일 및 요청 본문 속성을 사용하여 transcriptions 엔드포인트에 대한 multipart/form-data POST 요청을 수행합니다. 다음 예에서는 빠른 대화 내용 기록 API를 사용하여 대화 내용 기록을 만드는 방법을 보여 줍니다.

  • YourSubscriptionKey를 Speech 리소스 키로 바꿉니다.
  • YourServiceRegion을 음성 리소스 지역으로 바꿉니다.
  • YourAudioFile을 오디오 파일 경로로 바꿉니다.
  • 이전에 설명한 대로 양식 정의 속성을 설정합니다.
curl --location 'https://YourServiceRegion.api.cognitive.microsoft.com/speechtotext/transcriptions:transcribe?api-version=2024-05-15-preview' \
--header 'Content-Type: multipart/form-data' \
--header 'Accept: application/json' \
--header 'Ocp-Apim-Subscription-Key: YourSubscriptionKey' \
--form 'audio=@"YourAudioFile"' \
--form 'definition="{
    \"locales\":[\"en-US\"], 
    \"profanityFilterMode\": \"Masked\", 
    \"channels\": [0,1]}"'

응답에는 duration, channel 등이 포함됩니다. combinedPhrases 속성에는 각 채널에 대한 전체 대화 내용 기록이 별도로 포함되어 있습니다. 예를 들어, 첫 번째 화자가 말한 모든 내용은 combinedPhrases 배열의 첫 번째 요소에 있고, 두 번째 화자가 말한 모든 내용은 배열의 두 번째 요소에 있습니다.

{
	"duration": 185079,
	"combinedPhrases": [
		{
			"channel": 0,
			"text": "Hello. Thank you for calling Contoso. Who am I speaking with today? Hi, Mary. Are you calling because you need health insurance? Great. If you can answer a few questions, we can get you signed up in the Jiffy. So what's your full name? Got it. And what's the best callback number in case we get disconnected? Yep, that'll be fine. Got it. So to confirm, it's 234-554-9312. Excellent. Let's get some additional information for your application. Do you have a job? OK, so then you have a Social Security number as well. OK, and what is your Social Security number please? Sorry, what was that, a 25 or a 225? You cut out for a bit. Alright, thank you so much. And could I have your e-mail address please? Great. Uh That is the last question. So let me take your information and I'll be able to get you signed up right away. Thank you for calling Contoso and I'll be able to get you signed up immediately. One of our agents will call you back in about 24 hours or so to confirm your application. Absolutely. If you need anything else, please give us a call at 1-800-555-5564, extension 123. Thank you very much for calling Contoso. Uh Yes, of course. So the default is a digital membership card, but we can send you a physical card if you prefer. Uh, yeah. Absolutely. I've made a note on your file. You're very welcome. Thank you for calling Contoso and have a great day."
		},
		{
			"channel": 1,
			"text": "Hi, my name is Mary Rondo. I'm trying to enroll myself with Contuso. Yes, yeah, I'm calling to sign up for insurance. Okay. So Mary Beth Rondo, last name is R like Romeo, O like Ocean, N like Nancy D, D like Dog, and O like Ocean again. Rondo. I only have a cell phone so I can give you that. Sure, so it's 234-554 and then 9312. Yep, that's right. Uh Yes, I am self-employed. Yes, I do. Uh Sure, so it's 412256789. It's double two, so 412, then another two, then five. Yeah, it's maryrondo@gmail.com. So my first and last name at gmail.com. No periods, no dashes. That was quick. Thank you. Actually, so I have one more question. I'm curious, will I be getting a physical card as proof of coverage? uh Yes. Could you please mail it to me when it's ready? I'd like to have it shipped to, are you ready for my address? So it's 2660 Unit A on Maple Avenue SE, Lansing, and then zip code is 48823. Awesome. Thanks so much."
		}
	],
	"phrases": [
		{
			"channel": 0,
			"offset": 720,
			"duration": 480,
			"text": "Hello.",
			"words": [
				{
					"text": "Hello.",
					"offset": 720,
					"duration": 480
				}
			],
			"locale": "en-US",
			"confidence": 0.9177142
		},
		{
			"channel": 0,
			"offset": 1200,
			"duration": 1120,
			"text": "Thank you for calling Contoso.",
			"words": [
				{
					"text": "Thank",
					"offset": 1200,
					"duration": 200
				},
				{
					"text": "you",
					"offset": 1400,
					"duration": 80
				},
				{
					"text": "for",
					"offset": 1480,
					"duration": 120
				},
				{
					"text": "calling",
					"offset": 1600,
					"duration": 240
				},
				{
					"text": "Contoso.",
					"offset": 1840,
					"duration": 480
				}
			],
			"locale": "en-US",
			"confidence": 0.9177142
		},
		{
			"channel": 0,
			"offset": 2320,
			"duration": 1120,
			"text": "Who am I speaking with today?",
			"words": [
				{
					"text": "Who",
					"offset": 2320,
					"duration": 160
				},
				{
					"text": "am",
					"offset": 2480,
					"duration": 80
				},
				{
					"text": "I",
					"offset": 2560,
					"duration": 80
				},
				{
					"text": "speaking",
					"offset": 2640,
					"duration": 320
				},
				{
					"text": "with",
					"offset": 2960,
					"duration": 160
				},
				{
					"text": "today?",
					"offset": 3120,
					"duration": 320
				}
			],
			"locale": "en-US",
			"confidence": 0.9177142
		},
        // More transcription results removed for brevity
        // {...},
		{
			"channel": 1,
			"offset": 4480,
			"duration": 1600,
			"text": "Hi, my name is Mary Rondo.",
			"words": [
				{
					"text": "Hi,",
					"offset": 4480,
					"duration": 400
				},
				{
					"text": "my",
					"offset": 4880,
					"duration": 120
				},
				{
					"text": "name",
					"offset": 5000,
					"duration": 120
				},
				{
					"text": "is",
					"offset": 5120,
					"duration": 160
				},
				{
					"text": "Mary",
					"offset": 5280,
					"duration": 240
				},
				{
					"text": "Rondo.",
					"offset": 5520,
					"duration": 560
				}
			],
			"locale": "en-US",
			"confidence": 0.8989456
		},
		{
			"channel": 1,
			"offset": 6080,
			"duration": 1920,
			"text": "I'm trying to enroll myself with Contuso.",
			"words": [
				{
					"text": "I'm",
					"offset": 6080,
					"duration": 160
				},
				{
					"text": "trying",
					"offset": 6240,
					"duration": 200
				},
				{
					"text": "to",
					"offset": 6440,
					"duration": 80
				},
				{
					"text": "enroll",
					"offset": 6520,
					"duration": 200
				},
				{
					"text": "myself",
					"offset": 6720,
					"duration": 360
				},
				{
					"text": "with",
					"offset": 7080,
					"duration": 120
				},
				{
					"text": "Contuso.",
					"offset": 7200,
					"duration": 800
				}
			],
			"locale": "en-US",
			"confidence": 0.8989456
		},
        // More transcription results removed for brevity
        // {...},
	]
}