Audio Chapter 17 - Student. (c) 2005 by Elizabeth Sugar Boese Audio Files Java can play the following audio types: .au (Sun Audio) .wav (Windows Wave)

Slides:



Advertisements
Similar presentations
1 More on Applets Overview l Changing Colors l Changing Fonts & Styles l Applet Life-Cycle l Input using Dialog Window l Input using HTML parameters l.
Advertisements

Features of MP3, MIDI, wave, audio and file types including suffixes. By Georgina Honeysett PGCE ICT.
Chapter 11 Media and Interactivity Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
Using Multimedia on the Web Enhancing a Web Site with Sound, Video, and Applets.
CNIT 132 – Week 9 Multimedia. Working with Multimedia Bandwidth is a measure of the amount of data that can be sent through a communication pipeline each.
2 Information Processing
Module 4- Build a Game I Can’t Hear You! Sound. Sound formats in Scratch  Scratch can read MP3 files and uncompressed WAV, AIF, and AU files.  Just.
1. Digitization of Sound What is Sound? Sound is a wave phenomenon like light, but is macroscopic and involves molecules of air being compressed and expanded.
Chapter 11 Media and Interactivity Basics Key Concepts
1 Multimedia on the Web: Issues of Bandwidth Bandwidth is a measure of the amount of data that can be sent through a communication pipeline each second.
4.2 Multimedia Elements Audio 1. Learning Outcomes: At the end of the lesson, students should be: a) describe the purpose of using audio in multimedia.
HTML Structure & Web Design Basics
1 L45 Multimedia: Applets and Applications. 2 OBJECTIVES  How to get and display images.  To create animations from sequences of images.  To create.
1 Lecturte 14Lecture 7 Applications of Graphics Overview  Conversions Between Applications and Applets  Handling Mouse Events  Handling Keyboard Events.
Chapter 12Java: an Introduction to Computer Science & Programming - Walter Savitch 1 Announcements/Reminders l Happy Tax Day! l Project 8 due on Thursday.
Applets, Graphical User Interfaces, and Threads / Chapter 9 1 Applets, Graphical User Interfaces, and Threads.
Unit 071 Review of Applets Learning Outcomes oDistinguish between Java Applications and Java Applets. oWrite applet programs that can load images and play.
Applets. What is an Applet?  According to Sun “An applet is a small program that is intended not to be run on its own, but rather to be embedded inside.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved L05 (Chapter 16) Applets.
Chapter 9 Audio.
Computer Science [3] Java Programming II - Laboratory Course Lab 7: Multimedia: Applets and Applications Faculty of Engineering & IT Software Engineering.
Introduction Multimedia –Use of sound, image, graphics and video –Makes applications “come alive”
Java Programming, 3e Concepts and Techniques Chapter 3 Section 65 – Manipulating Data Using Methods – Java Applet.
Audio and Video CGS Some Common Audio Formats Format Use Extension MIDI instrumental music.mid MPEG songs.mp3 RealAudio live broadcasts.ra Wave.
 2002 Prentice Hall, Inc. All rights reserved. Chapter 18 – Multimedia: Images, Animation, Audio and Video Outline 18.1 Introduction 18.2 Loading, Displaying.
(c) 2008 E.S.Boese All Rights Reserved. Threads and Media Chapter 8 - Lecture Slides 1.
Applets Chapter 17.  Java’s big splash onto the scene came in the mid 90’s. The people at Sun Microsystems had managed to work java programs into Web.
AUDIO MEDIA 1 Created } “Borrowed” } Microphone MIDI keyboard CD’s & flash drives Internet Audio Sources 2.
Chapter 17: Applets, Images, and Sound. Objectives Learn about applets Write an HTML document to host an applet Use the init() method Work with JApplet.
Sound or Audio, whichever you prefer –MIDI Files.midi or.mid (Musical Instrument Digital Interface) use for instrumental music. –This format is supported.
Multimedia From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 1 Introduction Important Multimedia Issues Audio Movies.
Timer Objects  regularly generates action events at programmer-specified time intervals  Timer class is in javax.swing package  Timer (int delay, ActionListener.
 2000 Prentice Hall, Inc. All rights reserved. Java Multimedia: Images, Animation, Audio and Video Outline 30.1 Introduction 30.2Loading, Displaying and.
Pravin Yannawar, DOCS, NMU Jalgaon Basic Java : Applets 2 Objectives of This Session Identify the need for Applets Distinguish between Applets and Applications.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 16 Applets and Multimedia.
(c)2009 by E.S. Boese. All Rights Reserved. Classes Chapter 13 – Lecture Slides 1 Got class?
Audio Communications: Sound Mr. Butler Communication Systems John Jay High School Wappingers Central School District UPDATED 11/2011.
Inserting Music into PowerPoint Diane Newby, Ed.D.
Adding Multimedia to Expression Web Module 5: Beyond the Basics with Expression Web LESSON Ext2.
Applets Yong Choi School of Business CSU, Bakersfield.
Java Programming Working with Sound and Images. Topics Learn about the paint() and repaint() methods Learn about paintComponent() method Use the drawString()
Multimedia Web Pages. Multimedia displays Browser can load web pages that contains multimedia elements 1. Helper applications: stand-alone programs that.
Introduction Multimedia –Use of sound, image, graphics and video –Makes applications “come alive”
Game Art & Sound. Sound ● Midi files – Musical Instrument Digital Interface – Advantages ● small ● fast – Disadvantages ● synthesized ● rendered ● Wav.
Intro to Applets. Applet Applets run within the Web browser environment Applets bring dynamic interaction and live animation to an otherwise static HTML.
Chapter 16 Multimedia F Audio Files F Playing Audio F Running Audio on a Separate Thread F Displaying Images F Displaying a Sequence of Images  Using.
Swing. Introduction to Swing What is Swing? “ Swing is a diverse collection of lightweight components that can be used to build sophisticated user interfaces.”
1 Sound in Java Summary: r Sound API Basics r MIDI JavaSound - Part of the UIT User Interface Toolkit.
1 Applets. 2 Design of Applets 3 Sun wrote Java to be executable within a hosting application browser The applications are applets. An applet is downloaded.
Chapter 12: Accessing the Web URL (Uniform Resource Locator) class Applet methods –for audio clips –for images –context interface.
Music files in PowerPoint 2007? By Ashley Wiger.
1 Applets. 2 What is an applet? Applet: a Java program that can be inserted into a web page and run by loading that page in a browser brings web pages.
Introduction to Applets Chapter 21. Applets An applet is a Java application that is intended to be invoked and executed through a Web browser. Click Here.
Introduction to sound using processing. 2 Minim –A sound library which uses javasound library –Provide convenient but flexible way to play,, synthesize.
Lec 15 Writing an Applet Class. Agenda Writing an Applet class Java Graphics class.
Chapter 14: Multimedia Audio Files Audio Files Playing Audio Playing Audio Running Audio on a Separate Thread Running Audio on a Separate Thread Displaying.
Java Applets Getting Started. Import Files In order to run the applet properly, we have to import some files into our class. These files are: –import.
Objective % Explain concepts used to create digital audio.
Instant Net Conference
Chapter 11 JTabbedPane, ToolTips, Borders, Audio, JFrame, MediaTracker
Objective % Explain concepts used to create digital audio.
Instant Net Conference
Applets.
UNIT-5.
Customized Net Conference
I Can’t Hear You! Sound Get out your notes.
Java Programming COMP-417 Applet
Customized Net Conference
Chapter 9 Audio.
APPLET PROGRAMMING.
Presentation transcript:

Audio Chapter 17 - Student

(c) 2005 by Elizabeth Sugar Boese Audio Files Java can play the following audio types: .au (Sun Audio) .wav (Windows Wave) .aif or.aiff (Macintosh AIFF) .mid (Musical Instrument Digital Interface (MIDI) .rmf Note: mp3 is NOT supported in the Java API. However, There are libraries you can download and use Note: wav files from your CDs are HUGE! Won’t run well – only use small WAV files

(c) 2005 by Elizabeth Sugar Boese Audio AudioClip clip; clip = getAudioClip( getCodeBase( ), audioFilename ); clip.play( ); There are three methods we can call on our AudioClip  play play the sound file once through  loop play the sound file continually  stop stop playing the file getCodeBase works same for images as audio files

(c) 2005 by Elizabeth Sugar Boese Audio import java.awt.*; import java.applet.*; import javax.swing.*; public class AudioPlay extends JApplet { String audioFilename = "mySounds.mid"; AudioClip ac; public void init( ) { ac = getAudioClip( getCodeBase( ), audioFilename ); ac.play( ); }

(c) 2005 by Elizabeth Sugar Boese Audio To have sound clip loop: get an AudioClip call the loop( ) method import java.awt.*; import java.applet.*; import javax.swing.*; public class AudioPlay extends JApplet { String audioFilename = "mySounds.mid"; AudioClip ac; public void init( ) { ac = getAudioClip( getCodeBase( ), audioFilename ); ac.loop( ); }

(c) 2005 by Elizabeth Sugar Boese Audio: Need for stop( ) See Example Each button starts an audio file playing If the previous one isn’t stopped first, then the new one plays on TOP of the other one This is usually not desired However, some applications want this technique (see example of Singing Horses on Internet at:

(c) 2005 by Elizabeth Sugar Boese stop method import java.awt.*; import java.applet.*; import java.awt.event.*; import javax.swing.*; public class LoopAudio extends JApplet { String audioFilename = "happyDaze.wav"; AudioClip ac; public void init( ) { ac = getAudioClip( getCodeBase( ), audioFilename ); ac.loop( ); // loop instead of play } public void stop( ) { if( ac != null ) // can't stop it if it isn't running, check first ac.stop( ); } Stop playing audio when user leaves the applet: Write a stop method

(c) 2005 by Elizabeth Sugar Boese Summary Supported audio file types AudioClip Methods on AudioClip  play  loop  stop Need for stop( ) method