Invest In Crypto News
  • Home
  • Latest News
    • Bitcoin News
    • Altcoin News
    • Ethereum News
    • Blockchain News
    • Doge News
    • NFT News
    • Video
    • Market Analysis
    • Business
    • Finance
    • Politics
    • Mining
    • Regulation
    • Technology
  • Top 10 Cryptos
  • Market Cap List
  • IC DAO
  • Donations
  • Contact
  • Buy Crypto
  • BLOG
No Result
View All Result
Invest In Crypto News
  • Home
  • Latest News
    • Bitcoin News
    • Altcoin News
    • Ethereum News
    • Blockchain News
    • Doge News
    • NFT News
    • Video
    • Market Analysis
    • Business
    • Finance
    • Politics
    • Mining
    • Regulation
    • Technology
  • Top 10 Cryptos
  • Market Cap List
  • IC DAO
  • Donations
  • Contact
  • Buy Crypto
  • BLOG
No Result
View All Result
Invest In Crypto News
No Result
View All Result

Creating SRT Files for Videos Using Node.js: A Comprehensive Guide

CryptoExpert by CryptoExpert
June 18, 2024
in Blockchain News
0
Pyth Network Integrates Price Oracles with IOTA EVM
  • Facebook
  • Twitter
  • Pinterest


You might also like

Kakao Pay, KakaoBank Explore Stablecoins With Fireblocks

European Central Bank Connects Tokenized Assets to Central Bank Money – Bitcoin News

PLTR Price Prediction: AI Sovereignty Premium Meets a Valuation Ceiling — $195 or $165 in 30 Days?






Creating SRT subtitle files for videos is a crucial task for improving accessibility and user engagement. According to AssemblyAI, this can be efficiently achieved using Node.js and the AssemblyAI API. This guide walks through the process step-by-step.

Step 1: Set up Your Development Environment

To begin, ensure you have Node.js 18 or higher installed on your system. Create a new project folder and initialize a Node.js project:

mkdir srt-subtitles
cd srt-subtitles
npm init -y

Open the package.json file and add type: “module”, to use the ES Module syntax. Next, install the AssemblyAI JavaScript SDK:

Phemex

npm install –save assemblyai

Obtain an AssemblyAI API key from your dashboard and set it as an environment variable:

# Mac/Linux:
export ASSEMBLYAI_API_KEY=<YOUR_KEY>

# Windows:
set ASSEMBLYAI_API_KEY=<YOUR_KEY>

Step 2: Transcribe Your Video

With the environment set up, you can start transcribing your video files. Use a publicly accessible video URL or specify local files. Create a file called index.js and add the following code:

import { AssemblyAI } from ‘assemblyai’;

const client = new AssemblyAI({ apiKey: process.env.ASSEMBLYAI_API_KEY });

const transcript = await client.transcripts.transcribe({
audio: “https://storage.googleapis.com/aai-web-samples/aai-overview.mp4”,
});

Check for errors and log them:

if (transcript.status === “error”) {
throw new Error(transcript.error);
}

Step 3: Generate SRT File

After obtaining the transcript, generate the subtitles in SRT format. Import the necessary module to save the file to disk:

import { writeFile } from “fs/promises”;

Then, generate the SRT subtitles and save them:

const srt = await client.transcripts.subtitles(transcript.id, “srt”);
await writeFile(“./subtitles.srt”, srt);

You can customize the captions by specifying the chars_per_caption parameter:

const srt = await client.transcripts.subtitles(transcript.id, “srt”, 32);
await writeFile(“./subtitles.srt”, srt);

Step 4: Run the Script

Finally, run the script to generate the subtitles:

node index.js

After a few seconds, a new file subtitles.srt will appear on disk, containing the generated subtitles.

Next Steps

Now that you have your subtitle file, you can upload it to YouTube Studio or configure it in your video player. AssemblyAI also offers various tools to enhance your audio and video applications, which can be explored through their blog and documentation.

Image source: Shutterstock



Source link

  • Facebook
  • Twitter
  • Pinterest
CryptoExpert

CryptoExpert

Recommended For You

Kakao Pay, KakaoBank Explore Stablecoins With Fireblocks

by CryptoExpert
September 22, 2026
0
Cointelegraph

South Korean financial companies Kakao Pay and KakaoBank have signed a memorandum of understanding (MoU) with crypto infrastructure provider Fireblocks to explore digital asset opportunities, including stablecoins. Under the...

Read more

European Central Bank Connects Tokenized Assets to Central Bank Money – Bitcoin News

by CryptoExpert
September 22, 2026
0
European Central Bank Connects Tokenized Assets to Central Bank Money – Bitcoin News

Key TakeawaysECB launched Pontes on Sept. 21, linking tokenized assets to central-bank settlement.The platform could accelerate institutional tokenization by bridging DLT markets with TARGET.The ECB will expand Pontes...

Read more

PLTR Price Prediction: AI Sovereignty Premium Meets a Valuation Ceiling — $195 or $165 in 30 Days?

by CryptoExpert
September 21, 2026
0
PLTR Price Prediction: Blowout Earnings Meet Overbought Technicals — Brace for a $165–$195 Decision Point

James Ding Sep 21, 2026 13:07 PLTR is trading at $179.07, pinned just below immediate resistance at $179.97, with momentum flattening after a historic...

Read more

ZetaChain Holders Approve L1 Shutdown Plan, Solana Migration

by CryptoExpert
September 21, 2026
0
Cointelegraph

ZetaChain tokenholders have approved a plan to wind down the project’s layer-1 blockchain and migrate its native ZETA token to Solana. Governance proposal 68 passed Sunday with 99.4% support...

Read more

COIN Price Prediction: Squeezed Against the Ceiling — Bull Run or Bull Trap at $192?

by CryptoExpert
September 21, 2026
0
COIN Price Prediction: Squeezed Against the Ceiling — Bull Run or Bull Trap at $192?

James Ding Sep 20, 2026 13:05 Coinbase Global (COIN) is trading at $192.90, pressed hard against its upper Bollinger Band with MACD momentum exhausted...

Read more
Next Post
Donald Trump Coin Solana

Is Trump Behind The New DJT Memecoin On Solana? What We Know

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Browse by Category

  • Altcoin News
  • Bitcoin News
  • Blockchain News
  • Business
  • Doge News
  • Ethereum News
  • Finance
  • Market Analysis
  • Mining
  • NFT News
  • Politics
  • Regulation
  • Technology
  • Trending Cryptos
  • Video

Sitemap

  • Market Cap
  • Donations
  • Trading
  • Mining
  • Contact

Legal Information

  • Privacy Policy
  • Anti-Spam Policy
  • Copyright Notice
  • DMCA Compliance
  • Social Media Disclaimer
  • Terms Of Service

Categories

  • Altcoin News
  • Bitcoin News
  • Blockchain News
  • Business
  • Doge News
  • Ethereum News
  • Finance
  • Market Analysis
  • Mining
  • NFT News
  • Politics
  • Regulation
  • Technology
  • Trending Cryptos
  • Video

© Copyright 2024 InvestInCryptoNews.com

No Result
View All Result
  • Home
  • Latest News
    • Bitcoin News
    • Altcoin News
    • Ethereum News
    • Blockchain News
    • Doge News
    • NFT News
    • Video
    • Market Analysis
    • Business
    • Finance
    • Politics
    • Mining
    • Regulation
    • Technology
  • Top 10 Cryptos
  • Market Cap List
  • IC DAO
  • Donations
  • Contact
  • Buy Crypto
  • BLOG

© Copyright 2024 InvestInCryptoNews.com

This website is using cookies to improve the user-friendliness. You agree by using the website further.

Privacy policy
bitcoin
Bitcoin (BTC) $ 86,275.00
ethereum
Ethereum (ETH) $ 2,744.88
tether
Tether (USDT) $ 0.999875
bnb
BNB (BNB) $ 787.90
xrp
XRP (XRP) $ 1.57
usd-coin
USDC (USDC) $ 0.999921
solana
Solana (SOL) $ 117.14
tron
TRON (TRX) $ 0.341495
staked-ether
Lido Staked Ether (STETH) $ 2,265.05
zcash
Zcash (ZEC) $ 1,546.29

Pin It on Pinterest

Are you sure want to unlock this post?
Unlock left : 0
Are you sure want to cancel subscription?