я новичок в этом html и css кодировании и не распознает mp3, как я могу кодировать его, чтобы распознать его? - PullRequest
0 голосов
/ 31 марта 2020

Я пытаюсь закодировать аудиоплеер в моем html, но, похоже, он не распознает звук, поэтому его невозможно воспроизвести ..... Я новичок в кодировании html и css. я следовал за типом w3school, но он не работает, может кто-нибудь помочь

<!DOCTYPE html>
<html>
<head>
<style>
h1{
	background-color:lightblue;
	text-align:center;
	border-radius:16px;
}
p{
	font-family:verdana;
	outline-color:red;
	text-align:center;
}
button{
	background-color:yellow;
	padding:16px 32px;
	text-align:center;
	border:none;
    cursor:pointer;
    display:inline-block;
    font-size:20px;
    text-decoration:none;
    margin:-57px 220px;
    color:black;
}
button{
	border-radius:15px;
}
body{
	background-color:orange;
}
h3{
  background-color:lightgreen;
  text-align:center;
  border-radius:50px;

}
audio{
  margin:-67px 156px;

}
</style>
</head>
<body>
  <h1>WELCOME TO MY WEBSITE<h1>
  <p>plz decode this message to view it 
  	_...  ....  _ _ _  _ _ _  _  _.  ..  
  	use the button below to refer to cheatsheet</p>
  	<a href="https://www.boxentriq.com/img/morse-code/morse-code-overview.png"><button>Click here</button></a>
    <audio controls>
      <source src="hen.ogg" 
       type="audio/ogg">
        <source src="hen.mp3" 
        type="audio/mpeg">
   </audio>
</html>
</body>

сильный текст

Ответы [ 2 ]

0 голосов
/ 31 марта 2020
<!DOCTYPE html>
<html>
<head>
<style>
h1{
    background-color:lightblue;
    text-align:center;
    border-radius:16px;
}
p{
    font-family:verdana;
    outline-color:red;
    text-align:center;
}
button{
    background-color:yellow;
    padding:16px 32px;
    text-align:center;
    border:none;
    cursor:pointer;
    display:inline-block;
    font-size:20px;
    text-decoration:none;
    margin:-57px 220px;
    color:black;
}
button{
    border-radius:15px;
}
body{
    background-color:orange;
}
h3{
  background-color:lightgreen;
  text-align:center;
  border-radius:50px;

}
audio{
  margin:-67px 156px;

}
</style>
</head>
<body>
  <h1>WELCOME TO MY WEBSITE<h1>
  <p>plz decode this message to view it
    _...  ....  _ _ _  _ _ _  _  _.  ..
    use the button below to refer to cheatsheet</p>
    <a href="https://www.boxentriq.com/img/morse-code/morse-code-overview.png"><button>Click here</button></a>
    <audio controls>
      <source src="hen.ogg"   <!-- Audio file must be in the same folder
                                           as your HTML file -->
       type="audio/ogg">
        <source src="voice/hen.mp3" <!-- If they are not in the same folder then,
                                    specify it like this -->
        type="audio/mpeg">
   </audio>
</html>
</body>
[When your audio is not in the same folder as your HTML file][1]


[When your audio is in the same folder as your HTML file][2]


  [1]: https://i.stack.imgur.com/k5Rzm.png
  [2]: https://i.stack.imgur.com/jQk3V.png
0 голосов
/ 31 марта 2020

Недостаточно повторений, чтобы комментировать, но какой браузер вы используете и где храните mp3-файл? Вы можете попробовать что-то вроде этого, чтобы проверить совместимость браузера. Вы не должны видеть текст, если все работает нормально.

<audio controls>
  <source src="hen.ogg" type="audio/ogg">
  <source src="hen.mp3" type="audio/mpeg">
  No browser support.
</audio>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...