Windows Media Player Script Commands

Script commands provide a simple and powerful way to synchronize and control Web pages with Microsoft Windows Media files and live streams. By using script commands with an embedded Microsoft Windows Media Player ActiveX control and plug-in, you can create rich multimedia. This shows you how to use script command functionality in Web pages without using javascript or vbscript. Script commands are stored in the header of wma / asf and wmv files.

There are different ways to add closed captions or subtitles to a Windows Media Audio or Video (wma/wmv/asf) file. The simplest way is to associate the media file with the Sami smi captions file, and place it in the same directory as the media file. Make sure that the names match exactly and that the extension of the captions file is “.smi”. No extra software is needed to create Sami .smi captions, you can simply use Notepad or your favorite html editor. Opera, Mozilla Firefox, Safari and SeaMonkey need Windows Media Player plugin for using script commands.

You can add script commands to encoded media using Microsoft Expression Encoder. Microsoft Expression Encoder can import a script file in the formats  .xml, .sami, .smi, or .dxfp and add script commands to the imported commands. Or, without importing a script file, you can manually add the script commands to the file. All your imported and added script commands appear in separate rows underneath the Timeline, and aligned with the time that they were implemented so that you can easily distinguish your script events from your other Timeline markers. When you are ready to encode, you can choose to either embed these commands in the header or insert them into the stream.

You can also add script commands to encoded media using Windows Media Encoder 9.
Windows Media Encoder can only import header file in the format xml and ext. is .txt
To save changes use Select File > Save As and Index

In both types Sami .smi and wma header commands can html elements or plain text be used.
Some times is it best to use plain text and not use any styling at all.
The Script Commands category for displaying text is caption and text.
Sami .smi use text and in windows media header should caption be used.
In Windows Media Player, you will have to enable the Lyrics, Captions, and Subtitles feature.
You find information about this in Windows Media Player Help.
Sample using script commands in header :

Sample using script commands in Sami .smi external file :

How To Add Captions using Windows Media Encoder 9

Start (launch) Windows Media File Editor from the programs menu, if you doesn't find it,
 usually in : C:\Program Files (x86)\Windows Media Components\Encoder
Find the file wmeditor.exe and double-click it to launch the utility.

Select File > Open and select your Windows Media audio File (wma)
Now can you add captions to your media file and use caption as type command.
Or you can import captions by using menu File > Import header file and select the importname.txt

Windows Media File Editor


Import media header file
 

Script commands
 

Save as indexed
 

How To Add Captions using Microsoft Expression Encoder

Start (launch) Microsoft Expression Encoder from the programs menu.
Select a new Transcoding Project
 

Select menu File > Import to load your Windows Media audio file

 

From the Script Commands panel click Import and select the LRC or SMI captions file

 

Each caption line shows up in the Script Commands panel.
You can edit the text in the captions, adjust the timing, or insert/delete caption.

 

 

Create or edit Sami .smi in any html editor

 
 

Windows Media Player Settings to enable script commands

For captions to show up in Windows Media Player, navigate to Tools > Options > Security
 Check mark the box "Run script commands when present".
 Check mark the box “Show local captions when present”.
 Check mark the box "Run script command and rich media streams when the player is in a web page”.
  

You also need to right-click over the video window and enable Lyrics, captions, and subtitles   


 

Small Sync Editor

I have given it a try to write an not so avanced script commands editor too
I didn't use much time on the Editor so don't expect much.
Small Sync Editor imports wma header, lrc and smi.
Saves lrc, smi, and add wma script commands to header if source is wma or asf.   

Import is done by right click in the caption list (rows) for menu to show up.
Select Import from the popup menu.
  

You can edit the text in the captions, adjust the timing, or insert/delete caption.
  

It is also best to set the settings to convert vma and mp3 to wav file.
  

Save as wma or asf if source is wma or asf, or lrc or smi.
 

I have not created a installer for this, you will have to unzip the zip file to a folder and run the exe.

Download Small Sync Editor



 Goback to lyrics