Audio devices#
YSE::device describes an audio device the engine found, and
YSE::deviceSetup names the device to open with System().openDevice().
Sessions and devices covers listing and opening devices, the
-1 device ID and 0 buffer size values, and what happens when an open
is refused.
-
namespace YSE
Public API of libYSE — sound playback, mixing, and 3D positional audio.
Entry points:
YSE::System(lifecycle and audio device),YSE::Listener(3D origin),YSE::sound(a playable source),YSE::channel(mixing tree),YSE::reverb(positioned reverb zone),YSE::patcher(modular DSP graph),YSE::player(note sequencer). Sub-namespaces group domain-specific types:YSE::DSPfor signal processing,YSE::MIDIfor MIDI I/O,YSE::MUSICfor note / chord / motif primitives.Note
Apart from their constructors, the oscillator and
vcfclasses must only be invoked from inside a DSP callback /processbody.
-
namespace YSE
Public API of libYSE — sound playback, mixing, and 3D positional audio.
Entry points:
YSE::System(lifecycle and audio device),YSE::Listener(3D origin),YSE::sound(a playable source),YSE::channel(mixing tree),YSE::reverb(positioned reverb zone),YSE::patcher(modular DSP graph),YSE::player(note sequencer). Sub-namespaces group domain-specific types:YSE::DSPfor signal processing,YSE::MIDIfor MIDI I/O,YSE::MUSICfor note / chord / motif primitives.Note
Apart from their constructors, the oscillator and
vcfclasses must only be invoked from inside a DSP callback /processbody.-
class device#
Read-only descriptor of an audio device on the host system.
Enumerated and populated by the engine — applications retrieve instances through
System().getDevices()(or the indexedgetNumDevices/getDevicepair when libYSE is linked dynamically). Use the device to inspect its name, host (ASIO / WASAPI / ALSA / …), available channel layouts, sample rates, and buffer sizes; then pass adeviceSetupderived from that info toSystem().openDevice.See also
YSE::deviceSetup
See also
Note
Do not construct directly — instances handed out by the engine are the only valid ones.
Public Functions
-
device()#
Default constructor used internally by the device enumerator.
-
device &setName(const std::string &name)#
Set the device name.
Used by the engine when populating the device list.
-
const std::string &getName() const#
Device name as reported by the host.
-
const std::string &getTypeName() const#
Host (driver) name, e.g.
ASIO,WASAPI,ALSA,JACK.
-
device &addInputChannelName(const std::string &name)#
Internal: append an input channel name to the descriptor.
-
device &addOutputChannelName(const std::string &name)#
Internal: append an output channel name to the descriptor.
-
const std::vector<std::string> &getOutputChannelNames() const#
All output channel names.
Note
Not usable across DLL boundaries — use the indexed
getNumOutputChannelNames/getOutputChannelNamepair when libYSE is linked dynamically.
-
const std::vector<std::string> &getInputChannelNames() const#
All input channel names.
Same DLL caveat as
getOutputChannelNames.
-
const std::vector<double> &getAvailableSampleRates() const#
All available sample rates.
Same DLL caveat.
-
const std::vector<int> &getAvailableBufferSizes() const#
All available buffer sizes.
Same DLL caveat.
-
unsigned int getNumOutputChannelNames() const#
Number of output channels.
-
const std::string &getOutputChannelName(unsigned int nr) const#
Name of output channel
nr.- Throws:
std::out_of_range – if
nr >= getNumOutputChannelNames().
-
unsigned int getNumInputChannelNames() const#
Number of input channels.
-
const std::string &getInputChannelName(unsigned int nr) const#
Name of input channel
nr.- Throws:
std::out_of_range – if
nr >= getNumInputChannelNames().
-
unsigned int getNumAvailableSampleRates() const#
Number of supported sample rates.
-
double getAvailableSampleRate(unsigned int nr) const#
Supported sample rate at index
nr.- Throws:
std::out_of_range – if
nr >= getNumAvailableSampleRates().
-
unsigned int getNumAvailableBufferSizes() const#
Number of supported buffer sizes.
-
int getAvailableBufferSize(unsigned int nr) const#
Supported buffer size at index
nr.- Throws:
std::out_of_range – if
nr >= getNumAvailableBufferSizes().
-
device &setDefaultBufferSize(int value)#
Set the default buffer size to use when this device is opened.
-
int getDefaultBufferSize() const#
Default buffer size for this device, or
0when the host does not advertise one.0means unspecified, not zero frames: fed todeviceSetup::setBufferSizeit asks the backend to pick the size itself (PortAudio’spaFramesPerBufferUnspecified). The PortAudio enumerator leaves it at0for every device it reports, becausePaDeviceInfocarries no equivalent field and inventing a number would be worse than saying nothing (issue #569). ReadSystem().getActiveBufferSize()after the device is open for the size actually negotiated.
-
int getOutputLatency() const#
Reported output latency in samples.
-
int getInputLatency() const#
Reported input latency in samples.
-
int getID() const#
Host-assigned ID for this device, or
-1when no device has been assigned.-1is PortAudio’spaNoDevicesentinel and the value a descriptor starts at: it means no device, not device index -1, and is what a descriptor built by hand rather than taken fromSystem().getDevices()reports untilsetIDis called (issue #666). Passing such a descriptor toSystem().openDeviceis refused with anE_AUDIODEVICElog line and leaves the running stream alone, the same as any other index no host API resolves (issue #661). Every enumerated device carries a real, non-negative index.
-
device()#
-
class device#
-
namespace YSE
Public API of libYSE — sound playback, mixing, and 3D positional audio.
Entry points:
YSE::System(lifecycle and audio device),YSE::Listener(3D origin),YSE::sound(a playable source),YSE::channel(mixing tree),YSE::reverb(positioned reverb zone),YSE::patcher(modular DSP graph),YSE::player(note sequencer). Sub-namespaces group domain-specific types:YSE::DSPfor signal processing,YSE::MIDIfor MIDI I/O,YSE::MUSICfor note / chord / motif primitives.Note
Apart from their constructors, the oscillator and
vcfclasses must only be invoked from inside a DSP callback /processbody.-
class deviceSetup#
Public Functions
-
deviceSetup()#
-
deviceSetup &setInput(const device &in)#
-
deviceSetup &setOutput(const device &out)#
-
deviceSetup &setSampleRate(double value)#
Sample rate to open the device at, in Hz.
0 (the default) means no request.
The sample rate is fixed for a whole session. When this rate differs from the session rate,
System().openDevice()logs a warning and opens the stream at the session rate (issue #971). To run at a different rate, callSystem().requestSampleRate()beforeinit().
-
deviceSetup &setBufferSize(int value)#
-
int getOutputChannels() const#
-
deviceSetup()#
-
class deviceSetup#