{"id":19791511,"url":"https://github.com/naudio/nlayer","last_synced_at":"2025-05-15T12:04:48.022Z","repository":{"id":30577605,"uuid":"34132623","full_name":"naudio/NLayer","owner":"naudio","description":"MPEG 1 \u0026 2 Decoder for Layers 1, 2, \u0026 3","archived":false,"fork":false,"pushed_at":"2024-10-30T14:26:57.000Z","size":101,"stargazers_count":132,"open_issues_count":14,"forks_count":32,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-14T23:16:54.225Z","etag":null,"topics":["audio","csharp","mp3"],"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/naudio.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-04-17T18:17:02.000Z","updated_at":"2025-04-30T14:20:40.000Z","dependencies_parsed_at":"2024-10-30T15:35:49.638Z","dependency_job_id":null,"html_url":"https://github.com/naudio/NLayer","commit_stats":{"total_commits":29,"total_committers":12,"mean_commits":"2.4166666666666665","dds":0.6206896551724138,"last_synced_commit":"1a29c8fe9584eb79fd8096342d8417587e85d230"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naudio%2FNLayer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naudio%2FNLayer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naudio%2FNLayer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naudio%2FNLayer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/naudio","download_url":"https://codeload.github.com/naudio/NLayer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254337612,"owners_count":22054253,"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","mp3"],"created_at":"2024-11-12T07:03:33.607Z","updated_at":"2025-05-15T12:04:43.008Z","avatar_url":"https://github.com/naudio.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NLayer\n\nNLayer is a fully managed MP3 to WAV decoder. The code was originally based \non [JavaLayer](http://www.javazoom.net/javalayer/javalayer.html) (v1.0.1), \nwhich has been ported to C#.\n\nWas previously hosted at [nlayer.codeplex.com](http://nlayer.codeplex.com/). \nPlease see the history there for full details of contributors.\n\n## Usage\n\nTo use NLayer for decoding MP3, first reference NLayer.\n\n```cs\nusing NLayer;\n```\n\nThen create an `MpegFile`, pass a file name or a stream to the constructor, and use `ReadSamples` for decoding the content:\n\n```cs\n// samples per second times channel count\nconst int samplesCount = 44100;\nvar fileName = \"myMp3File.mp3\";\nvar mpegFile = new MpegFile(filename);\nfloat[] samples = new float[samplesCount];\nint readCount = mpegFile.ReadSamples(samples, 0, samplesCount);\n```\n\nMore information could be found in code documents.\n\n## Use with NAudio\n\nNLayer is capable of using in conjunction with [NAudio](https://github.com/naudio/NAudio/)\nfor file conversion and real-time playback.\n\nYou need to reference NAudio, NLayer and NLayer.NAudioSupport first.\n\n```cs\nusing NAudio.Wave;\nusing NLayer.NAudioSupport;\n```\n\nThen create an `Mp3FileReader`, passing in a `FrameDecompressorBuilder` that uses the `Mp3FrameDecompressor` from NLayer.NAudioSupport:\n\n```cs\nvar fileName = \"myMp3File.mp3\";\nvar builder = new Mp3FileReader.FrameDecompressorBuilder(wf =\u003e new Mp3FrameDecompressor(wf));\nvar reader = new Mp3FileReaderBase(fileName, builder);\n// play or process the file, e.g.:\nwaveOut.Init(reader);\nwaveOut.Play();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaudio%2Fnlayer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaudio%2Fnlayer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaudio%2Fnlayer/lists"}