Detailed reference of prototypes, properties and methods available in the
Javascript environment of your Helma web applications.

Fields and methods of the jala.audio package.
jala Mp3(file)
Constructs a new jala.Mp3 wrapper and parses the header data of the MP3 file. The standard fields for a tag are accessible as properties of the new object.
parameters
String, File file The mp3 file to be parsed, either as path string or as any kind of file object
methods
jala Mp3.Id3v1(mp3File)
Constructs a new Id3v1 tag from an Mp3 file
parameters
jala.Mp3 mp3File
methods
jala Mp3.Id3v2(mp3File)
Constructs a new Id3v2 tag from an Mp3 file
parameters
jala.Mp3 mp3File
methods
  • setImage(pictureType, mimeType, byteArray, desc)
Array jala. Mp3.GENRES
Array defining valid genres in ID3v1
Array jala. Mp3.MODES
Array defining mp3 modes.
Array jala. Mp3.TEXT_ENCODINGS
Array defining valid text encodings. Note: UTF-8 is valid for v2.4 only. UTF-16 with BOM doesn't work with Winamp etc - use UTF-16BE instead! The index position within the array defines the number used in the mp3 file.
Array jala. Mp3.PICTURE_TYPES
Array defining valid picture types. Note: Most image tagged files come with one picture of picture type null! The index position within the array defines the number used in the mp3 file.
Methods
jala.Mp3. getFile()
Returns a helma.File reference to the wrapped file.
jala.Mp3. getJavaObject()
Returns the underlying java object
jala.Mp3. createTag(tagClass, tagObject)
This method creates a new tag object, attaches it to the file (thereby replacing an existing tag of this type) and returns it. Type is specified using the class name in jala.Mp3.*. If a second argument is provided, its values are copied into the new tag.
parameters
Object tagClass
Object tagObject optional tag whose standard properties are copied to the new tag.
jala.Mp3. getTag(tagClass)
Returns a tag object, type is specified using the class name in jala.Mp3.*.
parameters
tagClass
jala.Mp3. hasTag(tagClass)
Tells if the file contains a certain tag, type is specified using the class name in jala.Mp3.*
parameters
tagClass
jala.Mp3. removeTag(tagClass)
Removes a tag from the file, type is specified using the class name in jala.Mp3.*
parameters
tagClass
jala.Mp3. save(outFile)
Writes changed metadata back to the source file or to a new file.
parameters
String, helma.File outFile (optional) save the modified file to a different file
returns
true on success, false if the file contains tags that cannot be saved (Id3v2_2).
jala.Mp3. getDuration()
The audio length of the file in seconds at best estimate from the file info (method returns immediately). This method calculates based on the bitrate. Therefore it has to produce wrong results for files encoded with variable bitrate (vbr). For these files parseDuration() can be used.
returns
length in seconds
see
jala.Mp3. parseDuration()
Parses the audio file to extract the precise duration of the audio. The upside is that it works fine for files with variable bitrates. The downside is that this action may take a few seconds depending on the size of the audio file.
returns
length in seconds
see
jala.Mp3. getSize()
Returns the file size in bytes.
jala.Mp3. getBitRate()
Returns the bit rate the file was encoded with.
jala.Mp3. getChannelMode()
Returns the channel mode the file was encoded with.
jala.Mp3. getFrequency()
Returns the frequency the file was encoded with.
jala.Mp3. isVariableBitRate()
Returns true if the file is (or seems to be) encoded with variable bit rate. FIXME: The current implementation returned true for all test files.
jala.Mp3. createV1Tag(tagObject)
If the file doesn't contain an ID3v1 tag, this method creates a new ID3v1 tag object, attaches it to the file and returns it. If a second argument is provided, its values are copied into the new tag.
parameters
Object tagObject optional tag whose standard properties are copied to the new tag.
jala.Mp3. createV2Tag(tagObject)
If the file doesn't contain an ID3v2 tag, this method creates a new ID3v2 tag object, attaches it to the file and returns it. If a second argument is provided, its values are copied into the new tag.
parameters
Object tagObject optional tag whose standard properties are copied to the new tag.
jala.Mp3. getV1Tag()
jala.Mp3. getV2Tag()
jala.Mp3. hasV1Tag()
Returns true if the file contains a ID3v1 tag.
jala.Mp3. hasV2Tag()
Returns true if the file contains a ID3v2 tag.
jala.Mp3. removeV1Tag()
Removes the ID3v1 tag from the file.
jala.Mp3. removeV2Tag()
Removes the ID3v2 tag from the file.
jala.Mp3. getMetadata()
Returns a plain JavaScript object containing the values of all fields stored in either the Id3 V1 or V2 tag
returns
An object containing the values of all fields
jala.Mp3. setMetadata(metadata)
Stores the metadata passed as argument in the ID2 v1 and v2 tags of the wrapped MP3 file.
parameters
Object metadata An object containing the fields to set and their values.
jala.Mp3.Id3v1. getAudio()
Returns the wrapper for the underlying audio file.
jala.Mp3.Id3v1. getJavaObject()
Returns the java representation of the tag, class depends on the actual library used.
jala.Mp3.Id3v1. copyFrom(src)
Copies standard fields from another tag.
parameters
Object src object with getter methods for fields album, artist, comment, title, trackNumber, genre and year.
jala.Mp3.Id3v1. getAlbum()
Returns the album information of the tag.
returns
string containing album name
jala.Mp3.Id3v1. getArtist()
Returns the artist information of the tag.
returns
string containing artist name
jala.Mp3.Id3v1. getComment()
Returns the comment information of the tag.
returns
string containing comment
jala.Mp3.Id3v1. getTitle()
Returns the title information of the tag.
returns
string containing title
jala.Mp3.Id3v1. getTrackNumber()
Returns the track number information of the tag.
returns
string representing track number or null if tag doesn't contain a track number.
jala.Mp3.Id3v1. getGenre()
Returns the genre information of the tag.
returns
string containing genre name
jala.Mp3.Id3v1. getYear()
Returns the year information of the tag.
returns
string representing year
jala.Mp3.Id3v1. getTextContent(id)
This method could be used to retrieve an arbitrary field of the underlying tag. For Id3v1 tags all information is available through getter and setter methods, so this implementation always returns null.
parameters
String id
returns
null
jala.Mp3.Id3v1. setAlbum(album)
Sets the album information.
parameters
String album
jala.Mp3.Id3v1. setArtist(artist)
Sets the artist information.
parameters
String artist
jala.Mp3.Id3v1. setComment(comment)
Sets the comment
parameters
String comment
jala.Mp3.Id3v1. setTitle(title)
Sets the title information
parameters
String title
jala.Mp3.Id3v1. setTrackNumber(trackNumber)
Sets the track number information.
parameters
Number trackNumber
jala.Mp3.Id3v1. setGenre(genre)
Sets the genre information. A list of genre names that are valid for ID3v1 tags is located in jala.Mp3.GENRES.
parameters
String genre
jala.Mp3.Id3v1. setYear(year)
Sets the year information.
parameters
Number year
jala.Mp3.Id3v1. setTextContent(id, value)
This method could be used to set an arbitrary field of the underlying tag. For Id3v1 tags all information is available through getter and setter methods, so this implementation does nothing.
parameters
String id
String value
jala.Mp3.Id3v2. getAudio()
Returns the wrapper for the underlying audio file.
jala.Mp3.Id3v2. getJavaObject()
returns the java representation of the tag, class depends on the actual library used.
jala.Mp3.Id3v2. removeFromAudio()
Removes the tag from the audio file and nulls out the wrapper.
jala.Mp3.Id3v2. setTextEncoding(encType)
sets the text encoding used when creating new frames (the encoding type of old frames can't be changed with JavaMusicTag)
parameters
Number, String encType the new encoding type as number or string
see
jala.Mp3.Id3v2. getTextEncoding()
Returns the text encoding used when setting values.
returns
The text encoding
jala.Mp3.Id3v2. copyFrom(src)
Copies standard fields from another tag.
parameters
Object src object with getter methods for fields album, artist, comment, title, trackNumber, genre and year.
jala.Mp3.Id3v2. getTextContent(id)
This method can be used to retrieve an arbitrary text frame of the underlying tag. For the list of valid identifiers and their meaning see http://www.id3.org/ The identifiers vary across the sub versions of id3v2 tags, use getSubtype to make sure you use the correct version.
parameters
String id Frame identifier according to Id3v2 specification or shortcut as defined in jala.Mp3.FIELD_MAPPING.
returns
String contained in the frame
see
jala.Mp3.Id3v2. setTextContent(id, value)
This method can be used to set an arbitrary field of the underlying tag. For the list of valid identifiers and their meaning see http://www.id3.org/ The identifiers vary across the sub versions of id3v2 tags, use getSubtype to make sure you use the correct version.
parameters
String id Frame identifier according to Id3v2 specification
String value
see
jala.Mp3.Id3v2. getSubtype()
Returns the version number of this id3v2 (values 2 to 4 for id3v2.2 to id3v2.4)
returns
The version number of this Id3v2 tag
jala.Mp3.Id3v2. getAlbum()
Returns the album information of the tag.
returns
string containing album name
jala.Mp3.Id3v2. getArtist()
Returns the artist information of the tag.
returns
string containing artist name
jala.Mp3.Id3v2. getComment()
Returns the comment information of the tag.
returns
string containing comment
jala.Mp3.Id3v2. getTitle()
Returns the title information of the tag.
returns
string containing title
jala.Mp3.Id3v2. getSubtitle()
Returns the subtitle information of the tag.
returns
string containing subtitle
jala.Mp3.Id3v2. getTrackNumber()
Returns the track number information of the tag.
returns
string representing track number
jala.Mp3.Id3v2. getGenre()
Returns the genre information of the tag.
returns
string containing genre name
jala.Mp3.Id3v2. getYear()
Returns the year information of the tag.
returns
string representing year
jala.Mp3.Id3v2. getAuthor()
Returns the author information of the tag.
returns
string containing author information
jala.Mp3.Id3v2. getCopyright()
Returns the copyright information of the tag.
returns
The copyright information of the tag
jala.Mp3.Id3v2. getUrl()
Returns the Url stored in this tag
returns
The url stored in this tag
jala.Mp3.Id3v2. setAlbum(album)
Sets the album information.
parameters
String album
jala.Mp3.Id3v2. setArtist(artist)
Sets the artist information.
parameters
String artist
jala.Mp3.Id3v2. setComment(comment)
Sets the comment
parameters
String comment
jala.Mp3.Id3v2. setTitle(title)
Sets the title information
parameters
String title
jala.Mp3.Id3v2. setSubtitle(title)
Sets the subtitle information
parameters
String title
jala.Mp3.Id3v2. setTrackNumber(trackNumber)
Sets the track number information.
parameters
Number trackNumber
jala.Mp3.Id3v2. setGenre(genre)
Sets the genre information. A list of genre names that are compatible with ID3v1 tags is located in jala.Mp3.GENRES.
parameters
String genre
jala.Mp3.Id3v2. setYear(year)
Sets the year information.
parameters
Number year
jala.Mp3.Id3v2. setAuthor(author)
Sets the author information in this tag
parameters
String author The author information to set
jala.Mp3.Id3v2. setCopyright(copyright)
Sets the copyright information in this tag
parameters
String copyright The copyright information to set
jala.Mp3.Id3v2. setUrl(url, desc)
Stores the Url passed as argument in this tag.
parameters
String url The url to store in this tag
String desc An optiona description of the Url
jala.Mp3.Id3v2. getImage(pictureType)
Extracts the image from the tag
parameters
String pictureType number describing picture type (default is 3, describing a front cover).
returns
image as mime object
jala.Mp3.Id3v2. setImage(pictureType, mimeType, byteArray, desc)
adds an image to the file.
parameters
Number pictureType number determining picture type
String mimeType mime type of image
Array byteArray image binary data
String desc optional description
see
Fri, 05 Feb 2010 17:40:07 GMT.

core framework

optional modules

java libraries

properties files