Skip to content

Can't get microphone capture to work reliably in Chrome #48

@fadookie

Description

@fadookie

Nature of issue?

  • Found a bug
  • Existing feature enhancement
  • New feature request

Most appropriate sub-area of p5.js?

  • Color
  • Core/Environment/Rendering
  • Data
  • Events
  • Image
  • IO (Microphone)
  • Math
  • Typography
  • Utilities
  • WebGL
  • Other (specify if possible)

Which platform were you using when you encountered this?

  • Mobile/Tablet (touch devices)
  • Desktop/Laptop
  • Others (specify if possible)

Details about the bug:

  • p5.js version: p5.js v0.9.0 July 01, 2019
  • Web browser and version: Crome 78.0.3904.70 (Official Build) (64-bit)
  • Operating System: macOS 10.14.6 (18G103)
  • Steps to reproduce this:

I can't get microphone capture work reliably on my latest sketch: https://editor.p5js.org/fadookie/sketches/RM4wd2g8U

In the web editor, it works fine. But as soon as I download or show in fullscreen or presentation mode, I sometimes am unable to get any audio line in EVEN after waiting for a click event as suggested in the docs.

Sometimes it works without any user interaction, sometimes it never works, seemingly at random! And it's confusing because in the event the audio line in fails to start, I get a success callback from AudioIn#start rather than an error callback. I've never seen my error callback fire even once. This may be Chrome's fault, but it's making p5.js barely usable for making audio-reactive sketches.

Does anyone have any advice? Is there a more sure-fire way to wait for "user interaction" other than just waiting for a click on the canvas? Should I be re-creating the AudioIn? How can I tell my users what to do so it works? It also seems like there's a bug in #start such that errors don't actually get bubbled up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions