Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                
              
            
!

CSS

              
                
              
            
!

JS

              
                !function(){return; // 本来不要な行

// あらかじめgetUserMediaのポリフィルが読み込まれています
// https://github.com/lig-dsktschy/ligfes20160426/blob/gh-pages/01/js/getusermedia-commented.js

'use strict';

var ctx, analyser, frequencies, getByteFrequencyDataAverage;

window.AudioContext = window.AudioContext || window.webkitAudioContext;
ctx = new AudioContext();

// AnalyserNodeオブジェクトを生成
analyser = context.createAnalyser();
// 解析対象の音声データを格納するための型付き配列を準備(Uint8Array:符号なし8bit整数の配列)
// 引数(配列の要素数)にはAnalyserNodeオブジェクトのfrequencyBinCountプロパティを設定する
frequencies = new Uint8Array(analyser.frequencyBinCount);

// 音量として、解析結果の全周波数の振幅の平均を取得する
getByteFrequencyDataAverage = function() {
    // 配列に周波数ごとの振幅を格納
    analyser.getByteFrequencyData(frequencies);
    // 解析結果の全周波数の振幅を、合計し、要素数で割ることで、平均を求める
    return frequencies.reduce(function(previous, current) {
        return previous + current;
    }) / analyser.frequencyBinCount;
};

navigator.mediaDevices.getUserMedia({audio: true})
    .then(function(stream) {
        window.hackForMozzila = stream;
        ctx.createMediaStreamSource(stream).connect(ctx.destination);
    })
    .catch(function(err) {
        alert(err.message);
    });

}(); // 本来不要な行
              
            
!
999px

Console