鈍足ランナーのIT日記

走るのが好きな5流のITエンジニアのブログ。

趣味の範囲は広いけど、どれも中途半端なクソブロガー楽しめるWebアプリを作ってあっと言わせたい。サーバーサイドPerl(Mojolicious)、クライアントサイドVue.js。Arduinoにも触手を伸ばす予定。

Firefoxでマイク録音後数秒で切れる場合の対処方法

firefoxでの録音の挙動がおかしい

十数秒くらいかな。録音は動作するのですが、 それ以降切れてしまう。

https://support.mozilla.org/ja/questions/1002387?esab=a&s=&r=57&as=s

結局 windowに保存してあげれば、大丈夫とのこと。

audio - HTML5 Microphone capture stops after 5 seconds in Firefox - Stack Overflow

Recoder.jsのサンプルhtmlをこんな感じにしてあげれば大丈夫です。

  function startUserMedia(stream) {
    var input = audio_context.createMediaStreamSource(stream);
    __log('Media stream created.');
    
    window.saved = input;
    input.connect(audio_context.destination);
    __log('Input connected to audio context destination.');
    
    recorder = new Recorder(input);
    __log('Recorder initialised.');
  }