Skip to content

Lightweight Audio Library in Batch Script, without external exes

License

Notifications You must be signed in to change notification settings

thelowsunoverthemoon/parsnip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lightweight Audio Library for Batch Script

Features

  • Simple to include, just copy & paste!
  • Relatively fast, with a simple macro interface
  • Supports many audio file types : mp3, wma, wav (see here for full)
  • Supports stop, play, play num, pause, volume, skip, rewind, crescendo, decrescrendo
  • Audio is contained within the Batch file (closing it stops the audio)
  • Does not get slower with more tracks
  • No external exes, contained within a single batch file
  • Works out-of-the-box with Windows 2000 (on NTFS file system) and up

Usage

parsnip is fit for audio manipulation for various Batch scripts (like music players), especially games such as text adventures or turn based games. Look at the examples to see optimal ways to use it. The simple macro interface is made to be intuitive and simple to use. For example, to play a piece of music looping at full volume

%PARSNIP_MAKE% music "OrationOfRuin.mp3" loop 100
%PARSNIP_PLAY: # = music%

Documentation

Visit the documentation here!

Examples

Look at the examples here!

How does it work?

parsnip uses the Windows Media Player object to manipulate audio from embedded VBScript. Embedding VBScript in Batch script is detailed here - the gist is that we can call CSCRIPT on the batch file itself (interpreting as a WSF file) to run scripts, which, in our case, is a single audio script. Embedding this way brings lots of benefits, such as working out-of-the-box and also having the audio contained in the Batch file process. Once we create a process, then we communicate using alternate data streams (ADS, only on NTFS file systems).This way, we can start a new VBScript process for each audio, and associate it with a particular data stream, meaning it's all asynchronous, so performance does not slow down with more tracks.

About

Lightweight Audio Library in Batch Script, without external exes

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published