Skip to content

Instantly share code, notes, and snippets.

var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
var source;
var analyser = audioCtx.createAnalyser();
analyser.minDecibels = -60.0;
analyser.maxDecibels = 0.0;
analyser.smoothingTimeConstant = 0.8;
analyser.fftSize = 128;
var javascriptNode = audioCtx.createScriptProcessor(1024);
r4_offline_file = "/home/icecast/~misc/cover-offline.mp3"
r4_sid = "3"
r4_dest_mount = "covers"
r4_dest_desc = "Rainwave Covers"
r4_dest_url = "http://covers.rainwave.cc"
r4_harbor_port = 31233
##################
set("log.level", 3)
2016/03/19 00:54:19 [request.dynamic_5502:3] Finished with "/home/icecast/cover-all/Wild Arms/Obtuse_BrandonStrader_WildArms-LunarTwilight_RTS.mp3".
2016/03/19 00:54:19 [amplify_5505:3] End of the current overriding.
2016/03/19 00:54:19 [request.dynamic_5502:3] Prepared "/home/icecast/silence_5min.mp3" (RID 1).
2016/03/19 00:54:19 [smart_cross_5507:3] Analysis: -101.758517dB / -infdB (4.02s / 1.98s)
2016/03/19 00:54:19 [smart_crossfade:3] Metadata crossfade is 2 on starting song, fading out
2016/03/19 00:54:24 [server:3] New client unix socket "3\181\182\127".
2016/03/19 00:54:24 [server:3] Client unix socket "3\181\182\127" disconnected without saying goodbye..!
2016/03/19 00:54:24 [covers(dot)mp3:3] Performing user-requested skip
2016/03/19 00:54:24 [request.dynamic_5502:3] Finished with "/home/icecast/silence_5min.mp3".
2016/03/19 00:54:24 [smart_cross_5507:3] Analysis: -nandB / -nandB (0.00s / 0.00s)
25,200 RAM https://www.ark-pc.co.jp/i/11757963/
24,147 Mobo http://shop.tsukumo.co.jp/goods/4529327935759/201710010420000
42,843 CPU
9,280 PSU https://www.ark-pc.co.jp/i/15600924/
14,780 Case http://shop.tsukumo.co.jp/goods/4537694191098/202510000000000
17,980 SSD http://shop.tsukumo.co.jp/goods/4988755022330/201405000000000
17,980 SSD http://shop.tsukumo.co.jp/goods/4988755022330/201405000000000
7,253 HDD http://shop.tsukumo.co.jp/goods/0718037817231/201205005000000
7,253 HDD http://shop.tsukumo.co.jp/goods/0718037817231/201205005000000
14,853 Windows 10 Home 64-bit
# this is for websocket support, takes a string message that is ostensibly JSON formatted from the browser
# formatting should be { "action": "[name of action/call/function]", "sid": [integer] }
# any other arguments will be handled by an individual function that takes care of validation
# except auth which you'll see below
try:
message = json.loads(message)
except:
self.write_message({ "wserror": { "tl_key": "invalid_json", "text": self.locale.translate("invalid_json") } })
return
var RainwaveAPI = function() {
"use strict";
// Setup ************************************************************************************************
var _sid, _url, _userID, _apiKey;
var userIsDJ;
var socket, socketStaysClosed, socketIsBusy;
var socketErrorCount = 0;
var getQueue = [];

Prerequisites

Authentication for Rainwave users is dependant on phpBB.

  • If you want users to use your site for voting, rating, and requesting, you'll have to install the latest phpBB, 3.1 or above.
  • If you're just running Rainwave for streaming audio, you do not need phpBB.
  • If you are just testing/developing locally, you do not need phpBB.

phpBB and Rainwave must share the same database. Rainwave uses phpBB's

Adding Music to your Rainwave Library

Locate the "song_dir" entry from your configuration file and copy/paste your music library to this directory.

Note: If using a remote Linux server you will need to use SFTP/SSH, or install vsftpd or similar FTP server package, to upload music to the directory.

  • Your MP3 tags must be accurate. Rainwave reads the tags to obtain track information, which is necessary to manage song rotation.
user www-data;
worker_processes auto;
error_log /var/log/nginx/error.log info;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
use epoll;
}
// ye olde ie8-compatible way
function setupTheThing(thing, i) {
thing.addEventListener("click", function() { console.log(i); });
}
var i, thing;
for (i = 0; i < 5; i++) {
thing = document.getElementById("thing" + i);
setupTheThing(thing, i);