for Version 1.64 -- see http://lacinato.com/webabx for the latest.
There are several options you can specify in the <div> tag to control the type of player that is created and its appearance. (They are all prefixed with "data-" -- this is an artifact of HTML; they don't necessarily have anything to do with data.)
You may optionally use an XML file to specify the list of audio files to be compared. This has several advantages:
You can tag your files any way you like, with any number of tags that can be set to any number of values.
For example, you may have a large collection of recordings of guitar, mandolin, and piano, recorded with various mics at various distances. Let's choose three menu tags: source, mic, and distance. "source" might be "guitar", "mandolin", or "piano". "mic" could be "AKG C535", "CAD VX2", or "Homemade Electret". "distance" might be "6 inches", "2 feet", or "10 feet".
The player will create a filter panel that has three drop-down menus: "source", "mic", and "distance". As the user selects values from those menus, the filter results are updated dynamically. The user can then add the resulting files to their comparison. So if a user wants to compare an AKG C535 on mandolin from various distances, they can select "AKG C535" and "mandolin" (and "any" for the distance) and add all the resulting files to the comparison. If, instead, they want to compare different mics on mandolin from 2 feet away, they can choose "mandolin" and "2 feet" (and "any" for the mic) and add those files.
The HTML would look like this:
<link rel="stylesheet" type="text/css" href="/path/to/webabx.css">
<script src="/path/to/webabx.js" type="text/javascript"></script>
<div class="webabx" id="mywebabxdemo"
data-comparison-type="compare"
data-file-set-xml="path/to/myfile.xml"
</div>
The XMl file would be structured like this:
<?xml version="1.0" encoding="iso-8859-1"?>The mandatory file specification tags indicate the audio files to be compared. They look like this:
<file path="path/to/your/file.wav"
path2="optional/path/to/fallback/file.mp3"
name="Human-Readable Name of File"
optionaltag="Optional Tag Value"
anotheroptionaltag="Another Optional Tag Value"
.
.
.
/>
The optional menu tags are structured like this:
<menu id="mymenuid" default="defaultmenuvalue">Human-Readable Menu Name</menu>
...if you specify the optional "default" value, it will be selected in the filter box when the player loads. If you do not, the default "(any)" item will be selected.
PLEASE NOTE: the values of the file tags must match each other EXACTLY (case insensitive) or extraneous items will be created. E.g. "AKG C535" and "AKG C 535" will be interpreted as two separate tag values. (Similarly, the menus that you create must match the names in the file tags exactly.) Watch for typos: the player will not be forgiving. :-)
Following our guitar/mandolin/piano example above, the XML file might look like this (only two <file> tags are shown; there would actually be 27 of them: one for each permutation of guitar/mic/distance):
<?xml version="1.0" encoding="iso-8859-1"?>
<webabx_fileset>
<menu id="audiosource" default="Guitar">Audio Source</menu>
<menu id="mic">Mic</menu>
<menu id="distance" default="">2 feet</menu>
<file path="abx/audiofiles/guitar-535-6inches.mp3"
name="Guitar - AKG C535 - 6 inches"
audiosource="Guitar"
mic="AKG C535"
distance="6 inches"
/>
<file path="abx/audiofiles/guitar-535-2feet.mp3"
name="Guitar - AKG C535 - 2 feet"
audiosource="Guitar"
mic="AKG C535"
distance="2 feet"
/>
...(25 more file tags here)...
</webabx_fileset>
You can also specify preview images in the XML file. These can show the user an image representing what they are listening to, and to provide more information (via a caption). These images are associated with the tags under a given menu. E.g. for the example above, you can specify an image for audio source (a guitar, a mandolin, and a piano), an image for each mic, and an image representing the different distances. You only have to provide images for the values you wish to represent with an image. If you leave any out, the player will simply not show an image. You can also optionally supply a caption (in plain text, no HTML codes) for each image.
To do this, create an additional <div> structure somewhere in your HTML to house the images: one for each menu that will be showing images. The <div> id is set to {abx_id}_{menu_id}_preview_image. Following our example above, that would be webabxdemo_audiosource_preview_image for the images associated with the audio source menu, and so on:
<div class="webabx_preview_image_wrap" id="mywebabxdemo_audiosource_preview_image">
<div class="webabx_preview_image"></div>
<div class="webabx_preview_image_caption"></div>
</div>
<div class="webabx_preview_image_wrap" id="mywebabxdemo_mic_preview_image">
<div class="webabx_preview_image"></div>
<div class="webabx_preview_image_caption"></div>
</div>
<div class="webabx_preview_image_wrap" id="mywebabxdemo_distance_preview_image">
<div class="webabx_preview_image"></div>
<div class="webabx_preview_image_caption"></div>
</div>
You can style those divs however you like (webabx.css only does a very basic styling of them), and you can add additional divs inside or outside of them, etc, but note that the player will search for and use the first div in the document whose id matches the expected id.
In the XML file, you specifty the paths for all the images associated with the images. Again, make sure all the ids and tag names and menu names match exactly. You add <menuimages> tags within the <webabx_filest> tag; they look like this:
<menuimages id="audiosource">
<menuimage key="Guitar" value="path/to/preview_images/guitar.jpg" />
<menuimage key="Mandolin" value="path/to/preview_images/mandolin.jpg">This is the caption for the Mandolin image.</menuimage>
<menuimage key="Piano" value="path/to/preview_images/piano.jpg">This is the caption for the Piano image.</menuimage>
</menuimages>
<menuimages id="mic">
<menuimage key="AKG C535" value="path/to/preview_images/c535.jpg" />
<menuimage key="CAD VX2" value="path/to/preview_images/vx2.jpg" />
<menuimage key="Homemade Electret" value="path/to/preview_images/electret.jpg" />
</menuimages>
<menuimages id="distance">
<menuimage key="6 inches" value="path/to/preview_images/c535.jpg" />
<menuimage key="2 feet" value="path/to/preview_images/vx2.jpg" />
<menuimage key="10 feet" value="path/to/preview_images/electret.jpg" />
</menuimages>
Now, when the player is created, it will now use those preview images and captions whenever the user hovers over the relevant rows.
There are a few options that are only relevant when using the XML file:
Caching-related options:
If you're having trouble with caching, turn one or both of those on and see if it helps. Again, you may end up needing to change the XML file name. Your browser may have a facility to disable this caching; might be worth a check if you are testing many changes to the XML.
Copyright 2015, 2016, 2017, 2020 Casey Connor, All Rights Reserved.
This SOFTWARE PRODUCT is provided by THE PROVIDER "as is" and "with all faults." THE PROVIDER makes no representations or warranties of any kind concerning the safety, suitability, lack of viruses, inaccuracies, typographical errors, or other harmful components of this SOFTWARE PRODUCT. There are inherent dangers in the use of any software, and you are solely responsible for determining whether this SOFTWARE PRODUCT is compatible with your equipment and other software installed on your equipment. You are also solely responsible for the protection of your equipment and backup of your data, and THE PROVIDER will not be liable for any damages you may suffer in connection with using, modifying, or distributing this SOFTWARE PRODUCT.
Please see http://lacinato.com/webabx for licensing costs and related information.