Types
AccessMode {.size: 4.} = enum SND_PCM_ACCESS_RW_INTERLEAVED = 3
Level = 0.0'f32 .. 1.0'f32
NativeSoundDevice = object
OpenMode {.size: 8.} = enum SND_PCM_BLOCK = 0, SND_PCM_NONBLOCK = 1
PCMFormat {.size: 4.} = enum SND_PCM_FORMAT_S16_LE = 2
Sample = array[2, int16]
snd_pcm_hw_params_p = ptr object
snd_pcm_p = ptr object
snd_pcm_sframes_t = clong
snd_pcm_uframes_t = culong
StreamMode {.size: 4.} = enum SND_PCM_STREAM_PLAYBACK = 0
Procs
proc CloseSoundDevice(soundDevice: NativeSoundDevice) {....raises: [], tags: [], forbids: [].}
proc OpenSoundDevice(sampleRate: uint32; buffers: seq[ptr SoundData]): NativeSoundDevice {. ...raises: [Exception], tags: [], forbids: [].}
proc pause(mixer: var Mixer; playbackId: uint64; value: bool) {. ...raises: [KeyError], tags: [], forbids: [].}
proc setLevel(mixer: var Mixer; playbackId: uint64; level: Level) {. ...raises: [KeyError], tags: [], forbids: [].}
proc snd_pcm_close(pcm: snd_pcm_p): cint {.importc, cdecl, dynlib: "libasound.so.2", ...raises: [], tags: [], forbids: [].}
proc snd_pcm_hw_params(pcm: snd_pcm_p; params: snd_pcm_hw_params_p): cint {. importc, cdecl, dynlib: "libasound.so.2", ...raises: [], tags: [], forbids: [].}
proc snd_pcm_hw_params_any(pcm: snd_pcm_p; params: snd_pcm_hw_params_p): cint {. importc, cdecl, dynlib: "libasound.so.2", ...raises: [], tags: [], forbids: [].}
proc snd_pcm_hw_params_free(hw_params: snd_pcm_hw_params_p) {.importc, cdecl, dynlib: "libasound.so.2", ...raises: [], tags: [], forbids: [].}
proc snd_pcm_hw_params_malloc(hw_params_ptr: ptr snd_pcm_hw_params_p): cint {. importc, cdecl, dynlib: "libasound.so.2", ...raises: [], tags: [], forbids: [].}
proc snd_pcm_hw_params_set_access(pcm: snd_pcm_p; params: snd_pcm_hw_params_p; mode: AccessMode): cint {.importc, cdecl, dynlib: "libasound.so.2", ...raises: [], tags: [], forbids: [].}
proc snd_pcm_hw_params_set_buffer_size(pcm: snd_pcm_p; params: snd_pcm_hw_params_p; size: snd_pcm_uframes_t): cint {.importc, cdecl, dynlib: "libasound.so.2", ...raises: [], tags: [], forbids: [].}
proc snd_pcm_hw_params_set_channels(pcm: snd_pcm_p; params: snd_pcm_hw_params_p; val: cuint): cint {.importc, cdecl, dynlib: "libasound.so.2", ...raises: [], tags: [], forbids: [].}
proc snd_pcm_hw_params_set_format(pcm: snd_pcm_p; params: snd_pcm_hw_params_p; format: PCMFormat): cint {.importc, cdecl, dynlib: "libasound.so.2", ...raises: [], tags: [], forbids: [].}
proc snd_pcm_hw_params_set_rate(pcm: snd_pcm_p; params: snd_pcm_hw_params_p; val: cuint; dir: cint): cint {.importc, cdecl, dynlib: "libasound.so.2", ...raises: [], tags: [], forbids: [].}
proc snd_pcm_open(pcm_ref: ptr snd_pcm_p; name: cstring; streamMode: StreamMode; openmode: OpenMode): cint {.importc, cdecl, dynlib: "libasound.so.2", ...raises: [], tags: [], forbids: [].}
proc snd_pcm_recover(pcm: snd_pcm_p; err: cint; silent: cint): cint {.importc, cdecl, dynlib: "libasound.so.2", ...raises: [], tags: [], forbids: [].}
proc snd_pcm_writei(pcm: snd_pcm_p; buffer: pointer; size: snd_pcm_uframes_t): snd_pcm_sframes_t {. importc, cdecl, dynlib: "libasound.so.2", ...raises: [], tags: [], forbids: [].}
proc startMixerThread() {....raises: [ResourceExhaustedError, Exception], tags: [RootEffect], forbids: [].}
proc WriteSoundData(soundDevice: NativeSoundDevice; buffer: int) {. ...raises: [Exception], tags: [], forbids: [].}