{"id":13678138,"url":"https://github.com/feliwir/SharpAudio","last_synced_at":"2025-04-29T12:33:49.408Z","repository":{"id":33129812,"uuid":"152311492","full_name":"feliwir/SharpAudio","owner":"feliwir","description":"Audio playback/capturing engine for C# ","archived":false,"fork":false,"pushed_at":"2023-03-21T07:58:11.000Z","size":21376,"stargazers_count":174,"open_issues_count":17,"forks_count":19,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-11-07T19:36:21.857Z","etag":null,"topics":["audio","csharp","music","netcore","netstandard","openal","sound","wrapper","xaudio"],"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/feliwir.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,"roadmap":null,"authors":null}},"created_at":"2018-10-09T19:46:51.000Z","updated_at":"2024-10-18T21:59:19.000Z","dependencies_parsed_at":"2024-01-14T17:16:51.635Z","dependency_job_id":null,"html_url":"https://github.com/feliwir/SharpAudio","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feliwir%2FSharpAudio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feliwir%2FSharpAudio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feliwir%2FSharpAudio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feliwir%2FSharpAudio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/feliwir","download_url":"https://codeload.github.com/feliwir/SharpAudio/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224173571,"owners_count":17268135,"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":["audio","csharp","music","netcore","netstandard","openal","sound","wrapper","xaudio"],"created_at":"2024-08-02T13:00:50.501Z","updated_at":"2024-11-11T20:31:03.724Z","avatar_url":"https://github.com/feliwir.png","language":"C#","funding_links":[],"categories":["C#"],"sub_categories":[],"readme":"# SharpAudio\r\nSharpAudio is a cross-platform, backend-agnostic library to playback sounds in .NET. It achieves that by wrapping the platform specific backends.\r\n\r\nSupported backends:\r\n- XAudio2\r\n- OpenAL\r\n\r\n\r\n# Build status\r\n\r\n![Build Status](https://github.com/feliwir/SharpAudio/workflows/CI/badge.svg?branch=master\u0026event=push)\r\n![Nuget](https://img.shields.io/nuget/v/SharpAudio)\r\n\r\n# Example\r\n\r\nSharpAudio provides a low-level interface that wraps audio sources \u0026 buffers:\r\n```csharp\r\n    var engine = AudioEngine.CreateDefault();\r\n    var buffer = engine.CreateBuffer();\r\n    var source = engine.CreateSource();\r\n\r\n    // Play a 1s long sound at 440hz\r\n    AudioFormat format;\r\n    format.BitsPerSample = 16;\r\n    format.Channels = 1;\r\n    format.SampleRate = 44100;\r\n    float freq = 440.0f;\r\n    var size = format.SampleRate;\r\n    var samples = new short[size];\r\n\r\n    for (int i = 0; i \u003c size; i++)\r\n    {\r\n        samples[i] = (short)(32760 * Math.Sin((2 * Math.PI * freq) / size * i));\r\n    }\r\n\r\n    buffer.BufferData(samples, format);\r\n\r\n    source.QueueBuffer(buffer);\r\n\r\n    source.Play();\r\n```\r\n\r\nA high level interface that can load and play sound files is provided in the SharpAudio.Codec package:\r\n```csharp\r\n    var engine = AudioEngine.CreateDefault();\r\n    var soundStream = new SoundStream(File.OpenRead(\"test.mp3\"), engine);\r\n\r\n    soundStream.Volume = 0.5f;\r\n    soundStream.Play();\r\n```\r\n\r\nThe following sound formats are supported at the moment:\r\n- `.wav` (PCM \u0026 ADPCM)\r\n- `.mp3` \r\n- `.ogg` (WIP: Vorbis \u0026 Opus)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeliwir%2FSharpAudio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffeliwir%2FSharpAudio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeliwir%2FSharpAudio/lists"}