Skip to main content

roboflex.audio_sdl

Support for reading audio data using Simple Directmedia Layer.

System dependencies

Requires python development libraries, and numpy. To compile the c++, we suggest a virtual python environment with numpy installed.

Requires SDL to be installed. More than likely, it already is installed in your distro. But if not:

apt-get install libsdl2-dev

# or maybe on mac:

brew install sdl2

pip install

pip install roboflex.audio_sdl

Import

import roboflex.audio_sdl as ras

Nodes

There is only one: AudioSensor

# all parameters optional: below are the defaults
audio_sensor = ras.AudioSensor(
    capture_id = -1,
    channels = 1,
    sampling_rate = 48000,
    capture_samples = 512,
    format = ras.BitDepth.F32,
    name = "AudioSensor",
    data_key = "data",
    debug = False,
)

# must be started (like all sensors)!
audio_sensor.start()

# you can get the realized channels and sampling rate (might be different from what you requested):
audio_sensor.sample_rate
audio_sensor.channels

# you can print the available detected devices, through a static method
ras.AudioSensor.show_devices()

This sensor publishes a TensorMessage, with the audio data encoded into a tensor of shape (C, S), where C is num channels, and S is capture_samples, under the key <data_key>.

Other

Available BitDepths:

# wrapped from SDL_AudioFormat: https://wiki.libsdl.org/SDL2/SDL_AudioFormat

enum ras.BitDepth:
    S8,
    U8,
    S16LSB,
    S16MSB,
    S16SYS,
    S16,
    U16LSB,
    U16MSB,
    U16SYS,
    U16,
    S32LSB,
    S32MSB,
    S32SYS,
    S32,
    F32LSB,
    F32MSB,
    F32SYS,
    F32

Metadata

Release files for roboflex.audio-sdl 0.1.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for roboflex.audio-sdl 0.1.10
File Size Uploaded
roboflex_audio_sdl-0.1.10.tar.gz 9.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for roboflex.audio-sdl 0.1.10
File Interpreter ABI Platform
roboflex_audio_sdl-0.1.10-cp311-cp311-macosx_15_0_arm64.whl CPython 3.11 CPython 3.11 macOS 15.0+ ARM64 Details

Total release size: 1.2 MB

Release files / roboflex_audio_sdl-0.1.10.tar.gz

Download URL roboflex_audio_sdl-0.1.10.tar.gz
Size 9.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d274b8f354c05c09b9b58066a8cb7211fba691c0af6896a104e57b33db0efaf4
BLAKE2b-256 checksum
How to use checksums
9daf88f0c4a81747e6e244448a91ead9e8b7fdcc7d7cf9b2742f7afb56789d5d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.5

Release files / roboflex_audio_sdl-0.1.10-cp311-cp311-macosx_15_0_arm64.whl

Download URL roboflex_audio_sdl-0.1.10-cp311-cp311-macosx_15_0_arm64.whl
Size 1.2 MB
Tags CPython 3.11 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
7162db109960f1757a12ee4a365cfd7cdc3a7ab8ddd975cc4b5860d7dc6a89af
BLAKE2b-256 checksum
How to use checksums
2b768e49e3bca8947de362d671aea5681ad2f6f9808b3f02304905b34e0c9920
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.5

Release history Release notifications | RSS feed

This release

0.1.10 This release

2 release files

0.1.9

2 release files

0.1.8

1 release file

0.1.7

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page