Effective in 2026, to align with our trunk stable development model and ensure platform stability for the ecosystem, we will publish source code to AOSP in Q2 and Q4. For building and contributing to AOSP, we recommend utilizing android-latest-release instead of aosp-main. The android-latest-release manifest branch will always reference the most recent release pushed to AOSP. For more information, see Changes to AOSP.
Stay organized with collections
Save and categorize content based on your preferences.
audio_stream Struct Reference
#include <
audio.h
>
Definition at line
170
of file
audio.h
.
dump the state of the audio input/output device
Definition at line
212
of file
audio.h
.
|
size_t(* get_buffer_size)(const struct
audio_stream
*stream)
|
Return size of input/output buffer in bytes for this stream - eg. 4800. It should be a multiple of the frame size. See also get_input_buffer_size.
Definition at line
186
of file
audio.h
.
|
audio_channel_mask_t(* get_channels)(const struct
audio_stream
*stream)
|
Return the channel mask - e.g. AUDIO_CHANNEL_OUT_STEREO or AUDIO_CHANNEL_IN_STEREO
Definition at line
192
of file
audio.h
.
|
audio_devices_t(* get_device)(const struct
audio_stream
*stream)
|
Return the set of device(s) which this stream is connected to
Definition at line
215
of file
audio.h
.
|
audio_format_t(* get_format)(const struct
audio_stream
*stream)
|
Return the audio format - e.g. AUDIO_FORMAT_PCM_16_BIT
Definition at line
197
of file
audio.h
.
|
char*(* get_parameters)(const struct
audio_stream
*stream, const char *keys)
|
|
uint32_t(* get_sample_rate)(const struct
audio_stream
*stream)
|
Return the sampling rate in Hz - eg. 44100.
Definition at line
175
of file
audio.h
.
|
int(* set_device)(struct
audio_stream
*stream, audio_devices_t device)
|
Currently unused -
set_device()
corresponds to
set_parameters()
with key AUDIO_PARAMETER_STREAM_ROUTING for both input and output. AUDIO_PARAMETER_STREAM_INPUT_SOURCE is an additional information used by input streams only.
Definition at line
223
of file
audio.h
.
|
int(* set_format)(struct
audio_stream
*stream, audio_format_t format)
|
|
int(* set_parameters)(struct
audio_stream
*stream, const char *kv_pairs)
|
set/get audio stream parameters. The function accepts a list of parameter key value pairs in the form: key1=value1;key2=value2;...
Some keys are reserved for standard parameters (See AudioParameter class)
If the implementation does not accept a parameter change while the output is active but the parameter is acceptable otherwise, it must return -ENOSYS.
The audio flinger will put the stream in standby and then change the parameter value.
Definition at line
238
of file
audio.h
.
|
int(* set_sample_rate)(struct
audio_stream
*stream, uint32_t rate)
|
Put the audio hardware input/output into standby mode. Driver should exit from standby mode at the next I/O operation. Returns 0 on success and <0 on failure.
Definition at line
209
of file
audio.h
.
The documentation for this struct was generated from the following file:
-
hardware/libhardware/include/hardware/
audio.h
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2019-10-02 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2019-10-02 UTC."],[],[]]