|
ESPHome 2026.11.0-dev
|
A speaker or microphone platform that streams through the hub. The hub calls it on the main loop only. More...
#include <usb_audio.h>
Public Member Functions | |
| USBAudioStream (uint32_t buffer_size) | |
| uint32_t | get_buffer_size () const |
| virtual audio::AudioStreamInfo | get_usb_stream_info ()=0 |
| The fixed format the hub opens the stream with. | |
| virtual void | on_stream_state (StreamEvent event)=0 |
| virtual bool | stream_idle () const =0 |
| No platform task is inside a read or write call on the device; the hub closes a lost device only then. | |
| virtual void | on_transfer_taken () |
| Speaker only: the driver tried to take its next transfer from the ring buffer, which it does each time a transfer completes and on each write, and takes it only when the ring buffer holds all of it. | |
Protected Attributes | |
| uint32_t | buffer_size_ |
A speaker or microphone platform that streams through the hub. The hub calls it on the main loop only.
Definition at line 39 of file usb_audio.h.
|
inlineexplicit |
Definition at line 41 of file usb_audio.h.
|
inline |
Definition at line 43 of file usb_audio.h.
|
pure virtual |
The fixed format the hub opens the stream with.
Implemented in esphome::usb_audio::USBAudioMicrophone, and esphome::usb_audio::USBAudioSpeaker.
|
pure virtual |
Implemented in esphome::usb_audio::USBAudioMicrophone, and esphome::usb_audio::USBAudioSpeaker.
|
inlinevirtual |
Speaker only: the driver tried to take its next transfer from the ring buffer, which it does each time a transfer completes and on each write, and takes it only when the ring buffer holds all of it.
Called on the USB driver's task or inside a write.
Reimplemented in esphome::usb_audio::USBAudioSpeaker.
Definition at line 52 of file usb_audio.h.
|
pure virtual |
No platform task is inside a read or write call on the device; the hub closes a lost device only then.
Implemented in esphome::usb_audio::USBAudioMicrophone, and esphome::usb_audio::USBAudioSpeaker.
|
protected |
Definition at line 55 of file usb_audio.h.