MIDP: Music and Sound

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    MIDP: Music and Sound - Presentation Transcript

    1. MIDP: Music and Sound Jussi Pohjolainen TAMK University of Applied Sciences
    2. Sound and Music, the Basics
      • MIDP 2.0 includes basic audio capabilities
      • Media API in MIDP 2.0 is a subset of the MMAPI (Mobile Media API).
        • MMAPI: http://jcp.org/en/jsr/detail?id=135
      • Subset of the MMAPI that is included in MIDP 2.0 is called Audio Building Block (ABB).
        • Features: Playing simple tones and sampled audio
      • Media API can also be used as playing all kinds of media, for example movies.
    3. MIDP 2.0 Media Concepts
      • Audio data comes in variety of content types.
      • Content type = file format!
        • MP3, AIFF, WAF etc.
      • Content types are specified using MIME types, which use a string to specify a 1) primary and 2) secondary type.
        • Example: "audio/x-wav"
      • Content type tells how to translate bits into sound.
    4. Different content types
      • Wave audio files:
        • audio/x-wav
      • AU audio files:
        • audio/basic
      • MP3 audio files:
        • audio/mpeg
      • MIDI files:
        • audio/midi
      • http://www.iana.org/assignments/media-types/
    5. Audio Data Path Audio Data DataSource Player [ speaker ] For example: applause.wav Handles transporting the data to the player Interface in javax.microedition. media
    6. Relationship between classes DataSource Player Manager Control Controllers can control tone and volume Manager creates a player with certain content types and protocols creates
    7. Supported Content Types and Protocols
      • MIDP 2.0 spec: if sampled audio is supported at all, then 8-bit PCM WAV must be supported.
        • WAV is guaranteed.. your mobile phone can support other content types, for example mp3.
      • It is possible to ask (runtime) from Manager which content types and protocols it can handle.
      • Protocol, for example: http, file, capture .
    8. Manager-class
      • javac.microedition.media.Manager is the access point for obtaining system dependent resources such as Players for multimedia processing.
      • A Player is an object used to control and render media that is specific to the content type of the data.
      • Manager provides access to an implementation specific mechanism for constructing Players.
      • For convenience, Manager also provides a simplified method to generate simple tones .
    9. Supported Protocols and Content types
      • To find out at runtime what content types and protocols are supported:
        • Manager -class
          • public static String[] getSupportedContentTypes(String protocol)
          • public static String[] getSupportedProtocols(String content_type)
      • See example: MediaInformationMIDlet.java
    10. Player Life Cycle
      • Player has detailed life cycle
      • Life cycle has states:
        • UNREALIZED
          • Player is created, but it hasn't tried to find audio data.
        • REALIZED
          • Media data is located.
        • PREFETCHED
          • Audio data is fetched and ready to go
        • STARTED
          • Audio data is playing
        • CLOSED
          • All resources are released
    11. Player States
    12. Creating a Player
      • Player is created using by Manager class
        • public static Player createPlayer(InputStream stream, String type)
      • Example
        • Player player = Manager.createPlayer(...);
      • Parameters
        • Stream to the data file.
        • String type = content type, example: "audio/x-wav"
    13. Example of creating Player instance
      • Example
        • InputStream in = getClass().getResourceAsStream("/relax.wav");
        • Player player = Manager.createPlayer(in, "audio/x-wav");
      • Exception handling is necessary, use try catch.
      • Example: SimpleGameWithSounds.java
        • (Maybe the most irritating game of all time)
    14. Controlling Players
      • Player has following methods that control played sound:
        • setMediaTime(long now) - jump directly to particular point in an audio clip
        • setLoopCount(int count) - loop
    15. Player Controls
      • Control classes can control Players
      • You can obtain a list of Controls for a Player by calling getControls ().
      • MIDP 2.0 has only two Controls for the Player:
        • VolumeControl
        • ToneControl
      • Example of usage:
        • VolumeControl vc = (VolumeControl) player.getControl("VolumeControl");
        • vc.setLevel(50);
    16. Optional APIs
    17. Mobile Media API (JSR 135)
      • Playing sounds and tones
      • Also capturing media
        • MMAPI supports capturing audio and video from onboard hardware
        • Recording sound, video and taking pictures
      • http://today.java.net/pub/a/today/2005/09/27/j2me4.html
    18. Wireless Messaging API (JSR 205)
      • Common API for sending and receiving text and binary messages.
      • http://developers.sun.com/mobility/midp/articles/wma/
    19. Bluetooth API (JSR 82)
      • Connecting via Bluetooth
      • Tutorial
        • http://developers.sun.com/mobility/midp/articles/bluetooth2/
    20. JAXP XML Parser (JSR 172)
      • This JSR is designed to provide a general purpose XML API for the next generation of mobile devices
      • Supports
        • SAX 2 event handler-based parsing
      • Tutorial
        • http://developer.sonyericsson.com/site/global/techsupport/tipstrickscode/java/p_xml_parsing_jsr172.jsp
    21. Location API (JSR 179)
      • Enables developers to write mobile location-based applications for resource-limited devices
      • Determining device's location (GPS)
      • Tutorial
        • http://developers.sun.com/mobility/apis/articles/location/
    22. Mobile Internationalization API (JSR 238)
      • This JSR defines an API that provides culturally correct data formatting, sorting of text strings and application resource processing for J2ME MIDlets running in MIDP over CLDC.
      • Tutorial
        • http://www.ibm.com/developerworks/wireless/library/wi-midapi/
    23. Scalable 2D Vector Graphics API for J2ME ( JSR 226 )
      • Scalable 2D Vector Graphics API for J2ME ( JSR 226 ) provides MIDlets with an API for displaying SVG content.
      • Tutorial
        • http://developers.sun.com/mobility/midp/articles/s2dvg/index.html
    24. That's it...
    25. Language Learning Curve IDE Portability Development tool cost Symbian C++ Difficult Many Choices, Carbide C++ Only Symbian Varies S60 Qt Easy Carbide / Qt Creator Windows, Linux, Mac OS X and S60 Free Android Java Average Eclipse unknown Free Maemo C Average Maemo SDK Only Maemo Free Windows Mobile C#, VB Average Visual Studio Only Windows Mobile Varies iPhone Objective-C Average Xcode Only iPhone Free, distribution costs Flash Lite ActionScript Easy Macromedia Flash Excellent Varies Java ME Java Easy Sun Wireless Toolkit Average Free Web (x)html Easy Many Excellent Free
    26. What's next?
      • Ohjelmistotuotannon uudet suuntaukset
        • Google Android and iPhone – programming
        • Used languages and frameworks: Java and Objective-C
        • Maemo programming is not covered, since Qt will be the framework for developing Maemo apps.
      • Mobiiliohjelmointi 2: Qt for S60
        • No more Symbian C++
        • Qt is very easy C++ - framework for developing apps to Windows, Linux, Mac OS X and S60
    27. Schedule
      • 2009-09-209: Determine the subject of your Project Work
      • 2009-10-08: Exam (13.00 – 14.45)
      • 2009-10-23: Project Work Deadline
      • 2009-10-30: Evaluate other student's project
    28. Exam
      • Dummy SCMAD certification test
      • Multiple Choice
      • 48 questions, 0.5 points each, 24 points max
      • To pass, you must get atleast 26 questions right. (about 55%)
    29. Thank you!

    + Tampere University of Applied SciencesTampere University of Applied Sciences, 2 years ago

    custom

    1909 views, 0 favs, 1 embeds more stats

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 1909
      • 1876 on SlideShare
      • 33 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 2
    Most viewed embeds
    • 33 views on http://php.tpu.fi

    more

    All embeds
    • 33 views on http://php.tpu.fi

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories