sysaudio: read/write callback design goal #1099
Labels
No labels
CI
all
basisu
blog
bug
build
contributor-friendly
core
correctness
deferred
dev
direct3d-headers
docs
driver-os-issue
duplicate
dxcompiler
editor
examples
experiment
feature-idea
feedback
flac
freetype
gamemode
gkurve
glfw
gpu
gpu-dawn
harfbuzz
help welcome
in-progress
infrastructure
invalid
libmach
linux-audio-headers
long-term
mach
mach.gfx
mach.math
mach.physics
mach.testing
model3d
needs-triage
object
opengl-headers
opus
os/linux
os/macos
os/wasm
os/windows
package-manager
priority
proposal
proposal-accepted
question
roadmap
slipped
stability
sysaudio
sysgpu
sysjs
validating-fix
vulkan-zig-generated
wayland-headers
website
wontfix
wrench
www
x11-headers
xcode-frameworks
zig-update
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
hexops/mach#1099
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@alichraghi I think we should work towards this API design:
Notes:
_: ?*anyopaqueparameter is replaced by a typed generic context parameter. The user can decide this type, andctx: voidwould be a valid choice. They would need to pass this type into the player create API or similar.input: []const u8is replaced byraw_audio: []const u8to hint that it is raw audio in the devices' native format, whatever that may be.recorder.readis replaced bysysaudio.convertto make it super clear that function is converting samples for you.recorder: sysaudio.Recorderis now a parameter toreadCallback, and player towriteCallback.recorder.channels,recorder.format.size(), etc.num_samplesinstead offrames, "frames" has a specific meaning in audio processing. 1 sample == 1 sample, but 1 frame == multiple samples (one for each channel.) Don't confuse the two.Do you mean locking in a specific type to the callback function? Why not have a gen function so the user could choose whatever context type she wants, whether a recorder or something else? (Add a flag to generate a function signature with a Player and we have a choice between all variants)
Your proposal would lock out the library from use in audio dev.
@plaukiu
ctx: Contextis a generic type specified atcreatePlayer/createRecorder. here is an example: