You are viewing an archive page. Click here to go to the current Open Exhibits website.
Log-in is disabled for the archived site
Software

Software: Modules

Templates allow novices to create their own floor or Web based exhibits. Universal Modules allow more advanced developers to combine, branch, and write their own modules that can act as building blocks for new Exhibits.

MP3 Player

MP3 Player

First Posted: December 3, 2011
v1.2.1-beta Updated: January 31, 2012

Project Summary

The MP3 Player is now GestureWorks 3 compatible!

The MP3 Player is a module designed to play MP3 audio files, show a graphical waveform representation, and display embedded ID3 or user entered metadata. MP3 files, metadata, and basic formatting can be defined using the module's XML file. Multiple touch players can be displayed on stage and each touch object can be manipulated using the TAP, DRAG, SCALE and ROTATE multitouch gestures and standard PLAY, STOP, BACK, FORWARD and PAUSE touch buttons. All multitouch gestures can be activated and deactivated using the module XML settings.

ABOUT THIS CONTRIBUTOR

Profile picture for Charles Veasey

Charles Veasey

Software Developer
Open Exhibits Staff

Total Activity:  291
Downloads:  45
Article Views:  82
Shared:  0
Tweets:  0

Uploads:  21
Comments:  143
Favorites:  0
Likes:  0
Emails:  0

There are no comments yet. Share your thoughts!




Summary

The MP3 Player is a module designed to play MP3 audio files, show a graphical waveform representation, and display embedded ID3 or user entered metadata. MP3 files, metadata, and basic formatting can be defined using the module's XML file. Multiple touch players can be displayed on stage and each touch object can be manipulated using the TAP, DRAG, SCALE and ROTATE multitouch gestures and standard PLAY, STOP, BACK, FORWARD and PAUSE touch buttons. All multitouch gestures can be activated and deactivated using the module's XML settings.

Features

  • Plays MP3 files
  • Displays graphical waveform
  • Displays ID3 or user defined metadata
  • Customizable through XML
  • Gesture activated

Example Code

Using this

package id.module
{
    import flash.events.Event;
    import id.core.TouchComponent;
    import id.component.Mp3Display;
    import id.element.Parser;

    public class Mp3Player extends TouchComponent
    {
        private var mp3Display:Mp3Display;

        public function Mp3Player()
        {
           super();
           Parser.settingsPath="Mp3Player.xml";
           Parser.addEventListener(Event.COMPLETE,onParseComplete);
        }

        private function onParseComplete(event:Event):void
        {
            mp3Display=new mp3Display();
            mp3Display.id=0;
            addChild(mp3Display);
        }
        
    }
}

Properties and Customization

Included XML tags and functions:

Name Description Notes
<AlbumText> Sets the font size and color for the album metadata field
<AuthorText> Sets the font size and color for the author metadata field
<CommentText> Sets the font size and color for the comment metadata field
<CopyrightText> Sets the font size and color for the copyright metadata field
<Source> Contains the settings for each individual player Each source must have a unique numerical id
<TitleText> Sets the font size and color for the title metadata field
<YearText> Sets the font size and color for the year metadata field
<album> Sets the album metadata field If useId3 is set to 'no', you can specify this metadata field
<amountToShow> The number of players to display Must correspond to the amount of source tags defined
<author> Sets the author metadata field If useId3 is set to 'no', you can specify this metadata field
<buttonColorActive> Sets the background color of the buttons when they are active (have been selected)
<buttonColorPassive> Sets the background color of the buttons when they aren't active (haven't been selected)
<buttonOutlineColor> Sets the color of the button outline
<buttonOutlineStroke> Sets the width of the button outline in pixels
<buttonPadding> Sets the padding in pixels on all four sides of each button
<buttonRadius> Sets the button radius in pixels. NB: Radius is one-half of total button size (diameter)
<buttonSymbolColor> Sets the color of the symbol or text on each button
<comment> Sets the comments metadata field If useId3 is set to 'no', you can specify this metadata field
<copyright> Sets the copyright metadata field If useId3 is set to 'no', you can specify this metadata field
<cornerRadius> Sets the corner radius of the menu bar
<doubleTap> Sets whether or not the doubleTap gesture can be used in the application ('true' or 'false')
<drag> Sets whether or not the drag gesture can be used in the application ('true' or 'false')
<fillColor1> Sets the color of the bar behind the control buttons. The preceding Ox ensures that the program changes hexadecimal colors to integers
<fillColor1> Sets the background color
<fillColor2> If set, the background will be a gradient of fillColor1 to this field
<flick> Sets whether or not the flick gesture can be used in the application ('true' or 'false')
<globalScale> The size the player start at before they are double-tapped or zoomed to their full size, which is the size at which the control buttons appear
<infoPadding> Sets the padding around the metadata information when the info button is selected
<loop> Loop playback ('on' or 'off', default: 'on')
<maxScale> The maximum size the player can zoom to, set relative to their full size within the application
<minScale> The minimum size the player can zoom to, set relative to their full size within the application
<outlineColor> Sets the color of the border that surrounds the button control bar
<outlineColor> Sets the color of the outline surrounding each media object
<outlineStroke> Sets the width of the border that surrounds the button control bar
<outlineStroke> Sets the width of the border around each media object in pixels
<pan> Sets the playback panning (-1.0 to 1.0, -1.0 = left, 0 = center, 1.0 = right)
<playerHeight> Sets the player's height in pixels (min: 150px, default: 150px)
<playerWidth> Sets the player's width in pixels (min: 500px, default: 500px)
<rotate> Sets whether or not the rotate gesture can be used in the application ('true' or 'false')
<scale> Sets whether or not the scale gesture can be used in the application ('true' or 'false')
<showAlbum> Show the album field ('yes' or 'no', default: 'no') Needs to be set for both ID3 and user defined metadata
<showAuthor> Show the author/artist field ('yes' or 'no', default: 'no') Needs to be set for both ID3 and user defined metadata
<showComment> Show the comment field ('yes' or 'no', default: 'no') Needs to be set for both ID3 and user defined metadata
<showCopyright> Show the copyright field ('yes' or 'no', default: 'no') Needs to be set for both ID3 and user defined metadata
<showTitle> Show the title/song name field ('yes' or 'no', default: 'no') Needs to be set for both ID3 and user defined metadata
<showWave> Draw waveform ('on' or 'off, default: 'on')
<showYear> Show the year field ('yes' or 'no', default: 'no') Needs to be set for both ID3 and user defined metadata
<timeFontSize> Sets the text size for the timecode that displays on video objects
<title> Sets the title of the audio recording If useId3 is set to 'no', you can specify this metadata field
<url> Sets the path for the mp3 file
<useId3> Show metadata from embedded ID3 container ('yes' or 'no', default: 'no')
<volume> Sets the playback volume (0.0 to 1.0, 0 = silent, 1.0 = full volume, default: 1.0) Clipping may occur if multiple files are played simultaneously at full volume
<waveColor> Sets the color of the drawn waveform in red, green, blue (default: 255, 255, 255)
<year> Sets the year metadata field If useId3 is set to 'no', you can specify this metadata field

Included AS3 Classes and customization:

Name Superclass Notes
Mp3Player TouchComponent
Name Type Description Notes
Name Description Notes
Name Description Notes

This material is based upon work supported by the National Science Foundation under Grant Number Division of Research on Learning in formal and informal settings #1010028. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the National Science Foundation.


Open Exhibits was developed by Ideum, makers of GestureWorks. Open Exhibits SDK is free for non-commercial use.

Connect
YouTube Twitter Flickr