source-academy / modules

Modules that can be imported by programs in Source Academy, an online experiential environment for computational thinking
Apache License 2.0
8 stars 28 forks source link

[sound]: documentation: `play_wave` #310

Open martin-henz opened 4 months ago

martin-henz commented 4 months ago
import { play_wave } from "sound";
const pi = math_PI;
play_wave(t => math_sin(2 * pi * t * 440), true); // true should be 1

gives confusing error message:

Line 3: Error: play is expecting sound, but encountered t => t >= duration ? 0 : wave(t),true