{"id":21274049,"url":"https://github.com/flexrobotics/roboflex_audio_sdl","last_synced_at":"2025-03-15T12:43:25.510Z","repository":{"id":204793037,"uuid":"712659972","full_name":"flexrobotics/roboflex_audio_sdl","owner":"flexrobotics","description":"Roboflex audio sensor using SDL2.","archived":false,"fork":false,"pushed_at":"2023-12-05T20:48:03.000Z","size":27,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T03:12:46.151Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flexrobotics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-31T23:23:40.000Z","updated_at":"2023-11-01T00:46:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"155b2321-5193-4f4c-b94b-996aaa5e33c6","html_url":"https://github.com/flexrobotics/roboflex_audio_sdl","commit_stats":null,"previous_names":["flexrobotics/roboflex_audio_sdl"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexrobotics%2Froboflex_audio_sdl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexrobotics%2Froboflex_audio_sdl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexrobotics%2Froboflex_audio_sdl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexrobotics%2Froboflex_audio_sdl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flexrobotics","download_url":"https://codeload.github.com/flexrobotics/roboflex_audio_sdl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243732252,"owners_count":20338831,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-21T09:18:41.329Z","updated_at":"2025-03-15T12:43:25.478Z","avatar_url":"https://github.com/flexrobotics.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# roboflex.audio_sdl\n\nSupport for reading audio data using Simple Directmedia Layer.\n\n## System dependencies\n\nRequires SDL to be installed. More than likely, it already is installed in your distro. But if not:\n\n    apt-get install libsdl2-dev\n\n    # or maybe on mac:\n\n    brew install sdl2\n\n## pip install\n\n    pip install roboflex.audio_sdl\n\n## Import\n\n    import roboflex.audio_sdl as ras\n\n## Nodes\n\nThere is only one: **AudioSensor**\n\n    # all parameters optional: below are the defaults\n    audio_sensor = ras.AudioSensor(\n        capture_id = -1,\n        channels = 1,\n        sampling_rate = 48000,\n        capture_samples = 512,\n        format = ras.BitDepth.F32,\n        name = \"AudioSensor\",\n        data_key = \"data\",\n        debug = False,\n    )\n\n    # must be started (like all sensors)!\n    audio_sensor.start()\n\n    # you can get the realized channels and sampling rate (might be different from what you requested):\n    audio_sensor.sample_rate\n    audio_sensor.channels\n\n    # you can print the available detected devices, through a static method\n    ras.AudioSensor.show_devices()\n\nThis 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 \u003cdata_key\u003e.\n\n\n## Other\n\nAvailable BitDepths:\n\n    # wrapped from SDL_AudioFormat: https://wiki.libsdl.org/SDL2/SDL_AudioFormat\n\n    enum ras.BitDepth:\n        S8,\n        U8,\n        S16LSB,\n        S16MSB,\n        S16SYS,\n        S16,\n        U16LSB,\n        U16MSB,\n        U16SYS,\n        U16,\n        S32LSB,\n        S32MSB,\n        S32SYS,\n        S32,\n        F32LSB,\n        F32MSB,\n        F32SYS,\n        F32","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflexrobotics%2Froboflex_audio_sdl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflexrobotics%2Froboflex_audio_sdl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflexrobotics%2Froboflex_audio_sdl/lists"}