Snowflake AI SQL User Guide: AI_TRANSCRIBE
Convert speech from video and audio files into accurate, queryable text using Snowflake AI_TRANSCRIBE.

Snowflake AI SQL User Guide: AI_TRANSCRIBE
What is AI_TRANSCRIBE?
AI_TRANSCRIBE is a Snowflake Cortex AI function that transcribes audio and video files stored on a Snowflake stage into text. It supports full transcription, word-level timestamps, and speaker diarization, no external services or ML pipelines required.
Listen to a quick technical breakdown of the Snowflake AI_TRANSCRIBE function. In this short 5-minute audio overview, we explore what the function does, how its parameters work, and when you would use it in real-world Snowflake workloads.
[embed]
What we’ll cover
- Basic Transcription — Get the full text from an audio/video file
- Word-Level Timestamps — Transcribe with start/end times for each word
- Speaker Diarization — Identify and label different speakers in the recording
- Batch Processing — Transcribe all audio/video files in a stage
Key takeaway: AI_TRANSCRIBE returns JSON. We’ll show both the raw JSON output and how to parse it into clean columns and rows using Snowflake’s semi-structured data features.
Setup
Before using AI_TRANSCRIBE, we need to create the database, schemas, stage, and warehouse. We’ll use the ACCOUNTADMIN role for this setup.
Create Database and Schemas
USE ROLE ACCOUNTADMIN;
CREATE DATABASE IF NOT EXISTS DEMO_AI;
CREATE SCHEMA IF NOT EXISTS DEMO_AI.RAW;
Create Warehouse
CREATE WAREHOUSE IF NOT EXISTS SUPERHERO_GEN1_XS_WH
WAREHOUSE_SIZE = 'XSMALL'
AUTO_SUSPEND = 60
AUTO_RESUME = TRUE;
Create Internal Stage
CREATE OR REPLACE STAGE DEMO_AI.RAW.STAGE_FILES
ENCRYPTION = (TYPE = 'SNOWFLAKE_SSE')
DIRECTORY = (ENABLE = TRUE)
COMMENT = 'Internal stage for audio, video, images and documents used with AI functions';
Upload Audio Files
Upload your audio and video files to the stage. For these demos we’ve create a folder in our STAGE called AUDIO and added the following recording from our Sound Cloud podcast:
Download: Sample File

AI_TRANSCRIBE supports the following formats:
- Audio: FLAC, MP3, MP4, OGG, WAV, WEBM
- Video: MKV, MP4, OGV, WEBM
Note: Video files must contain at least one audio track in FLAC, MP3, OPUS, VORBIS, or WAV format.
Maximum file size is 700 MB. Maximum duration is 120 minutes (60 minutes when using word or speaker timestamps).
Verify Audio Files
USE ROLE ACCOUNTADMIN;
USE DATABASE DEMO_AI;
USE SCHEMA RAW;
USE WAREHOUSE SUPERHERO_GEN1_XS_WH;
LIST @DEMO_AI.RAW.STAGE_FILES;
1. Basic Transcription
Basic transcription extracts the full text from an audio or video file. We pass a file reference using TO_FILE() and AI_TRANSCRIBE returns the complete transcription as JSON.
How it works:
- Use
TO_FILE('@stage', 'path')to reference the file AI_TRANSCRIBEreturns{"text": "...", "audio_duration": ...}- The
textfield contains the full transcription - The
audio_durationfield contains the length in seconds
SELECT
AI_TRANSCRIBE
(
TO_FILE('@DEMO_AI.RAW.STAGE_FILES', 'AUDIO/AI_TRANSCRIBE.m4a')
) AS OUTPUT_JSON;
Parsing Transcription JSON into Columns
The raw JSON is useful, but for reporting or downstream use, we want clean columns. We use PARSE_JSON and Snowflake's : notation to extract values.
Key pattern: OUTPUT_JSON:key_name::TYPE
:textgets the full transcription string:audio_durationgets the length in seconds::VARCHARand::FLOATcast to the desired types
SELECT
OUTPUT_JSON:text::VARCHAR AS TRANSCRIPTION,
OUTPUT_JSON:audio_duration::FLOAT AS DURATION_SECONDS
FROM
(
SELECT
AI_TRANSCRIBE
(
TO_FILE('@DEMO_AI.RAW.STAGE_FILES', 'AUDIO/AI_TRANSCRIBE.mp3')
) AS OUTPUT_JSON
);
2. Word-Level Timestamps
Word-level transcription adds precise start and end times for every word. This is useful for subtitles, search indexing, or aligning text to specific moments in the recording.
How it works:
- Pass
{'timestamp_granularity': 'word'}as the second argument - AI_TRANSCRIBE returns a
segmentsarray where each element is a word withstart,end, andtextfields
SELECT
AI_TRANSCRIBE
(
TO_FILE('@DEMO_AI.RAW.STAGE_FILES', 'AUDIO/AI_TRANSCRIBE.mp3'),
{'timestamp_granularity': 'word'}
) AS OUTPUT_JSON;
Parsing Word Timestamps into Rows
To turn the segments array into individual rows, we use LATERAL FLATTEN. Each word becomes its own row with timing information.
Key pattern:
LATERAL FLATTEN(INPUT => OUTPUT_JSON:segments) SEGMENT
- Each array element becomes a row
SEGMENT.VALUE:startgives the start timeSEGMENT.VALUE:endgives the end timeSEGMENT.VALUE:textgives the word
SELECT
SEGMENT.VALUE:start::FLOAT AS START_SECONDS,
SEGMENT.VALUE:end::FLOAT AS END_SECONDS,
SEGMENT.VALUE:text::VARCHAR AS WORD
FROM
(
SELECT
AI_TRANSCRIBE
(
TO_FILE('@DEMO_AI.RAW.STAGE_FILES', 'AUDIO/AI_TRANSCRIBE.mp3'),
{'timestamp_granularity': 'word'}
) AS OUTPUT_JSON
),
LATERAL FLATTEN(INPUT => OUTPUT_JSON:segments) SEGMENT;
3. Speaker Diarization
Speaker diarization identifies and labels different speakers in the recording. This is critical for meeting transcripts, interviews, and multi-party conversations.
How it works:
- Pass
{'timestamp_granularity': 'speaker'}as the second argument - AI_TRANSCRIBE returns a
segmentsarray where each element includes aspeaker_label,start,end, andtextfield - Speaker labels are assigned automatically (e.g.,
speaker_0,speaker_1)
SELECT
AI_TRANSCRIBE
(
TO_FILE('@DEMO_AI.RAW.STAGE_FILES', 'AUDIO/AI_TRANSCRIBE.mp3'),
{'timestamp_granularity': 'speaker'}
) AS OUTPUT_JSON;
Parsing Speaker Segments into a Table
We use LATERAL FLATTEN to produce one row per speaker segment, giving us a conversation-style table.
Key pattern:
LATERAL FLATTEN(INPUT => OUTPUT_JSON:segments) SEGMENT
SEGMENT.VALUE:speaker_labelidentifies the speakerSEGMENT.VALUE:start/:endgive the time rangeSEGMENT.VALUE:textgives what was said
SELECT
SEGMENT.VALUE:speaker_label::VARCHAR AS SPEAKER,
SEGMENT.VALUE:start::FLOAT AS START_SECONDS,
SEGMENT.VALUE:end::FLOAT AS END_SECONDS,
SEGMENT.VALUE:text::VARCHAR AS TRANSCRIPTION
FROM
(
SELECT
AI_TRANSCRIBE
(
TO_FILE('@DEMO_AI.RAW.STAGE_FILES', 'AUDIO/AI_TRANSCRIBE.mp3'),
{'timestamp_granularity': 'speaker'}
) AS OUTPUT_JSON
),
LATERAL FLATTEN(INPUT => OUTPUT_JSON:segments) SEGMENT;
4. Batch Processing
Process all audio and video files in a stage using DIRECTORY(). This is useful for bulk transcription jobs.
How it works:
- Use
DIRECTORY(@stage)to list all files - Filter by file extension (
.mp4,.mp3,.wav) - Use
TO_FILE(FILE_URL)to reference each file - AI_TRANSCRIBE processes each file in the result set
SELECT
RELATIVE_PATH,
AI_TRANSCRIBE
(
TO_FILE(FILE_URL)
) AS OUTPUT_JSON
FROM
DIRECTORY(@DEMO_AI.RAW.STAGE_FILES)
WHERE
RELATIVE_PATH ILIKE '%.mp4'
OR RELATIVE_PATH ILIKE '%.mp3'
OR RELATIVE_PATH ILIKE '%.wav';
Summary

Try:
- Combine AI_TRANSCRIBE with AI_EXTRACT to pull structured data from transcriptions
- Use speaker diarization output to build meeting summaries with AI_COMPLETE
- Store transcriptions in a table and use Cortex Search for full-text search over audio content
Next Steps
- Learn more on docs.snowflake.com
- Sign up for a Snowflake Trial
If you found this useful, follow me on LinkedIn for more Cortex AI SQL and Snowflake AI Data Cloud use cases.
메타데이터
- post_id
- 5b334a67d859
- slug
- snowflake-ai-sql-user-guide-ai-transcribe-5b334a67d859
- url
- https://medium.com/snowflake/snowflake-ai-sql-user-guide-ai-transcribe-5b334a67d859
- canonical_url
- https://medium.com/snowflake/snowflake-ai-sql-user-guide-ai-transcribe-5b334a67d859
- author_url
- https://medium.com/@douglas_day
- status
- ok
- fetched_at
- 2026-07-15 02:14:29