Windows runs timeSetEvent's callbacks at time-critical priority. On
macOS a program not in the foreground, as on the CI runner, gets a
lower quality of service, whose timed waits the system lets run late
to save power, so a 10 ms periodic timer lost ticks and audiotest saw
fewer than five in 300 ms. The timer thread now asks for interactive
service. audiotest prints the count and the time when the check fails.
Signed-off-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
On the macOS runner a thread's sleep can overshoot by much more than a
20 ms chunk, and the recording catches up in a burst that filled the
0.1 s buffer before the test first saw a position. Buffers of 0.4 s
leave room for that while still checking that a stop hands back a
part-filled one.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
iotest calls GetEnvironmentStringsA only without UNICODE, where the
SDK headers name it. wintest's symbol font check needs Wingdings on
Windows, which Wine does not have, so it is skipped there when the
font is missing. Wine's MMIO_DELETE reports success but leaves the
file, so audiotest checks that the file is gone only elsewhere.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
waveInStop threw away the chunk being read when it stopped, so a
recording stopped soon after it started could hand back an empty
buffer, as on the macOS runner. The stop now waits for that read and
keeps it; only waveInReset discards. audiotest waits until some sound
has come in before stopping, and bounds the periodic timer's ticks by
how long its sleep really took.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
GetEnvironmentStrings(W) and FreeEnvironmentStrings give a copy of the
environment; GetUserName the login name; Beep plays its tone through the
sound device. SHGetFolderPath and SHGetSpecialFolderPath give the XDG
folders and the home folder on Linux (CSIDL_APPDATA is ~/.config,
CSIDL_PROFILE is the home folder) and the ~/Library folders on macOS,
creating them with CSIDL_FLAG_CREATE.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
Sound goes to ALSA on Linux (libasound, loaded at run time) and to audio
queues on macOS, or to a loopback device (WINPORT_AUDIO=null) that keeps
time and records what was played. waveOut and waveIn convert any format
the built-in ACM driver reads (PCM, float, A-law, mu-law, IMA ADPCM, at
any rate and channels) for the device, with callbacks, loops, pause,
positions and volume. The ACM enumerates, suggests and converts those
formats; mmio reads and writes RIFF files on disk and in memory;
PlaySound plays files, resources and images; timeSetEvent runs timers on
threads. windows.h includes mmsystem.h, as the system's does.
audiotest covers it, through the loopback device natively.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>