1 / 10

Media API

Media API. Web Science APT 2007/2008. John Meilak Reuben Sant Jason Farrugia. Introduction. Users demand rich multimedia capabilities Mobile hardware developed significantly Mobile devices are not simply used for voice calls and text messaging. Media Capabilities.

rhett
Download Presentation

Media API

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Media API Web Science APT 2007/2008 John Meilak Reuben Sant Jason Farrugia

  2. Introduction • Users demand rich multimedia capabilities • Mobile hardware developed significantly • Mobile devices are not simply used for voice calls and text messaging

  3. Media Capabilities • Play, stream and record media resources • Audio • Video • Face Detection • Used to adjust camera settings on face

  4. android.media Package • Classes • MediaPlayer • MediaRecorder • FaceDetector • AudioSystem • Interfaces • MediaPlayer.OnBufferingUpdateListener • MediaPlayer.OnCompletionListener • MediaPlayer.OnErrorListener • MediaPlayer.OnPreparedListener

  5. MediaPlayer Example • Local Resource MediaPlayer mp = MediaPlayer.create (context, R.raw.sound_1); • Stream mp.setDataSource(path); • Video mp.setDisplay(mPreview.getHolder().getSurface()); • An android.View.Surface is needed to display the video in it. • mPreview is of type android.view.SurfaceView which is defined in the xml layout file. • Playback mp.prepare(); mp.start();

  6. MediaRecorder Example MediaRecorder rec = new MediaRecorder(); rec.setVideoSource(MediaRecorder.VideoSource.CAMERA); rec.setAudioSource(MediaRecorder.AudioSource.MIC); rec.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); rec.setVideoSize(400, 300); rec.setVideoFrameRate(24); rec.setVideoEncoder(MediaRecorder.VideoEncoder.H263); rec.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); rec.setOutputFile(path); rec.prepare(); rec.start();

  7. Supported Media Codecs • Audio • MP3compression scheme used to transfer audio files via internet and store in portable media players • AACadvanced audio coding, similar to mp3, used by iTunes • Ogg Vorbisa free and open source audio codec • MIDIused to describe a piece of music in enough detail to be able to reproduce it accurately • iMelodyringtone format • XMFextensible music format, used to keep file sizes as small as possible. used for polyphonic ringtones • RTTL/RTX ringtones format

  8. Supported Media Codecs • Video • MPEG-4compression algorithm for graphics, audio and video • H.264simple standard providing good video quality at lower bit rates • 3GPsimplified version of mpeg used to accommodate limited bandwidth of mobile phones

  9. References • http://code.google.com/android • http://www.helloandroid.com • http://davanum.wordpress.com/2007/12/29/android-videomusic-player-sample-from-local-disk-as-well-as-remote-urls/

More Related