Bots Home
|
Create an App
beeperbot
Author:
selfworshipingtest
Description
Source Code
Launch Bot
Current Users
Created by:
Selfworshipingtest
//override flash tip function getTipVolumeLevelFromSetting(volumeLevel) { return 1.0; } var tipVol = parseInt("30"); var beepBuffers = {}; var audioCtx; var gainNode; try { audioCtx = new (window.AudioContext || window.webkitAudioContext)(); gainNode = audioCtx.createGain(); gainNode.connect(audioCtx.destination); } catch (e) { // } var beepFiles = { "tiny": "https://ssl-ccstatic.highwebmedia.com/sounds/tiny.mp3", "small":"https://ssl-ccstatic.highwebmedia.com/sounds/small.mp3", "medium":"https://ssl-ccstatic.highwebmedia.com/sounds/medium.mp3", "large":"https://ssl-ccstatic.highwebmedia.com/sounds/large.mp3", "huge":"https://ssl-ccstatic.highwebmedia.com/sounds/huge.mp3", "show":"https://ssl-ccstatic.highwebmedia.com/sounds/show.mp3" }; function loadSource(key) { var request = new XMLHttpRequest(); request.open('GET', beepFiles[key], true); request.responseType = 'arraybuffer'; request.onload = function () { // Decode the audio once the require is complete audioCtx.decodeAudioData(this.response, function (buffer) { beepBuffers[key] = buffer; }, function (e) { //console.log('Audio error! ', e); }); }; // Send the request which kicks off request.send(); } function loadSources() { if (!audioCtx) { return } for (var key in beepFiles) { if (beepFiles.hasOwnProperty(key)) { loadSource(key); } } } function PlayBeep(level) { if (audioCtx) { var buffer = beepBuffers[level] || beepBuffers['small']; if (buffer && tipVol > 0.0) { var source = audioCtx.createBufferSource(); source.buffer = buffer; source.connect(gainNode); source.loop = false; gainNode.gain.value = getTipVolumeLevelFromSetting(tipVol); source.start(0); } return; } var soundName = beepFiles[level] || beepFiles['small']; var sound = new Audio(soundName); if (tipVol > 0.0) { sound.volume = getTipVolumeLevelFromSetting(tipVol); sound.play(); } } cb.setTimeout(function(){ PlayBeep('huge'); },2000); function SetTipVolume(level) { tipVol = parseInt(level); } var supportsFlashPermissionRequest = (function () { // Disabling the auto for now return false; // There's no way I know of to query for support of this feature so we're left // with user agent sniffing. Note that order IS important here: Edge pretends // to be both Chrome and Safari, and Chrome pretends to be Safari. Safari, // bless it, doesn't pretend to be anything more than // Mozilla/5.0 (KHTML, like Gecko). // Safari Desktop >= 10 var safariMatch = navigator.userAgent.match( /version\/(\d+).+?(mobile\/\w+? )?safari/i ); if (safariMatch) { return safariMatch[1] >= 10 && !safariMatch[2]; } // Edge >= 15 var edgeMatch = navigator.userAgent.match(/edge\/(\d+).+?/i); if (edgeMatch) { return edgeMatch[1] >= 15; } // Chrome Desktop >= 57 var chromeMatch = navigator.userAgent.match(/chrome\/v?(\d+).+?/i); if (chromeMatch) { return chromeMatch[1] >= 57; } return false; })(); var ws_prefix = 'wss://'; var ws_suffix = '/originws'; var token_url = "/api/generate_new_auth_token/"; var status_url = "/api/get_my_broadcast_status/";
© Copyright Chaturbate 2011- 2025. All Rights Reserved.