搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

Learn More

wav file generates an error about associated protocol

  • 2 回覆
  • 1 有這個問題
  • 5 次檢視
  • 最近回覆由 cor-el

more options

I am trying to get a sound to play when an event happens on my page. I added a link so that I could click on it to make it play, but when I do i am getting this error message: Firefox doesn’t know how to open this address, because one of the following protocols (c) isn’t associated with any program or is not allowed in this context. I have done some searching but can't find a solution. I know that you disabled plugins, but is there not a way to play sounds in Firefox anymore? Here is the object I setup: <object type="audio/x-wav" data="C:\Windows\Media\StarTrek\DistressCall.wav">

 <param name="src" value="C:\Windows\Media\StarTrek\DistressCall.wav">
 <param name="autoplay" value="true">
 <param name="autoStart" value="1">
  <a href="C:\Windows\Media\StarTrek\DistressCall.wav">test.wav</a>

</object> Background sounds are also not working: <BGSOUND SRC="C:\Windows\Media\StarTrek\BridgeSequence.wav">

I am trying to get a sound to play when an event happens on my page. I added a link so that I could click on it to make it play, but when I do i am getting this error message: Firefox doesn’t know how to open this address, because one of the following protocols (c) isn’t associated with any program or is not allowed in this context. I have done some searching but can't find a solution. I know that you disabled plugins, but is there not a way to play sounds in Firefox anymore? Here is the object I setup: <object type="audio/x-wav" data="C:\Windows\Media\StarTrek\DistressCall.wav"> <param name="src" value="C:\Windows\Media\StarTrek\DistressCall.wav"> <param name="autoplay" value="true"> <param name="autoStart" value="1"> &nbsp;<a href="C:\Windows\Media\StarTrek\DistressCall.wav">test.wav</a> </object> Background sounds are also not working: <BGSOUND SRC="C:\Windows\Media\StarTrek\BridgeSequence.wav">

所有回覆 (2)

more options

1. You should use <audio> element.

2. Error is right, C is not a protocol. You can't use full path as a source without providing proper file protocol syntax. Try to use only filename - in the samo folder as html file.

more options

The proper URI would be:

<audio src=file:///C:/Windows/Media/StarTrek/DistressCall.wav></audio>

You can always open the file in a Firefox tab to see the correct URL in the location/address bar. Note that Firefox may throw a security error in case a sandbox (e.g. multi-process) is active.

See also:

由 cor-el 於 修改