Skip to content

Conversation

mikelgg93
Copy link
Member

@mikelgg93 mikelgg93 commented Sep 9, 2025

Summary

This PR adds support for audio streaming to the Python Client of the Realtime API.

Status

✅ Ready to be merged

Changes

  • A new AudioFrame class for handling audio data.
  • An RTSPAudioStreamer for streaming audio from an RTSP source, including a resampler (s16) for playback. src/pupil_labs/realtime_api/streaming/audio.py
  • A fake sensor for audio, which is part of the RTSP channel for video.
  • It uses a fork of aiortsp, once everything is ready we can do a PR to that library.
  • An au_unit for extracting AAC payloads.
  • Add direct_audio_sensor
  • Allow media_type audio and include it on the streamer so it gets the adequate class.
  • New async examples for:
    • Plotting the audio spectrum.
    • Playing back audio.
    • Playing back audio with a gaze overlay.
  • Simple classes for audio and matched elements, and simple examples, inc. audio playback and STT.
  • Docs.
  • Implemented AudioPlayer to perform playback of audio in a background process, not blocking.

mikelgg93 and others added 6 commits September 9, 2025 16:31
- Fake sensor as the audio is on the RTSP channel for video.
- Add AudioFrame class, RTSPAudioStreamer and receive audio_frames including a resampler to s16, such that sounddevice can play it back.
- Add direct_audio_sensor
- Add au_unit to extract AAC payloads.
- Allow media_type audio and include it on the streamer so it gets the adequate class.
- Adds async examples to plot audio frames as spectrum bar, to play back audio signal and to play audio signal with gaze overaly.

- WIP Implement simple classes for audio and matched elements.
- WIP Simple examples
… simple audio stream to work.

- Add RingBuffer and AudioPlayer classes to perform audio playback efficiently on a bkg process
- Add simple examples for playback, transcription and audio reception
- Examples group dependency updates.
@mikelgg93 mikelgg93 changed the title WIP feat(audio): Add audio support for the realtime. feat(audio): Add audio support for the realtime. Sep 19, 2025
return self._size


class AudioPlayer(mp.Process):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, the AudioPlayer class (and its dependencies, like sounddevice) is out of scope for the API client. This should be moved to examples

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants