This class implements a custom low latency USB audio stack for Android, fully bypassing the Android system audio stack. More...
#include "SuperpoweredAndroidUSB.h"
Static Public Member Functions | |
static bool | easyIO (int deviceID, int samplerate, int bitsPerSample, int numInputChannels, int numOutputChannels, AndroidUSBAudioBufferSize bufferSize, void *clientdata, AndroidUSBAudioProcessingCallback callback) |
static void | getBestIO (int deviceID, int *inputIOindex, int *outputIOindex, int samplerate, int bitsPerSample, int numInputChannels, int numOutputChannels, bool strict) |
Returns with the best input and output index for some audio parameters. More... | |
static void | getConfigurationInfo (int deviceID, int *numConfigurations, char ***configurationNames) |
Get information about a USB audio device's configurations. More... | |
static void | getInfo (int deviceID, const char **manufacturer, const char **product, const char **info) |
Get basic information about a USB audio device. More... | |
static int | getInputs (int deviceID, AndroidUSBAudioIOInfo **info) |
static void | getIOOptions (int deviceID, bool input, int IOindex, int **paths, char ***pathNames, int *numPaths, int **thruPaths, char ***thruPathNames, int *numThruPaths) |
Returns with information about an input or output. More... | |
static int | getOutputs (int deviceID, AndroidUSBAudioIOInfo **info) |
static void | getPathInfo (int deviceID, int pathIndex, int *numFeatures, float **minVolumes, float **maxVolumes, float **curVolumes, char **mutes) |
Returns with information about an audio path. More... | |
static void | setConfiguration (int deviceID, int configurationIndex) |
Set the active configuration of USB audio device. More... | |
static bool | setMute (int deviceID, int pathIndex, int channel, bool mute) |
static float | setVolume (int deviceID, int pathIndex, int channel, float db) |
static bool | startIO (int deviceID, int inputIOindex, int outputIOindex, AndroidUSBAudioBufferSize bufferSize, void *clientdata, AndroidUSBAudioProcessingCallback callback) |
static void | stopIO (int deviceID) |
Stops audio input/output. More... | |
This class implements a custom low latency USB audio stack for Android, fully bypassing the Android system audio stack.
It simplifies the unlimited possibilities of the USB Audio Class to a hierarchy with 3 levels:
|
static |
deviceID | Device identifier. |
samplerate | Preferred sample rate in Hz. |
bitsPerSample | Preferred bit depth. |
numInputChannels | Preferred number of input channels. Set to 0 if you are not interested in audio input. |
numOutputChannels | Preferred number of output channels. Set to 0 if you are not interested in audio output. |
bufferSize | Buffer size |
clientdata | Custom pointer for the callback. |
callback | The callback to be called periodically. |
|
static |
Returns with the best input and output index for some audio parameters.
deviceID | Device identifier. |
inputIOindex | Returns the best input index. |
outputIOindex | Returns the best output index. |
samplerate | Sample rate in Hz. |
bitsPerSample | Bit depth. |
numInputChannels | Number of input channels. Set to 0 if you are not interested in input. |
numOutputChannels | Number of output channels. Set to 0 if you are not interested in output. |
strict | Set to true to return with indexes fully matching the parameters. Set to false to return with indexes matching the parameters as close as possible. |
|
static |
Get information about a USB audio device's configurations.
deviceID | Device identifier. |
numConfigurations | Number of configurations. |
configurationNames | Name of each configuration. |
|
static |
Get basic information about a USB audio device.
deviceID | Device identifier. |
manufacturer | Manufacturer name. |
product | Product name. |
info | Detailed USB information about the device. |
|
static |
deviceID | Device identifier. |
info | Array of AndroidUSBAudioIOInfo for each input. |
|
static |
Returns with information about an input or output.
deviceID | Device identifier. |
input | True for input, false for output. |
IOindex | The index of the input or output. |
paths | Returns the path indexes. |
pathNames | Returns the path names. |
numPaths | Returns the number of paths. |
thruPaths | Returns the audio-thru path indexes (input only). |
thruPathNames | Returns the audio-thru path names (input only). |
numThruPaths | Returns the number of audio-thru paths (input only). |
|
static |
deviceID | Device identifier. |
info | Array of AndroidUSBAudioIOInfo for each output. |
|
static |
Returns with information about an audio path.
deviceID | Device identifier. |
pathIndex | Path index. |
numFeatures | Returns the number of features (the size of the minVolumes, maxVolumes, curVolumes and mutes arrays). |
minVolumes | Minimum volume values in db. |
maxVolumes | Maximum volume values in db. |
curVolumes | Current volume values in db. |
mutes | Current mute values (1 muted, 0 not muted). |
|
static |
Set the active configuration of USB audio device.
deviceID | Device identifier. |
configurationIndex | Index of the configuration, starting from 0. |
|
static |
deviceID | Device identifier. |
pathIndex | Path index. |
channel | Channel number (starting from 0). |
mute | Mute. |
|
static |
deviceID | Device identifier. |
pathIndex | Path index. |
channel | Channel number (starting from 0). |
db | Volume in decibels. |
|
static |
deviceID | Device identifier. |
inputIOindex | Input index. |
outputIOindex | Output index. |
bufferSize | Buffer size. |
clientdata | Custom pointer for the callback. |
callback | The callback to be called periodically. |
|
static |
Stops audio input/output.
deviceID | Device identifier. |