diff --git a/.gitignore b/.gitignore
index f113a2d..05a68e3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,6 @@
*.pem
*.crx
*.zip
+*.bak
+*.db
nacl-src/pnacl
diff --git a/README.md b/README.md
index 1f80136..1469e28 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,29 @@
+# Modifications in this fork:
+
+* Automatically pauses recording if signal is below the squelch threshold.
+
+* m key mutes audio instantly (recording is not affected). Adjust volute to resume.
+
+* Signal level is displayed with a bar. Hover mouse to read numerical value.
+
+* Clicking signal bar sets squelch level.
+
+* PgDn/PgUp moves through the list of saved preset stations.
+
+* Shift-PgDn begins (or ends) scanning through preset stations. Scanning stops when signal is above preset squelch level and resumes when signal drops below squelch level for a while.
+
+* Export/Import preset list includes the squelch setting for each station.
+
+* Clicking on the "Squelch" heading enters or leaves MONITOR mode, where squelch is temporarily set to zero to monitor frequency.
+
+* f/F key moves to the frequency display for editing (this is in the original help file, but didn't work).
+
+
# Radio Receiver
An application to listen to broadcast FM and AM radio from your Chrome browser or your ChromeBook computer using a $15 USB digital TV tuner.
-
+
## What is this
diff --git a/extension/appconfig.js b/extension/appconfig.js
index c0eab5f..37891e5 100644
--- a/extension/appconfig.js
+++ b/extension/appconfig.js
@@ -34,7 +34,7 @@ function AppConfig() {
/** Upconverter. */
upconverter: {
enable: false,
- frequency: 125000000
+ frequency: 99999020 // Peter's up converter
},
/** Whether free tuning is enabled. */
freeTuning: false
diff --git a/extension/audio.js b/extension/audio.js
index bf6b3db..dcb668b 100644
--- a/extension/audio.js
+++ b/extension/audio.js
@@ -24,6 +24,8 @@ function Player() {
var frameno = 0;
var wavSaver = null;
+
+ var dampedLevel = 0;
var ac = new (window.AudioContext || window.webkitAudioContext)();
var gainNode = ac.createGain ? ac.createGain() : ac.createGainNode();
@@ -38,7 +40,10 @@ function Player() {
*/
function play(leftSamples, rightSamples, level, squelch) {
var buffer = ac.createBuffer(2, leftSamples.length, OUT_RATE);
- if (level >= squelch) {
+ dampedLevel = 0.75 * dampedLevel + .25*level*100;
+ signalBar.value = Math.floor(dampedLevel);
+ signalBar.title = signalBar.value;
+ if ((dampedLevel/100) >= squelch) {
buffer.getChannelData(0).set(leftSamples);
buffer.getChannelData(1).set(rightSamples);
}
@@ -50,7 +55,26 @@ function Player() {
ac.currentTime + TIME_BUFFER);
source.start(lastPlayedAt);
if (wavSaver != null) {
- wavSaver.writeSamples(leftSamples, rightSamples);
+ if ((dampedLevel/100) >= squelch) {
+ wavSaver.writeSamples(leftSamples, rightSamples);
+ }
+ }
+ if (typeof scanPresets == 'undefined') { // proof of concept for preset scanning
+ scanPresets = false; // not likely to be the way it will be implemented
+ scanCount = 0; // a test to find the possible problems...
+ }
+ if (radio.requestingBlocks > 0) {
+ return;
+ }
+ if ( scanPresets ) {
+ scanCount++;
+ if ((dampedLevel/100) > squelch) {
+ scanCount = -5; // resume scanning after x+n no signal events
+ }
+ if ( scanCount > 5 && (level < squelch)) { // scan every n events
+ interface.nextPreset(); // tweak this parameter if too fast for dongle/decoder
+ scanCount = 0;
+ }
}
}
@@ -93,7 +117,7 @@ function Player() {
function setVolume(volume) {
gainNode.gain.value = volume;
}
-
+
return {
play: play,
setVolume: setVolume,
diff --git a/extension/auxwindows.js b/extension/auxwindows.js
index 4cd16e3..a368ae2 100644
--- a/extension/auxwindows.js
+++ b/extension/auxwindows.js
@@ -36,6 +36,7 @@ var AuxWindows = (function() {
win.contentWindow['opener'] = window;
var modeData = copyObject(band.getMode());
modeData['step'] = band.getStep();
+ modeData['squelch'] = squelch;
var stationData = {
'frequency': frequency,
'display': band.toDisplayName(frequency, true),
@@ -138,7 +139,7 @@ var AuxWindows = (function() {
'width': 700,
'height': 600
},
- 'state': 'maximized',
+ 'state': 'normal',
'resizable': true
});
}
diff --git a/extension/help.html b/extension/help.html
index 0252bd4..9bcbbea 100644
--- a/extension/help.html
+++ b/extension/help.html
@@ -69,6 +69,11 @@
Using presets
To switch to a preset, click the preset selection box (7) and choose your new preset. The radio will switch to it immediately.
To delete a preset, switch to it and press the “Remove” button (8).
To change a preset's name, switch to it and click the “Save” button (6). Type the new name and press “Save”.
+
To export a set of presets for loading later, go to “Settings” (12) and
+click on the Manage your Presets link.
+
Use the PgUp and PgDn keys to select the previous or next preset station in the list.
+
Hold down the shift key and press PgDn to begin automatic scanning of preset stations.
+The scan will pause if the squelch level is exceeded. Each preset can have its own squelch value assigned.
Changing volume and stereo
To change the volume, click on the “loudspeaker” icon (9) and move the slider left and right to decrease or increase the volume. You can also use your mouse wheel on the icon to change volume directly.
The “Squelch” setting (6) lets you monitor a frequency without having to hear static when nobody is transmitting. The squelch level is the minimum strength level the signal must reach before you can hear it; if it's set to 0, you'll hear everything.
+
The “Squelch” setting (6) lets you monitor a frequency without having to hear static when nobody is transmitting. The squelch level is the minimum strength level the signal must reach before you can hear it; if it's set to 0, you'll hear everything.
+Click on the signal strength display to set the squelch value slightly above the noise level.
Settings
You can change a lot of settings by clicking on the “wrench” icon (12). There you can change several settings: