*graj* - Bash script by Krzysztof Zurek,
See: https://zurek.xyz

 This program is free for non commercial use only
                   OR
   You've bought the license for this!

   
This script drives SoX player and allow to play audio files and subsets of files
from playlists and directories in any order!
Supported formats are: wav, aiff, flac, mp3, ogg and text lists like m3u and cue
- no matter under what operating system were created. 



INSTALLATION:
Copy *graj* script to eg. /usr/local/bin.
It is important to copy this script into some place included in PATH
environment variable!



CONFIGURATION:
If you use default ALSA sound device - nothing is needed to configure script
and you can start using it. Otherwise create ~/.graj.cfg configuration file
(or /etc/graj.cfg for all users)
and write sound system and sound device definitions into it - eg.
for 4 Front Technologies OSS drivers and the 2'nd sound device wanted to play:
DRV=oss         
DEV=/dev/dsp1

For SoX verbose mode define VBS variable:
VBS=2

Define REK=on if you want to play files recursively from subdirectories.

There is example config file in config/ directory - edit it as you need.   



USAGE:
graj[ obj[ nums]| nums][ obj[ nums]| nums][ obj[ nums]| nums]...
 
where:
 'obj' is directory or playlist/audio file or variable fron ~/.graj.cfg config file,
 'nums' are sets of numbers corresponding to audio files from directory/playlist type of 'obj' eg.
  2, 3-8, 1 0-2, 3 3 0 1-0, etc. 
 
or with single option:
 -h to print help
 -v to print version

Examples:
To play all files in current directory simply type command:
graj

To play 7'th, 2'nd, 3'th and 4'th file from list1.m3u
and next whole list2.m3u reverse order:
graj list1.m3u 7 2-4 list2.m3u 0-1

To play song.wav twice - the 2'nd play on other sound device:
graj song.wav DEV=hw:2,0 song.wav


Integration with Midnight Commander:
Very popular manager is able to play graj script's supported files by hitting ENTER or mouse (double) clicking!
It requires proper entries in Midnight Commander's configuration file (eg. ~/.config/mc/mc.ext in Slackware Linux).
Put them these lines below:
regex/i/\.(wav|aiff|flac|mp3|ogg|m3u|cue)$
	Open=/usr/local/bin/graj %p

and comment original lines if needed,
or use config/mc.ext config file from my computer.
	
	
LINKS:

SoX home page: sox.sourceforge.net  
GNU Bash home page: www.gnu.org/software/bash
