Plugins:PepperAudioAPI: Difference between revisions

Jump to navigation Jump to search
Line 616: Line 616:
with both input channel(s) and output channel(s), audio can stream
with both input channel(s) and output channel(s), audio can stream
isochronously on the same callback.
isochronously on the same callback.
</pre>
=====queryCapability() Details=====
This section goes into more detail on what queryCapability() returns based on the input
enum.
<pre>
notes:
queryCapability() can be called before initializeContext to probe
capabilities of the audio device. queryCapability() should only be
called from the NPAPI thread. If the output parameter is NULL,
queryCapability will return NPERR_INVALID_PARAM.
queryCapability(npp, NPAudioCapabilitySampleRate, &value)
output value:
Current 'native' sample rate of the underlying audio system. If an
application can use this rate, less upsampling/downsampling is
likely to occur at the driver level.
NPAudioSampleRate44100Hz
NPAudioSampleRate48000Hz
NPAudioSampleRate96000Hz
notes:
Both NPAudioSampleRate44100Hz and NPAudioSampleRate48000Hz are
always available, and will be upsampled/downsampled as needed. By
querying for the native sample rate, an application can avoid
implicit sample rate conversion.
queryCapability(npp, NPAudioCapabilitySampleType, &value)
output value:
Native sample format of the underlying audio system
NPAudioSampleTypeInt16
NPAudioSampleTypeFloat32
notes:
NPAudioSampleTypeInt16 will always be available. By querying for
the sample format, an application may be able to discover higher
quality output formats.
queryCapability(npp, NPAudioCapabilitySampleFrameCount, &value)
Query the audio system for the sample buffer frame count recommended by
NPAudioQuerySampleRate.
output value:
Native sample buffer size of the underlying audio system ranging
from NPAudioMinSampleFrameCount...NPAudioMaxSampleFrameCount.
This sample buffer frame count relates to the sample rate returned
by queryCapability(npp, NPAudioCapabilitySampleRate, &sampleRate)
notes:
Upon successful initialization of the audio system, an application
will always be able to request and obtain the native sample buffer
frame count when specifying the sample frequency returned by
NPAudioQuerySampleRate.
queryCapability(npp, NPAudioCapabilitySampleFrameCount44100Hz, &value)
Query the audio system for the sample buffer frame count to use for
44.1kHz output.
output value:
Recommended sample buffer frame count ranging from
NPAudioMinSampleFrameCount...NPAudioMaxSampleFrameCount.
notes:
Upon successful initialization of the audio system at 44.1kHz, an
application will always be able to request and obtain this sample
buffer frame count.
queryCapability(npp, NPAudioQuerySampleFrameCount48000Hz, &value)
Query the audio system for the sample buffer frame count to use for
48kHz output.
output value:
Recommended sample buffer frame count ranging from
NPAudioMinSampleFrameCount...NPAudioMaxSampleFrameCount.
notes:
Upon successful initialization of the audio system at 48kHz, an
application will always be able to request and obtain this buffer
frame count.
queryCapability(npp, NPAudioCapabilitySampleFrameCount96000Hz, &value)
Query the audio system for the sample buffer frame count to use for
96kHz output.
output value:
Recommended sample buffer frame count ranging from
NPAudioMinSampleFrameCount...NPAudioMaxSampleFrameCount.
notes:
Upon successful initialization of the audio system at 96kHz, an
application will always be able to request and obtain this buffer
frame count.
queryCapability(npp, NPAudioCapabilityOutputChannelMap, &value)
Query the audio system for the output/speaker arrangement.
output value:
NPAudioChannelNone
NPAudioChannelMono
NPAudioChannelStereo
NPAudioChannelThree
NPAudioChannelFour
NPAudioChannelFive
NPAudioChannelFiveLFE
NPAudioChannelSeven
NPAudioChannelSevenLFE
notes:
Upon successful initialization of the audio system, an application
will always be able to request and obtain this channel setup.
Additionally, NPAudioChannelMono and NPAudioChannelStereo will
always be available, regardless of physical speaker configuration:
mono output -> mono speaker, or
mono output -> center speaker, or
mono output -> left & right speakers
stereo output -> left & right speakers, or
stereo output -> mono speaker
queryCapability(npp, NPAudioCapabilityInputChannelMap, &value)
Query the audio system for the input/microphone arrangement.
output value:
NPAudioChannelNone
NPAudioChannelMono
NPAudioChannelStereo
NPAudioChannelThree
NPAudioChannelFour
NPAudioChannelFive
NPAudioChannelSeven
notes:
Upon successful initialization of the audio system, an application
will always be able to request and obtain this channel setup. If
NPAudioChannelNone is returned, either the device has no input, or
the implementation doesn't support audio input.
</pre>
</pre>
11

edits

Navigation menu