iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
❄️

Entering a New Era of Audio Data Analysis with Snowflake's AI_TRANSCRIBE Function

に公開
2025/09/27

Introduction

Snowflake's unstructured data analysis has taken another leap forward. Since the start of 2025, Cortex AI has been strengthening its support for analyzing unstructured data such as images and documents, and now finally audio data can be handled directly from SQL!

The AI_TRANSCRIBE function introduced here has been released in Public Preview as a new member of the Snowflake Cortex AISQL family. Audio data—such as customer support call recordings, meeting recordings, and interview audio—which previously had a certain barrier to utilization, can now be converted to text with a single SQL statement and further combined with other AISQL functions for advanced analysis.

By supporting all three major data formats—images, documents, and now audio—in the world of unstructured data, the potential for business applications of data analysis has expanded dramatically.

In this article, we will explain in detail, with practical examples, the basic usage of the AI_TRANSCRIBE function, important notes, and business applications. We will also introduce a sample voice-input AI chatbot application using Streamlit in Snowflake, so please read to the end!

What is the AI_TRANSCRIBE function?

The AI_TRANSCRIBE function is a speech-to-text conversion feature in Snowflake Cortex AISQL. Previously, utilizing audio data required integration with external services or the introduction of third-party packages, but with the AI_TRANSCRIBE function, you can convert audio to text directly within SQL queries.

Main features

  • SQL Native: Like other AISQL functions, it can be called directly from SQL, making it simple to use.
  • Multi-language support: Supports many languages, including Japanese.
  • Speaker diarization: Can identify and label multiple speakers.
  • Timestamping: Provides timestamps at the word or speaker level.
  • Secure processing: Data processing is completed within Snowflake, ensuring data governance.

As a member of the Cortex AISQL family

AI_TRANSCRIBE can be combined with existing Cortex AISQL functions for even more powerful analysis:

  • AI_SENTIMENT: Sentiment analysis of transcribed audio.
  • AI_CLASSIFY: Automatic classification of audio content.
  • AI_COMPLETE: Summarization and Q&A of audio content by specifying prompts.
  • AI_AGG: Gaining insights from audio data per group.
  • AI_EMBED: Vectorizing audio data for fuzzy searches on audio content.

Basic usage

The basic syntax of the AI_TRANSCRIBE function is as follows:

AI_TRANSCRIBE( <audio_file> [ , <options> ] )

Parameters

  • audio_file: A FILE-type object representing the audio file. Use the TO_FILE function to create a reference to a staged file.
  • options: An optional OBJECT type that can specify the following fields:
    • timestamp_granularity: Specifies the granularity of timestamps.
      • "word": Adds timestamps for each word.
      • "speaker": Adds timestamps and speaker labels per speaker.

Example 1: Simple text conversion

The simplest usage is converting an audio file to text:

-- Convert audio file to text
SELECT AI_TRANSCRIBE(
    TO_FILE('@audio_stage', 'customer_call_001.wav')
);
{
  "audio_duration": 19.08,
  "text": "すみません先日購入した商品について問い合わせがあるんですけれどもよろしいでしょうかこの商品についてパッケージが破損しておりましてこれについて交換していただきたいんですけれども可能でしょうかよろしくお願いいたします"
}

Even for an audio file of about 19 seconds, the processing time was very fast, around 2 seconds. Of course, processing time varies depending on the audio file's sampling rate and environment, but it should be usable without stress in analysis scenarios.

Example 2: Word-level timestamp conversion

For detailed analysis, you can add word-level timestamps:

-- Convert text with word-level timestamps
SELECT AI_TRANSCRIBE(
    TO_FILE('@audio_stage', 'meeting_recording.wav'),
    {'timestamp_granularity', 'word'})
);
{
  "audio_duration": 19.08,
  "segments": [
    {
      "end": 1.254,
      "start": 0.993,
      "text": "す"
    },
    {
      "end": 1.274,
      "start": 1.254,
      "text": "み"
    },
    {
      "end": 1.434,
      "start": 1.274,
      "text": "ま"
    },
    {
      "end": 1.514,
      "start": 1.434,
      "text": "せ"
    },
    {
      "end": 2.076,
      "start": 1.514,
      "text": "ん"
    },
    ...
  ],
  "text": "す み ま せ ん 先 日 購 入 し た 商 品 に つ い て 問 い 合 わ せ が あ る ん で す け れ ど も よ ろ し い で し ょ う か こ の 商 品 に つ い て パ ッ ケ ー ジ が 破 損 し て お り ま し て こ れ に つ い て 交 換 し て い た だ き た い ん で す け れ ど も 可 能 で し ょ う か よ ろ し く お 願 い い た し ま す"
}

Example 3: Speaker diarization conversion

For meetings or interviews with multiple speakers, the speaker diarization feature is useful:

-- Convert text with speaker diarization and timestamps
SELECT AI_TRANSCRIBE(
    TO_FILE('@audio_stage', 'interview_2025.mp3'),
    {'timestamp_granularity', 'speaker'})
);
{
  "audio_duration": 16.4,
  "segments": [
    {
      "end": 8.461,
      "speaker_label": "SPEAKER_00",
      "start": 0.511,
      "text": "本日はよろしくお願いします。私の名前は佐藤です。"
    },
    {
      "end": 15.153,
      "speaker_label": "SPEAKER_01",
      "start": 9.048,
      "text": "はい、よろしくお願いします。私の名前は田中です。"
    }
  ],
  "text": "本日はよろしくお願いします。私の名前は佐藤です。はい、よろしくお願いします。私の名前は田中です。"
}

Supported Languages and Formats

Supported Languages

AI_TRANSCRIBE supports the following languages:

  • Japanese
  • English
  • French
  • German
  • Spanish
  • Chinese (Mandarin)
  • Cantonese
  • Korean
  • Arabic
  • Bulgarian
  • Catalan
  • Czech
  • Dutch
  • Greek
  • Hungarian
  • Indonesian
  • Italian
  • Latvian
  • Polish
  • Portuguese
  • Romanian
  • Russian
  • Serbian
  • Slovenian
  • Swedish
  • Thai
  • Turkish
  • Ukrainian

Japanese, which many of you are likely interested in, is officially supported! In my actual testing, the recognition accuracy for Japanese audio was high, and I believe you can use it without any particular issues.

Supported Audio Formats

The following major audio formats are supported:

  • MP3: The most common audio format
  • WAV: Uncompressed high-quality audio
  • FLAC: Lossless compressed audio
  • Ogg: Open-source format
  • WebM: Web standard format

Limitations and Notes

Here are the limitations to keep in mind when using the AI_TRANSCRIBE function:

Technical Limitations

Limitation Item Details
Maximum file size 700MB
Maximum audio length (without timestamps) 120 minutes
Maximum audio length (with timestamps) 60 minutes
Concurrent processing Depends on account computing resources

Usage Notes

  • Audio quality impact: Conversion accuracy may decrease for audio with a lot of background noise or poor quality.
  • Technical term recognition: Industry-specific terminology or proper nouns may not be accurately converted.
  • Japanese word segmentation: For Japanese audio, using timestamp_granularity: 'word' results in segmentation per character rather than per word.
  • Real-time processing: Currently, only batch processing is supported; real-time streaming is not available.

Regional Availability

AI_TRANSCRIBE is currently natively available in the following regions:

  • AWS US West 2 (Oregon)
  • AWS US East 1 (N. Virginia)
  • AWS EU Central 1 (Frankfurt)
  • Azure East US 2 (Virginia)

If you are using other regions: You can still use AI_TRANSCRIBE in regions other than those listed above by using the Cross-Region Inference feature. With cross-region inference, processing is done using computing resources in a supported region, which may introduce some additional latency, but the functionality is the same.

Business Use Cases

Here are some representative business scenarios where the AI_TRANSCRIBE function shines:

1. Improving Customer Service Quality

By transcribing call center recordings with AI_TRANSCRIBE and leveraging that data, various analyses become possible.

  • Sentiment Analysis: Using the AI_SENTIMENT function to analyze customer sentiment from perspectives such as professionalism, problem resolution, and wait time.
  • Automatic Call Categorization: Automatically classifying calls into categories like complaints, inquiries, or praise using the AI_CLASSIFY function.
  • Leveraging Speaker Identification: Separating operator and customer speech to analyze the content of each in detail.
  • Real-time Feedback: Visualizing analysis results on a dashboard to enable immediate service quality improvements.

2. Automated Meeting Summarization and Action Item Extraction

Transcribe recordings of executive meetings or development scrums with AI_TRANSCRIBE to improve operational efficiency.

  • Automated Minutes Creation: Instantly capture the full text of even long meetings.
  • Summary Generation: Use the AI_COMPLETE function to automatically generate concise summaries highlighting key points.
  • Action Item Extraction: Automatically extract decisions and to-dos to streamline follow-ups.
  • Per-Participant Speech Analysis: Use speaker identification to clearly record who said what.

3. Automated Medical Consultation Note Creation

Transcribe doctor-patient consultation audio with AI_TRANSCRIBE to reduce the administrative burden in healthcare settings (privacy protection measures are mandatory).

  • Automated Clinical Note Generation: Create structured records of chief complaints, symptoms, diagnosis, and treatment plans using the AI_COMPLETE function's structured output capabilities.
  • Efficient EHR Data Entry: Automatically extract necessary information from consultation conversations to assist with electronic health record input.
  • Multilingual Support: Transcribe consultations with foreign patients into text and integrate with translation services.
  • Medical Audit Applications: Analyze the appropriateness of medical care with AI to contribute to quality improvement.

Record contract negotiations and legal conversations with AI_TRANSCRIBE to strengthen risk management.

  • Complete Recording of Negotiations: Save all contract negotiations and legal discussions as text.
  • Detection of Compliance Risks: Use the AI_CLASSIFY function to categorize conversation content by risk level (Compliant, Low Risk, Medium Risk, High Risk).
  • Evidence Preservation: Use speaker identification and timestamps to accurately record who said what and when.
  • Automated Audit Report Generation: Extract key points from conversations to automatically generate audit reports.

5. Application in Education and Training

Transcribe lectures and training recordings with AI_TRANSCRIBE to maximize learning effectiveness.

  • Archiving Course Content: Save lecture content as text for later search and reference.
  • Creating Captioned Materials: Utilize word-level timestamps to add subtitles to video materials.
  • Feedback Analysis: Analyze training session content to identify points for instructional improvement.
  • Multilingual Learning Support: Transcribe foreign language classes for easier student review.

Voice Input AI Chatbot with Streamlit in Snowflake

Leveraging the AI_TRANSCRIBE function, I created a simple sample application for a voice-input AI chatbot using Streamlit in Snowflake. This is an interactive application where users can ask questions via voice, which are then transcribed into text for the AI to generate a response. (It also supports the newly added OpenAI GPT-5!)

Application Overview

This application provides the following features:

  1. Voice Recording: Record audio directly from the browser using Streamlit's features and save it to a stage.
  2. Speech-to-Text Conversion: Transcribe the audio into text using the AI_TRANSCRIBE function.
  3. AI-Powered Response Generation: Answer the questions using the AI_COMPLETE function.

Prerequisites

To implement this application, the following conditions must be met:

Environment Requirements

  • Python Version: 3.11 or higher
  • Additional Packages: Not required (Operates with standard packages only)
  • Streamlit in Snowflake: An environment capable of creating and running apps

Region Confirmation

Ensure your region supports the AI_TRANSCRIBE and AI_COMPLETE functions. These functions are also available in non-supported regions using cross-region inference.

Implementation Steps

You can implement the application by following these steps:

1. Create a New Streamlit in Snowflake App

Click on 'Streamlit' in the left pane of Snowsight, then click the '+ Streamlit' button to create a SiS app.

2. Paste the Sample Code

Copy and paste the sample code below directly into the editor of the created app. No code modifications are required; stage names and other settings are configured automatically.

3. Run the App

After pasting the code, click the 'Run' button in the top right to start the application. The stage will be created automatically on the first run.

4. Using the App

  1. Voice Input: Click the microphone button to speak.
  2. Model Selection: Select your preferred AI model from the sidebar.
  3. Text Input: Standard chat text input is also available.

Sample Code

import streamlit as st
import io
import uuid
import json
from datetime import datetime
from snowflake.snowpark.context import get_active_session
from snowflake.snowpark.functions import ai_complete, to_file

# Get Snowflake session
session = get_active_session()

# Constants
STAGE_NAME = "AUDIO_TRANSCRIBE_STAGE"

# Page config
st.set_page_config(layout="wide")
st.title("AI Voice Chatbot")

# Sidebar: Model selection
st.sidebar.title("️ Settings")

# Model selection
model_options = [
    " ━━  OpenAI  ━━",
    "openai-gpt-oss-120b",
    "openai-gpt-oss-20b",
    "openai-gpt-5",
    "openai-gpt-5-mini",
    "openai-gpt-5-nano",
    "openai-gpt-5-chat",
    "openai-gpt-4.1",
    "openai-o4-mini",
    " ━━  Claude  ━━",
    "claude-4-opus",
    "claude-4-sonnet",
    "claude-3-7-sonnet",
    "claude-3-5-sonnet",
    " ━━  Llama  ━━",
    "llama4-maverick",
    "llama4-scout",
    "llama3.3-70b",
    "llama3.2-3b",
    "llama3.2-1b",
    "llama3.1-405b",
    "llama3.1-70b",
    "llama3.1-8b",
    "llama3-70b",
    "llama3-8b",
    " ━━  Mistral  ━━",
    "mistral-large2",
    "mistral-large",
    "mixtral-8x7b",
    "mistral-7b",
    " ━━  Snowflake  ━━",
    "snowflake-arctic",
    "snowflake-llama-3.3-70b",
    "snowflake-llama-3.1-405b",
    " ━━  Others  ━━",
    "deepseek-r1",
    "reka-core",
    "reka-flash",
    "jamba-1.5-large",
    "jamba-1.5-mini",
    "jamba-instruct",
    "gemma-7b"
]

# Default model setting
default_model = "llama4-maverick"
default_index = model_options.index(default_model) if default_model in model_options else 1

llm_model = st.sidebar.radio(
    "Select AI Model",
    options=model_options,
    index=default_index,
    format_func=lambda x: x if " ━━" in x else f"  \u2022 {x}"
)

# Use the next model if a separator is selected
if " ━━" in llm_model:
    llm_model = "llama4-maverick"

# Stage creation (if not exists)
@st.cache_resource
def setup_stage():
    """Set up stage for saving audio files"""
    try:
        session.sql(f"DESC STAGE {STAGE_NAME}").collect()
    except:
        session.sql(f"""
            CREATE STAGE IF NOT EXISTS {STAGE_NAME}
            ENCRYPTION = (TYPE = 'SNOWFLAKE_SSE')
            DIRECTORY = (ENABLE = TRUE)
        """).collect()

setup_stage()

# Initialize session state
if 'messages' not in st.session_state:
    st.session_state.messages = []
    st.session_state.chat_history = ""

def extract_text_from_transcript(transcript_result):
    """Extract text from AI_TRANSCRIBE result"""
    if isinstance(transcript_result, str) and transcript_result.startswith('{'):
        try:
            return json.loads(transcript_result).get('text', '')
        except:
            return transcript_result
    return transcript_result

def clean_ai_response(response):
    """Clean up AI response (handle extra quotes and newline characters)"""
    if isinstance(response, str):
        response = response.strip('"')
        response = response.replace('\\n', '\n')
    return response

def generate_ai_response(prompt, model):
    """Generate AI response"""
    df = session.range(1).select(
        ai_complete(model=model, prompt=prompt).alias("response")
    )
    return clean_ai_response(df.collect()[0]['RESPONSE'])

# Display chat history
for message in st.session_state.messages:
    with st.chat_message(message["role"]):
        st.markdown(message["content"])

# Voice input section
st.subheader("Voice Input")
audio_value = st.audio_input("Click the microphone button to speak")

if st.button(" Send Voice", disabled=(audio_value is None), use_container_width=True):
    if audio_value:
        try:
            # Upload audio file
            with st.spinner(" Uploading audio..."):
                audio_filename = f"audio_{datetime.now().strftime('%Y%m%d_%H%M%S')}_{uuid.uuid4().hex[:8]}.wav"
                audio_stream = io.BytesIO(audio_value.getvalue())
                session.file.put_stream(
                    audio_stream,
                    f"@{STAGE_NAME}/{audio_filename}",
                    auto_compress=False,
                    overwrite=True
                )
            
            # Transcribe
            with st.spinner(" Transcribing audio..."):
                query = f"""
                    SELECT AI_TRANSCRIBE(
                        TO_FILE('@{STAGE_NAME}/{audio_filename}')
                    ) as transcript
                """
                result = session.sql(query).collect()
            
            if result and len(result) > 0:
                transcribed_text = extract_text_from_transcript(result[0]['TRANSCRIPT'])
                
                if transcribed_text:
                    # Add user message
                    st.session_state.messages.append({"role": "user", "content": transcribed_text})
                    st.session_state.chat_history += f"User: {transcribed_text}\n"
                    
                    # Generate AI response
                    with st.spinner(" AI is generating a response..."):
                        full_prompt = st.session_state.chat_history + "AI: "
                        response = generate_ai_response(full_prompt, llm_model)
                    
                    st.session_state.messages.append({"role": "assistant", "content": response})
                    st.session_state.chat_history += f"AI: {response}\n"
                    
                    st.rerun()
                else:
                    st.warning("Transcription failed. Please try again.")
        except Exception as e:
            st.error(f"An error occurred: {str(e)}")

# Text input
if prompt := st.chat_input("Enter your message..."):
    # Add and display user message
    st.session_state.messages.append({"role": "user", "content": prompt})
    st.session_state.chat_history += f"User: {prompt}\n"
    with st.chat_message("user"):
        st.markdown(prompt)
    
    # Generate and display AI response
    try:
        with st.spinner(" AI is generating a response..."):
            full_prompt = st.session_state.chat_history + "AI: "
            response = generate_ai_response(full_prompt, llm_model)
        
        st.session_state.messages.append({"role": "assistant", "content": response})
        st.session_state.chat_history += f"AI: {response}\n"
        with st.chat_message("assistant"):
            st.markdown(response)
    except Exception as e:
        st.error(f"An error occurred: {str(e)}")

# Clear chat history
if st.button(" Clear Chat History"):
    st.session_state.messages = []
    st.session_state.chat_history = ""
    st.rerun()

Application Screens

image1

image2

Implementation Points

  • Simple Implementation: No additional package installation required; built using only standard libraries.
  • Audio File Management: Save audio data to a stage and process it with AI_TRANSCRIBE.
  • Multimodal Support: Supports both voice input and text input.
  • Extensive Model Selection: Choose from the latest models, including OpenAI GPT-5.

Cost Considerations

Billing for the AI_TRANSCRIBE function is based on token consumption, similar to other AISQL features. The specific cost structure for audio processing is as follows:

Token Consumption and Pricing

  • 50 Tokens per second of audio: Uniform regardless of language or timestamp granularity (word/speaker)
  • 1 hour of audio = 180,000 tokens
  • Approximate Cost: 1.3 credits per million tokens, assuming $3 per credit, processing 1 hour of audio costs approximately $0.117 (about 17 yen)

For example, for a 60-second audio file:

  • 60 seconds × 50 tokens = 3,000 tokens

For the latest pricing information, please refer to the Snowflake Service Consumption Table.

Summary

The AI_TRANSCRIBE function is a groundbreaking feature that opens the door to a new type of unstructured data: voice data. With support for images and documents strengthened since 2025, and now the addition of voice—the third major unstructured data type—that can be handled with SQL, Snowflake has truly evolved into a multimodal data platform.

Key Benefits

  1. Unified Data Processing: Process all data, including voice, within Snowflake end-to-end.
  2. Integration with Other AISQL Functions: Combine with a rich set of AI capabilities such as sentiment analysis, classification, summarization, and vectorization.
  3. Secure Environment: No external data movement is required, maintaining governance.
  4. Improved Development Efficiency: Build voice analysis pipelines using only SQL without introducing third-party packages.

We hope you will leverage the AI_TRANSCRIBE function in various business scenarios—such as customer service, meeting minutes, medical records, and legal audits—to unlock new business value from voice data, which has traditionally been difficult to utilize.

Promotions

Virtual Hands-on Delivered at SNOWFLAKE DISCOVER!

At the large-scale webinar for engineers, SNOWFLAKE DISCOVER Vol. 2, held on July 8-9, 2025, I delivered a practical virtual hands-on session titled "Next-Generation VoC (Voice of Customer) Analysis with Snowflake Cortex AI." This session provides insights into analyzing customer voices relevant to many industries using Snowflake's latest features. If you are looking for hints on analyzing unstructured data, we hope you will take a look!

You can register at the link below to watch it on-demand immediately.


Spoke at SNOWFLAKE DISCOVER!

At the large-scale webinar for engineers, SNOWFLAKE DISCOVER, held on April 24-25, 2025, I presented in the very first session titled "Starting from Zero with Snowflake: Building a Modern Data & AI Platform." I explained the overview of Snowflake and the latest updates in an as easy-to-understand manner as possible, so we hope you will use it to catch up!

You can register at the link below to watch it on-demand immediately.

Spoke at Generative AI Conf's Webinar!

In a webinar themed "The Platform Supporting the Generative AI Era," I, as a Snowflake employee, gave a lightning talk on the theme of Data * AI alongside NVIDIA and my former company AWS. The video archive is below, so we hope you will watch it!

https://www.youtube.com/live/no9WYeLFNaI?si=2r0TVWLkv1F5d4Gs

Delivering Snowflake What's New Updates on X

I am distributing update information on Snowflake's What's New on X. Please feel free to follow us!

Japanese Version

Snowflake What's New Bot (Japanese Version)
https://x.com/snow_new_jp

English Version

Snowflake What's New Bot (English Version)
https://x.com/snow_new_en

Change Log

(20250810) Initial post
(20250927) Updated promotional section

Discussion