WEB/420 - grot.com

Transcription

WEB/420 - grot.com
WEB/420
Web Programming II
Session #4
University of Phoenix
06/03/2003
Brian Smithson
06/03/2003
WEB/420 #4 -- Brian Smithson
1
Agenda
Administrivia
Questions from last session?
Learning team progress?
Presentations/Articles
Sound files
Video files
Java Applets
CreditRoll
Review and preparation for #5
06/03/2003
WEB/420 #4 -- Brian Smithson
2
Presentations/Articles
Article summaries:
n
“Exploring the wealth of operators in VBScript”
Your web pages…
06/03/2003
WEB/420 #4 -- Brian Smithson
3
About audio sampling rate
Determines the highest frequency that will be reproduced
n
n
Rate must be at least two times the desired highest frequency
Rate also contributes to distortion at higher frequencies
Example frequency ranges:
n
n
n
High fidelity music: 20 Hz – 20 kHz
88-note piano keyboard: 27.5 Hz – 4.19 kHz
Human voice:
w Bass: 87 – 349 Hz
w Baritone: 98 – 392 Hz
w Tenor: 130 – 494 Hz
w Contralto: 131 – 699 Hz
w Soprano: 247 - 1,175 Hz
w Mariah Carey: 87 – 2,784 Hz *
* Estimated, based on claims of 5 octave range
06/03/2003
WEB/420 #4 -- Brian Smithson
4
About audio sampling resolution
Determines the accuracy of reproduction
n
n
n
Insufficient resolution results in audible distortion
Also known as “quantization error”
Resolution also impacts dynamic (volume) range
Types of sampling resolutions
n
n
Linear quantization
Logarithmic quantization
Rules of thumb:
n
n
Speech: use 12- to 16-bit linear or 8-bit logarithmic
Music: use 16-bit linear
06/03/2003
WEB/420 #4 -- Brian Smithson
5
Audio file formats
AU
n
n
Also known as µlaw (“mu law”) format. Old format, primarily
on UNIX.
8-bit, 8kHz, mono.
AIFF/AIFC
n
n
Audio Interchange File Format, developed by Apple for
Macintosh
8- or 16-bit, mono or stereo, several sampling rates.
WAV
n
n
“Wave files”, developed by Microsoft. Sometimes uses
compression.
8- or 16-bit, mono or stereo, wide range of sampling rates.
06/03/2003
WEB/420 #4 -- Brian Smithson
6
More audio file formats
MP3
n
MPEG, developed by the Motion Picture Experts Group. Highly
compressed, wide range of fidelity options. MPEG3 is most
often used, but MPEG, MPEG2, and MPEG4 also carry audio.
WMA
n
Windows Media Audio, developed by Microsoft. Even better
compression than MP3, but limited cross-platform support.
RA
n
RealAudio, developed by Real Networks. High compression,
wide range of fidelity options.
MIDI
n
Musical Instrument Digital Interface. Not a sound file format
per se, but a control format for synthesized instruments.
Extremely compressed compared with recordings, but relies on
the capability/compatibility of the client-side synthesizer.
06/03/2003
WEB/420 #4 -- Brian Smithson
7
Using sound files on the web
Most simple form is to link to a file which the user will
download and store and/or play
<a href=“music.wav”>Music</a>
Embedding will play the file in place.
<EMBED SRC=“music.wav” WIDTH=145 HEIGHT=60
AUTOSTART=“false”>
<BGSOUND SRC=“music.wav” LOOP=1>
06/03/2003
WEB/420 #4 -- Brian Smithson
8
Video
Frame rates
n
n
Theatrical films: 24 fps
Television and video cameras: 30 fps (interlaced)
Frame sizes
n
n
160w X 120h is standard
Doubling the dimensions = quadrupling the number
of bits
Codecs
n
Make sure that the codec you choose for encoding
is available in the audience’s browser for decoding
06/03/2003
WEB/420 #4 -- Brian Smithson
9
Video file formats
AVI
n
n
Audio Video Interleave, developed by Microsoft.
320x240 and 30fps maximum.
QuickTime
n
Developed by Apple, widely supported on other
platforms.
MPEG
n
n
n
Developed by the Motion Pictures Expert Group.
MPEG-1: 352x240 and 30fps maximum.
MPEG-2: 1280x720 and 60fps maximum.
06/03/2003
WEB/420 #4 -- Brian Smithson
10
More video file formats
WMV
n
Windows Media Video, developed by Microsoft.
Limited cross-platform support.
RealVideo and ASF
n
Developed by Real Networks and Microsoft,
respectively. Most often used in streaming.
06/03/2003
WEB/420 #4 -- Brian Smithson
11
Using Video on the web
Linking to a video file is the same as linking to
any other file.
Embedding:
<EMBED SRC=“URL” WIDTH=value
HEIGHT=value>
<IMG SRC=“stillURL” DYNSRC=“motionURL”>
06/03/2003
WEB/420 #4 -- Brian Smithson
12
Java Applets
When HotJava was new, the web was
significantly less capable
Problems with Java applets
n
n
n
Download time
Virtual machine start-up
Dubious support from Microsoft
When to use Javascript/DHTML (or even
Macromedia Flash)
When to use Java applets
06/03/2003
WEB/420 #4 -- Brian Smithson
13
Using Java Applets on the web
Embedding:
<APPLET CODE=file.class WIDTH=value
HEIGHT=value CODEBASE=url>
<PARAM NAME=name VALUE=value>
...
</APPLET>
06/03/2003
WEB/420 #4 -- Brian Smithson
14
CreditRoll
We’ll do it in class
VS. Marquee tag:
<MARQUEE WIDTH=width HEIGHT=height
BGCOLOR=color>marquee text...</MARQUEE>
06/03/2003
WEB/420 #4 -- Brian Smithson
15
Next week:
Presentations!
Other languages
06/03/2003
WEB/420 #4 -- Brian Smithson
16