Skip to main content

roboflex.audio_alsa

Support for reading audio data on linux from the Advanced Linux Sound Architecture (ALSA).

System dependencies

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

apt-get install libasound2 alsa-utils alsa-oss

Import

import numpy
import roboflex.audio_alsa as raa

Nodes

There is only one: AudioSensor

# all parameters optional: below are the defaults
audio_sensor = raa.AudioSensor(
    name = "WebcamSensor",
    channels = 1,
    sampling_rate = 48000,
    capture_frames = 512,
    produce_frames = 1024,
    bit_depth = raa.BitDepth.S16LE,
    device_name = "default",
)

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

Messages

from roboflex.audio_alsa import AudioData, AudioData32

API:

# the timestamp just before reading from device
message.t0 -> Float

# the timestamp just after reading from device
message.t1 -> Float

# the audio data read from the device
message.data -> np.array
    shape = [C, P] where C is channels, P is produce_frames
    dtype = np.int16

DYNOFLEX:

# the timestamp just before reading from device
message["t0"] -> Double

# the timestamp just after reading from device
message["t1"] -> Double

# the audio data read from the device
message.data -> np.array
    shape = [C, P] where C is channels, P is produce_frames
    dtype = np.int32

Other

Available BitDepths:

enum raa.BitDepth:
    S16LE,
    S24LE,
    S32LE,
    S24_3LE

Metadata

Release files for roboflex.audio-alsa 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-alsa 0.1.10
File Size Uploaded
roboflex.audio_alsa-0.1.10.tar.gz 10.5 kB Details

Release files / roboflex.audio_alsa-0.1.10.tar.gz

Download URL roboflex.audio_alsa-0.1.10.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
90f74f3e55d533c93f5a80199984e466f18cb54da744d1862e136a5af700c718
BLAKE2b-256 checksum
How to use checksums
33129335384ae4439df49a92e981919e6bd35168b31c22519dfb194fe38ab8d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.1.10 This release

1 release file

0.1.9

1 release file

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