src/slappy

Search:
Group by:
Source   Edit  

Types

Listener = object
Source   Edit  
Microphone = ref object
Source   Edit  
SlappyError = object of IOError
Source   Edit  
Sound = ref object
Source   Edit  
Source = ref object
Source   Edit  
StreamingSource = ref object
A source that plays sequential PCM chunks via OpenAL buffer queuing. Source   Edit  

Procs

proc bits(mic: Microphone): int {.inline, ...raises: [], tags: [], forbids: [].}
Gets the bits per sample for capture. Source   Edit  
proc bits(sound: Sound): int {.inline, ...raises: [], tags: [], forbids: [].}
Gets the bit rate or bits per sample, only 8bits and 16bits per sample supported. Source   Edit  
proc channels(mic: Microphone): int {.inline, ...raises: [], tags: [], forbids: [].}
Gets the number of capture channels. Source   Edit  
proc channels(sound: Sound): int {.inline, ...raises: [], tags: [], forbids: [].}
Gets number of channels, only 1 or 2 are supported. WARNING: 2 channel sounds can't be positioned in 3d. Source   Edit  
proc close(mic: Microphone) {....raises: [SlappyError], tags: [], forbids: [].}
Closes the capture device and releases resources. Source   Edit  
proc close(ss: StreamingSource) {....raises: [], tags: [], forbids: [].}
Stops playback and releases the OpenAL source. Source   Edit  
proc coneInnerAngle(source: Source): float32 {....raises: [], tags: [], forbids: [].}
Gets inner cone angle in degrees. Source   Edit  
proc coneInnerAngle=(source: Source; v: float32) {....raises: [], tags: [],
    forbids: [].}
Inner angle of the sound cone, in degrees. Default is 360. Source   Edit  
proc coneOuterAngle(source: Source): float32 {....raises: [], tags: [], forbids: [].}
Gets outer cone angle in degrees. Source   Edit  
proc coneOuterAngle=(source: Source; v: float32) {....raises: [], tags: [],
    forbids: [].}
Outer angle of the sound cone, in degrees. Default is 360. Source   Edit  
proc coneOuterGain(source: Source): float32 {....raises: [], tags: [], forbids: [].}
Gets source gain outside the cone. Source   Edit  
proc coneOuterGain=(source: Source; v: float32) {....raises: [], tags: [],
    forbids: [].}
The gain when outside the oriented cone. Source   Edit  
proc duration(sound: Sound): float32 {.inline, ...raises: [], tags: [], forbids: [].}
Gets duration of the sound in seconds. Source   Edit  
proc flush(ss: StreamingSource) {....raises: [], tags: [], forbids: [].}
Stops playback and discards all queued audio. Source   Edit  
proc forward(a: Mat4): Vec3 {.inline, ...raises: [], tags: [], forbids: [].}
Returns the forward direction extracted from a matrix. Source   Edit  
proc freq(sound: Sound): int {.inline, ...raises: [], tags: [], forbids: [].}
Gets the frequency or the samples per second rate. Source   Edit  
proc frequency(mic: Microphone): int {.inline, ...raises: [], tags: [], forbids: [].}
Gets the capture frequency in Hz. Source   Edit  
proc gain(listener: Listener): float32 {....raises: [], tags: [], forbids: [].}
Get master gain. Source   Edit  
proc gain(source: Source): float32 {....raises: [], tags: [], forbids: [].}
Gets source gain. Source   Edit  
proc gain=(listener: Listener; v: float32) {....raises: [], tags: [], forbids: [].}
Set Master gain. Value should be positive. Source   Edit  
proc gain=(source: Source; v: float32) {....raises: [], tags: [], forbids: [].}
Sets source gain. Source   Edit  
proc halfDistance(source: Source): float32 {....raises: [], tags: [], forbids: [].}
Gets reference distance for attenuation. Source   Edit  
proc halfDistance=(source: Source; v: float32) {....raises: [], tags: [],
    forbids: [].}
The distance under which the volume for the source would normally drop by half (before being influenced by rolloff factor or maxDistance). Source   Edit  
proc listCaptureDevices(): seq[string] {....raises: [], tags: [], forbids: [].}
Returns a list of available audio capture device names. Source   Edit  
proc looping(source: Source): bool {....raises: [], tags: [], forbids: [].}
Returns true when source looping is enabled. Source   Edit  
proc looping=(source: Source; v: bool) {....raises: [], tags: [], forbids: [].}
Enables or disables looping for the source. Source   Edit  
proc mat(listener: Listener): Mat4 {....raises: [], tags: [], forbids: [].}
Get orientation of the main listener. Source   Edit  
proc mat(source: Source): Mat4 {....raises: [], tags: [], forbids: [].}
Gets source transform from position and orientation. Source   Edit  
proc mat=(listener: Listener; mat: Mat4) {....raises: [], tags: [], forbids: [].}
Set orientation of the main listener. Source   Edit  
proc mat=(source: Source; mat: Mat4) {....raises: [], tags: [], forbids: [].}
Set source position and cone direction from a matrix. Source   Edit  
proc maxDistance(source: Source): float32 {....raises: [], tags: [], forbids: [].}
Gets max distance for attenuation. Source   Edit  
proc maxDistance=(source: Source; v: float32) {....raises: [], tags: [],
    forbids: [].}
Set the Inverse Clamped Distance Model to set the distance where there will no longer be any attenuation of the source. Source   Edit  
proc maxGain(source: Source): float32 {....raises: [], tags: [], forbids: [].}
Gets maximum source gain. Source   Edit  
proc maxGain=(source: Source; v: float32) {....raises: [], tags: [], forbids: [].}
The maximum gain for this source. Source   Edit  
proc minGain(source: Source): float32 {....raises: [], tags: [], forbids: [].}
Gets minimum source gain. Source   Edit  
proc minGain=(source: Source; v: float32) {....raises: [], tags: [], forbids: [].}
The minimum gain for this source. Source   Edit  
proc newMicrophone(deviceName: string = ""; frequency: int = 44100;
                   channels: int = 1; bits: int = 16;
                   bufferSize: int = 44100 * 10): Microphone {.
    ...raises: [SlappyError], tags: [], forbids: [].}
Opens an audio capture device for microphone input. Pass an empty deviceName for the default capture device. Source   Edit  
proc newSound(): Sound {....raises: [], tags: [], forbids: [].}
Returns an empty sound handle. Source   Edit  
proc newSound(filePath: string; forceMono: bool = true): Sound {.
    ...raises: [SlappyError, IOError, OSError, SnappyError, ValueError],
    tags: [ReadIOEffect, WriteIOEffect], forbids: [].}
Loads a sound buffer from wav, slappy, or ogg files. Files must be loaded as mono to use spatial sound features (default: true). Source   Edit  
proc newStreamingSource(frequency: int = 24000; channels: int = 1;
                        bits: int = 16): StreamingSource {.
    ...raises: [SlappyError], tags: [], forbids: [].}
Creates a streaming audio source for sequential PCM playback. Call queueData to append PCM chunks, then pump to reclaim processed buffers. Source   Edit  
proc pitch(source: Source): float32 {....raises: [], tags: [], forbids: [].}
Gets source pitch. Source   Edit  
proc pitch=(source: Source; v: float32) {....raises: [], tags: [], forbids: [].}
Sets source pitch. Source   Edit  
proc play(sound: Sound): Source {....raises: [], tags: [], forbids: [].}
Plays the sound. Source   Edit  
proc play(source: Source) {....raises: [], tags: [], forbids: [].}
Starts source playback. Source   Edit  
proc playback(source: Source): float32 {....raises: [], tags: [], forbids: [].}
Get the playback position in seconds (offset). Source   Edit  
proc playback=(source: Source; v: float32) {....raises: [], tags: [], forbids: [].}
Set playback position in seconds (offset). Source   Edit  
proc playing(source: Source): bool {.inline, ...raises: [], tags: [], forbids: [].}
Returns true when the source is currently playing. Source   Edit  
proc playing(ss: StreamingSource): bool {....raises: [], tags: [], forbids: [].}
Returns true when the streaming source is currently playing. Source   Edit  
proc pos(a: Mat4): Vec3 {.inline, ...raises: [], tags: [], forbids: [].}
Returns the position extracted from a matrix. Source   Edit  
proc pos(listener: Listener): Vec3 {....raises: [], tags: [], forbids: [].}
Get position of the main listener. Source   Edit  
proc pos(source: Source): Vec3 {....raises: [], tags: [], forbids: [].}
Gets source position. Source   Edit  
proc pos=(listener: Listener; pos: Vec3) {....raises: [], tags: [], forbids: [].}
Set position of the main listener. Source   Edit  
proc pos=(source: Source; pos: Vec3) {....raises: [], tags: [], forbids: [].}
Set source position. Source   Edit  
proc pump(ss: StreamingSource) {....raises: [], tags: [], forbids: [].}
Reclaims processed buffers to free resources. Call this periodically (e.g. each main loop iteration). Source   Edit  
proc queueData(ss: StreamingSource; data: seq[uint8]) {....raises: [], tags: [],
    forbids: [].}
Queues a chunk of raw PCM data for sequential playback. Source   Edit  
proc read(mic: Microphone; sampleCount: int): seq[uint8] {....raises: [], tags: [],
    forbids: [].}
Reads captured PCM samples as raw bytes. Source   Edit  
proc readAll(mic: Microphone): seq[uint8] {....raises: [], tags: [], forbids: [].}
Reads all available captured samples as raw bytes. Source   Edit  
proc rolloffFactor(source: Source): float32 {....raises: [], tags: [], forbids: [].}
Gets source rolloff factor. Source   Edit  
proc rolloffFactor=(source: Source; v: float32) {....raises: [], tags: [],
    forbids: [].}
Set rolloff rate for the source. Default is 1.0. Source   Edit  
proc samples(sound: Sound): int {.inline, ...raises: [], tags: [], forbids: [].}
Gets number of samples. Source   Edit  
proc samplesAvailable(mic: Microphone): int {....raises: [], tags: [], forbids: [].}
Returns the number of captured samples available for reading. Source   Edit  
proc size(sound: Sound): int {.inline, ...raises: [], tags: [], forbids: [].}
Gets the size of the sound buffer in bytes. Source   Edit  
proc slappyClose() {....raises: [SlappyError], tags: [], forbids: [].}
Call this on exit. Source   Edit  
proc slappyInit() {....raises: [SlappyError], tags: [], forbids: [].}
Call this on start of your program. Source   Edit  
proc slappyTick() {....raises: [], tags: [], forbids: [].}
Updates all sources and sounds. Source   Edit  
proc source(sound: Sound): Source {....raises: [], tags: [], forbids: [].}
Gets the source for the sound. Source   Edit  
proc start(mic: Microphone) {....raises: [], tags: [], forbids: [].}
Starts audio capture on the microphone. Source   Edit  
proc stop(mic: Microphone) {....raises: [], tags: [], forbids: [].}
Stops audio capture on the microphone. Source   Edit  
proc stop(source: Source) {....raises: [], tags: [], forbids: [].}
Stops source playback. Source   Edit  
proc stop(ss: StreamingSource) {....raises: [], tags: [], forbids: [].}
Stops playback immediately. Source   Edit  
proc toSound(mic: Microphone; data: seq[uint8]): Sound {....raises: [SlappyError],
    tags: [], forbids: [].}
Creates a playable Sound from captured PCM data. Source   Edit  
proc up(a: Mat4): Vec3 {.inline, ...raises: [], tags: [], forbids: [].}
Returns the up direction extracted from a matrix. Source   Edit  
proc vel(listener: Listener): Vec3 {....raises: [], tags: [], forbids: [].}
Get velocity of the main listener. Source   Edit  
proc vel(source: Source): Vec3 {....raises: [], tags: [], forbids: [].}
Gets source velocity. Source   Edit  
proc vel=(listener: Listener; vel: Vec3) {....raises: [], tags: [], forbids: [].}
Set velocity of the main listener. Source   Edit  
proc vel=(source: Source; vel: Vec3) {....raises: [], tags: [], forbids: [].}
Sets source velocity. Source   Edit