How To Embed Sound On A Website

Table of contents:

How To Embed Sound On A Website
How To Embed Sound On A Website

Video: How To Embed Sound On A Website

Video: How To Embed Sound On A Website
Video: Insert Audio into a Website Using HTML5 2024, December
Anonim

To embed sound on a website, you need to have an understanding of the HTML (HyperText Markup Language) programming language. Some webmasters want the visitor to visit the site and hear pleasant background music or the soothing noise of the surf. There is nothing wrong. However, you need to know that there are also copyrights that cannot be violated.

How to embed sound on a website
How to embed sound on a website

It is necessary

Knowledge of the language for creating WEB-documents - HTML

Instructions

Step 1

One of the easiest ways to upload mp3 sound to your site is to create a new html page. Just keep in mind that not all browsers may respond correctly. For example, in Internet Explorer this method is suitable, for some other browsers it is necessary to use the Flash player.

Step 2

Paste the following code between the tags:. Now you need to carry out a few simple manipulations with it. To do this, you must know the decoding of the components of this code.

Step 3

Src is the path to the sound file. To set it correctly, upload the song.mp3 file to the root folder of your site. For example, your site is www.name.ru. Load the file song.mp3 into the root folder, then the absolute path will be - https://www.imya.ru/song.mp3. The way you upload files to the root folder depends on which platform your site is running on.

Step 4

Balance adjusts the sound balance between the left and right speakers. You can insert an integer from -10000 to 10000. If you put balance = "0" in the line, then the volume balance in both speakers will be the same. Positive numbers increase the volume in the right speaker, while negative numbers increase the volume in the left.

Step 5

The loop value indicates how many times the music file will be played. Loop = "0" plays the file once, -1 plays music as long as the current web page is open. Any positive integer will cause your browser to play the selected sound file the specified number of times.

Step 6

Volume sets the volume of the file. You can specify an integer from -10000 to 0, where zero is the maximum playback volume. Try experimenting a little with the values of the above parameters, and you will definitely be able to tweak the best option.

Recommended: