Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save colinbdclark/338ef0ecd7bccb9337caf978b9efb467 to your computer and use it in GitHub Desktop.
Save colinbdclark/338ef0ecd7bccb9337caf978b9efb467 to your computer and use it in GitHub Desktop.
Test file for a bug in the Chrome's Web Audio API implementation on macOS that only recognizes 2 output channels, even for interfaces with more.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Multichannel USB Audio Interfaces Only Report Two Output Channels on macOS</title>
<style>
body {
font-family: sans-serif;
text-align: center;
}
#question {
padding-top: 2em;
font-size: 1.5em;
}
#numChannels {
font-style: bold;
font-size: 10em;
}
</style>
</head>
<body>
<p id="question">
According to the Web Audio API, how many output channels does the current audio device have?
</p>
<div id="numChannels"></div>
<script>
var ac = new AudioContext();
var numChannels = ac.destination.maxChannelCount;
document.getElementById("numChannels").innerHTML = numChannels;
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment