Hardik Shah
Hardik Shah

Reputation: 161

Unable to Play WAV File in Chrome

I am trying to play a wav file in Chrome using audio control. However, as soon as the page loads, player control gets disabled.

<html>
<head>
<meta name="viewport" content="width=device-width">
<link id="avast_os_ext_custom_font" href="chrome-extension://mbckjcfnjmoiinpgddefodcighgikkgn/common/ui/fonts/fonts.css" rel="stylesheet" type="text/css">
</head>
<body>
<video controls="" autoplay="" name="media" loop="">
<source src="http://204.12.222.250:8978/tpv/May-2020/15/3335-3331-01-31-32.WAV" type="audio/x-wav">
</video>
</body>
</html>

Upvotes: 1

Views: 5982

Answers (2)

HSV_DO
HSV_DO

Reputation: 119

In my case I found out that .wav files with a bitrate < 100 kBit/s cannot be played. Neither via HTML audio controls nor via JavaScript. Those low bitrates do work in some other browsers (e.g. Firefox). Everything above 100 kBit/s works for me in Chrome (lowest bitrate I tried was 107 kBit/s). In any case, it's a bit annoying when you try to reduce the size of the sound files...

Edit: I tried again to reduce the size in small steps. The turning point is: 96 kBit/s (working), 95 kBit/s (not working anymore)

Upvotes: 1

Neovov
Neovov

Reputation: 349

Ditch the type="audio/x-wav" and try changing the server's configuration to return audio/wav content-type.

By the way, it's a bad idea to serve Wav files as they are not optimized for web content.

Upvotes: 1

Related Questions