Audio: Select a shared audio device by default (#574)

* Audio: Select a shared audio device by default

This ensures that a non-raw audio device is selected wherever possible.

* Audio: Resolve libsoundio version mismatch between bindings and binaries

It turns out we were using bindings generated with libsoundio 1.1.0 git source, but the binaries we were using were built from master git source. I've rebuilt both binaries and bindings to ensure they are version matched.

This should resolve all outstanding issues with libsoundio (including the Linux segfault issue, and the "cannot open device" Windows issue).

* Audio: Reformat MarshalExtensions

* Resolve code indentation issues
This commit is contained in:
jduncanator 2019-02-13 12:59:26 +11:00 committed by GitHub
parent f73c11744e
commit c734137f41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 225 additions and 151 deletions

View file

@ -77,6 +77,12 @@ namespace SoundIOSharp
}
static readonly int software_latency_offset = (int)Marshal.OffsetOf<SoundIoOutStream> ("software_latency");
public float Volume {
get { return MarshalEx.ReadFloat (handle, volume_offset); }
set { MarshalEx.WriteFloat (handle, volume_offset, value); }
}
static readonly int volume_offset = (int)Marshal.OffsetOf<SoundIoOutStream> ("volume");
// error_callback
public Action ErrorCallback {
get { return error_callback; }
@ -237,5 +243,12 @@ namespace SoundIOSharp
return *dptr;
}
}
public void SetVolume (double volume)
{
var ret = (SoundIoError) Natives.soundio_outstream_set_volume (handle, volume);
if (ret != SoundIoError.SoundIoErrorNone)
throw new SoundIOException (ret);
}
}
}