A partir de 27 de março de 2025, recomendamos usar android-latest-release
em vez de aosp-main
para criar e contribuir com o AOSP. Para mais informações, consulte Mudanças no AOSP.
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Referência da estrutura audio_stream_in
#include <
audio.h
>
Definição na linha
404
do arquivo
audio.h
.
int(* get_capture_position)(const struct
audio_stream_in
*stream, int64_t *frames, int64_t *time)
|
Retorna uma contagem recente do número de frames de áudio recebidos e o tempo do relógio associado a essa contagem de frames.
frames é a contagem total de frames recebidos. Isso precisa ser feito o mais cedo possível no pipeline de captura. Em geral, os frames não podem ser negativos e não podem ir "para trás".
time é o tempo MONOTONIC do relógio quando os frames foram medidos. Em geral, o tempo precisa ser uma quantidade positiva e não pode ir "para trás".
O status retornado é 0 em caso de sucesso, -ENOSYS se o dispositivo não estiver pronto/disponível ou -EINVAL se os argumentos forem nulos ou inválidos.
Definição na linha
449
do arquivo
audio.h
.
Retorna a quantidade de frames de entrada perdidos no driver de áudio desde a última chamada dessa função. Espera-se que o driver de áudio redefina o valor para 0 e reinicie a contagem ao retornar o valor atual por essa chamada de função. Essa perda geralmente ocorre quando o processo do espaço do usuário é bloqueado por mais tempo do que a capacidade dos buffers do driver de áudio.
Unidade: o número de frames de áudio de entrada
Definição na linha
433
do arquivo
audio.h
.
ssize_t(* read)(struct
audio_stream_in
*stream, void *buffer, size_t bytes)
|
Leitura do buffer de áudio do driver de áudio. Retorna o número de bytes lidos ou um status_t negativo. Se pelo menos um frame foi lido antes do erro, a leitura precisa retornar essa contagem de bytes e, em seguida, retornar um erro na chamada subsequente.
Definição na linha
420
do arquivo
audio.h
.
definir o ganho de entrada para o driver de áudio. Este método é para uso futuro
Definição na linha
414
do arquivo
audio.h
.
A documentação desse struct foi gerada com base no seguinte arquivo:
-
hardware/libhardware/include/hardware/
audio.h
O conteúdo e os exemplos de código nesta página estão sujeitos às licenças descritas na Licença de conteúdo. Java e OpenJDK são marcas registradas da Oracle e/ou suas afiliadas.
Última atualização 2025-07-27 UTC.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Não contém as informações de que eu preciso","missingTheInformationINeed","thumb-down"],["Muito complicado / etapas demais","tooComplicatedTooManySteps","thumb-down"],["Desatualizado","outOfDate","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Problema com as amostras / o código","samplesCodeIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-07-27 UTC."],[],[],null,["# Android Hardware Abstraction Layer: audio_stream_in Struct Reference\n\naudio_stream_in Struct Reference\n================================\n\n[Data Fields](#pub-attribs) \naudio_stream_in Struct Reference \n\n`\n#include \u003c\n`[audio.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/audio.h)`\n\u003e\n`\n\n|-----------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Data Fields ----------- ||\n| struct [audio_stream](/reference/hal/structaudio__stream) | [common](/reference/hal/structaudio__stream__in#a9975d0888d3a4eecf4f0144ea954a80f) |\n| ||\n| int(\\* | [set_gain](/reference/hal/structaudio__stream__in#a928a709953a9cf43e9594699946d968b) )(struct [audio_stream_in](/reference/hal/structaudio__stream__in) \\*stream, float gain) |\n| ||\n| ssize_t(\\* | [read](/reference/hal/structaudio__stream__in#ae29cb94a8369b1b06cdfc51b3ef3d61d) )(struct [audio_stream_in](/reference/hal/structaudio__stream__in) \\*stream, void \\*buffer, size_t bytes) |\n| ||\n| uint32_t(\\* | [get_input_frames_lost](/reference/hal/structaudio__stream__in#ac35c041acf754e3ec3e83763080e8209) )(struct [audio_stream_in](/reference/hal/structaudio__stream__in) \\*stream) |\n| ||\n| int(\\* | [get_capture_position](/reference/hal/structaudio__stream__in#a7049256b82aad74e1dc976a3d5406985) )(const struct [audio_stream_in](/reference/hal/structaudio__stream__in) \\*stream, int64_t \\*frames, int64_t \\*time) |\n| ||\n\n\nDetailed Description\n--------------------\n\n\nDefinition at line\n[404](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/audio.h)\nof file\n[audio.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/audio.h)\n.\n\nField Documentation\n-------------------\n\n\n|------------------------------------------------------------------|\n| struct [audio_stream](/reference/hal/structaudio__stream) common |\n\n\nCommon methods of the audio stream in. This\n*must*\nbe the first member of\n[audio_stream_in](/reference/hal/structaudio__stream__in)\nas users of this structure will cast a\n[audio_stream](/reference/hal/structaudio__stream)\nto\n[audio_stream_in](/reference/hal/structaudio__stream__in)\npointer in contexts where it's known the\n[audio_stream](/reference/hal/structaudio__stream)\nreferences an\n[audio_stream_in](/reference/hal/structaudio__stream__in)\n.\n\n\nDefinition at line\n[410](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/audio.h)\nof file\n[audio.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/audio.h)\n.\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------|\n| int(\\* get_capture_position)(const struct [audio_stream_in](/reference/hal/structaudio__stream__in) \\*stream, int64_t \\*frames, int64_t \\*time) |\n\n\nReturn a recent count of the number of audio frames received and the clock time associated with that frame count.\n\n\nframes is the total frame count received. This should be as early in the capture pipeline as possible. In general, frames should be non-negative and should not go \"backwards\".\n\n\ntime is the clock MONOTONIC time when frames was measured. In general, time should be a positive quantity and should not go \"backwards\".\n\n\nThe status returned is 0 on success, -ENOSYS if the device is not ready/available, or -EINVAL if the arguments are null or otherwise invalid.\n\n\nDefinition at line\n[449](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/audio.h)\nof file\n[audio.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/audio.h)\n.\n\n|---------------------------------------------------------------------------------------------------------------|\n| uint32_t(\\* get_input_frames_lost)(struct [audio_stream_in](/reference/hal/structaudio__stream__in) \\*stream) |\n\n\nReturn the amount of input frames lost in the audio driver since the last call of this function. Audio driver is expected to reset the value to 0 and restart counting upon returning the current value by this function call. Such loss typically occurs when the user space process is blocked longer than the capacity of audio driver buffers.\n\n\nUnit: the number of input audio frames\n\n\nDefinition at line\n[433](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/audio.h)\nof file\n[audio.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/audio.h)\n.\n\n|--------------------------------------------------------------------------------------------------------------------------|\n| ssize_t(\\* read)(struct [audio_stream_in](/reference/hal/structaudio__stream__in) \\*stream, void \\*buffer, size_t bytes) |\n\n\nRead audio buffer in from audio driver. Returns number of bytes read, or a negative status_t. If at least one frame was read prior to the error, read should return that byte count and then return an error in the subsequent call.\n\n\nDefinition at line\n[420](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/audio.h)\nof file\n[audio.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/audio.h)\n.\n\n|---------------------------------------------------------------------------------------------------------|\n| int(\\* set_gain)(struct [audio_stream_in](/reference/hal/structaudio__stream__in) \\*stream, float gain) |\n\n\nset the input gain for the audio driver. This method is for for future use\n\n\nDefinition at line\n[414](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/audio.h)\nof file\n[audio.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/audio.h)\n.\n\n*** ** * ** ***\n\nThe documentation for this struct was generated from the following file:\n\n- hardware/libhardware/include/hardware/ [audio.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/audio.h)"]]