Skip to content

Instantly share code, notes, and snippets.

@mohayonao
Created December 13, 2015 22:31
Show Gist options
  • Select an option

  • Save mohayonao/f675267a8dd7c0a30116 to your computer and use it in GitHub Desktop.

Select an option

Save mohayonao/f675267a8dd7c0a30116 to your computer and use it in GitHub Desktop.
class AudioBuffer {
@TestAPI.props.readonly()
duration() {
return this.length / this.sampleRate;
}
@TestAPI.methods.param("destination", Float32Array)
@TestAPI.methods.param("channelNumber", "positive number")
@TestAPI.methods.param("[ startInChannel ]", "positive number")
@TestAPI.methods.contract({
precondition(destination, channelNumber, startInChannel = 0) {
if (this._.length <= startInChannel) {
throw new TypeError(``);
}
}
})
@TestAPI.versions({ chrome: "43-", firefox: "27-", safari: "none" })
copyFromChannel(destination, channelNumber, startInChannel = 0) {
/* ... */
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment