0

The WebFM API provides access to the device FM radio.

You can set the frequency with FMRadio.setFrequency().

Does the WebFM API for Firefox OS support LF and MF too, or does it only work with VHF?

 - LF   Low Frequency        30–300 kHz
 - MF   Medium Frequency     0,3–3  MHz
 - VHF  Very High Frequency  30–300 MHz

Unfortunately, the specification at MDN is not clear enough.

Jonas
  • 121,568
  • 97
  • 310
  • 388
mate64
  • 9,876
  • 17
  • 64
  • 96
  • I think this is most likely device-dependent, May be related: [`FMRadio.frequencyLowerBound`](https://developer.mozilla.org/en-US/docs/Web/API/FMRadio.frequencyLowerBound) – Paul S. Jun 13 '14 at 15:59
  • I don't think it's device dependent. The WebFM API is a part of firefox-os. But `FMRadio.frequencyLowerBound` can't switch to `kHz` (Low Frequency), because the range starts at 1 `MhZ`. – mate64 Jun 13 '14 at 16:09
  • I meant device dependent as in the hardware would need to support it, e.g. most FM radios (VHF) do not support tuning to AM frequencies (usually in MF), and it's not just because you can't twist the dial far enough. Also, I don't see where on _MDN_ it says `FMRadio.frequencyLowerBound` must be an integer (it's a _double_) or will always be at least `1` – Paul S. Jun 13 '14 at 16:11

2 Answers2

2

It's depend on a Gecko pref, which is set by the hardware vendor, so, yes, it's device dependent.

http://dxr.mozilla.org/mozilla-central/source/dom/fmradio/FMRadioService.cpp#64-78

timdream
  • 5,914
  • 5
  • 21
  • 24
2

All the attributes related to frequency (i.e. frequency, channelWidth, frequencyLowerBound, frequencyUpperBound) are in MHz, so technically MF should be supported, but LF won't.

The WebFM API is not a standard API yet (it's moz prefixed: navigator.mozFMRadio), it only works on Firefox OS and device dependent as @timdream said.

BTW, you could find the WebFM API discussion here:

https://groups.google.com/forum/?fromgroups#!topic/mozilla.dev.webapi/PraULCQntqA

https://bugzilla.mozilla.org/show_bug.cgi?id=779500

Pin Zhang
  • 190
  • 1
  • 6