11.39. HTML5 Audio

发布时间 :2024-02-22 23:00:06 UTC      

HTML5 provides a standard for playing audio files.

11.39.1. Audio on the Internet

Until now, there is still no standard for playing audio on the web.

Today, most audio is played through plug-ins such as Flash. However, not all browsers have the same plug-in.

HTML5 specifies the standard for embedding audio elements on web pages, even with the < audio > element.

11.39.2. Browser support

Internet Explorer Firefox Opera Google Chrome Safari

Internet Explorer 9, Firefox, Opera, Chrome, and Safari all support <audio> element。

Note: Internet Explorer 8 and earlier IE versions do not support <audio> element。

11.39.3. HTML5 Audio-how to work

To play audio in HTML5, you need to use the following code:

Example

<audiocontrols><sourcesrc="horse.ogg"type="audio/ogg">
<sourcesrc="horse.mp3"type="audio/mpeg">Your browser does not support
audio element.</audio>

control Property for adding playback, pause, and volume controls.

In <audio> and </audio> you need to insert something that the browser does not support. <audio> the prompt text for the element.

<audio> element allows you to use multiple <source> element。 <source> elements can be linked to different audio files, and the browser will use the first supported audio file

11.39.4. Audio format and browser support

Currently, the audio element supports three audio format files: MP3, Wav, and Ogg:

browser

MP3

Wav

Ogg

Internet Explorer 9 +

YES

NO

NO

Chrome 6 +

YES

YES

YES

Firefox 3.6 +

YES

YES

YES

Safari 5 +

YES

YES

NO

Opera 10 +

YES

YES

YES

11.39.5. MIME type of audio format

Format

MIME-type

MP3

Audio/mpeg

Ogg

Audio/ogg

Wav

Audio/wav

11.39.6. HTML5 Audio tag

Label

Description

< audio >

Defines the sound content

<source>

Defined multimedia resources, which can be multiple and used in<video>and<audio>tags

Principles, Technologies, and Methods of Geographic Information Systems  102

In recent years, Geographic Information Systems (GIS) have undergone rapid development in both theoretical and practical dimensions. GIS has been widely applied for modeling and decision-making support across various fields such as urban management, regional planning, and environmental remediation, establishing geographic information as a vital component of the information era. The introduction of the “Digital Earth” concept has further accelerated the advancement of GIS, which serves as its technical foundation. Concurrently, scholars have been dedicated to theoretical research in areas like spatial cognition, spatial data uncertainty, and the formalization of spatial relationships. This reflects the dual nature of GIS as both an applied technology and an academic discipline, with the two aspects forming a mutually reinforcing cycle of progress.