{"id":22281079,"url":"https://github.com/almoghamdani/audify","last_synced_at":"2025-04-07T17:10:43.358Z","repository":{"id":42961233,"uuid":"227816913","full_name":"almoghamdani/audify","owner":"almoghamdani","description":"Play/Stream/Record PCM audio data \u0026 Encode/Decode Opus to PCM audio data","archived":false,"fork":false,"pushed_at":"2024-04-03T00:54:39.000Z","size":1019,"stargazers_count":112,"open_issues_count":15,"forks_count":18,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-04-06T19:23:34.000Z","etag":null,"topics":["alsa","asio","audio","coreaudio","decoder","encoder","jack","nodejs","opus","oss","pcm","play","pulseaudio","rtaudio","stream","wasapi"],"latest_commit_sha":null,"homepage":"","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/almoghamdani.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}},"created_at":"2019-12-13T10:41:29.000Z","updated_at":"2024-04-27T15:40:42.975Z","dependencies_parsed_at":"2024-04-15T06:59:24.694Z","dependency_job_id":"226e1b52-95b9-4ccc-9c7b-9703969d9a76","html_url":"https://github.com/almoghamdani/audify","commit_stats":{"total_commits":220,"total_committers":7,"mean_commits":"31.428571428571427","dds":0.2090909090909091,"last_synced_commit":"94b2fe79dc528fda2c7d59c7a0fd0e9de07dc3dc"},"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/almoghamdani%2Faudify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/almoghamdani%2Faudify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/almoghamdani%2Faudify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/almoghamdani%2Faudify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/almoghamdani","download_url":"https://codeload.github.com/almoghamdani/audify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247694876,"owners_count":20980733,"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":["alsa","asio","audio","coreaudio","decoder","encoder","jack","nodejs","opus","oss","pcm","play","pulseaudio","rtaudio","stream","wasapi"],"created_at":"2024-12-03T16:13:44.460Z","updated_at":"2025-04-07T17:10:43.304Z","avatar_url":"https://github.com/almoghamdani.png","language":"C++","readme":"[![npm version](https://badge.fury.io/js/audify.svg)](https://www.npmjs.com/package/audify)\n[![Master Build Status](https://github.com/almoghamdani/audify/actions/workflows/commit-build.yml/badge.svg?branch=master)](https://github.com/almoghamdani/audify/actions/workflows/commit-build.yml)\n[![Prebuilt Build Status](https://github.com/almoghamdani/audify/actions/workflows/deploy-build.yml/badge.svg)](https://github.com/almoghamdani/audify/actions/workflows/deploy-build.yml)\n\n# Audify.js\n\nAudify.js - Play/Stream/Record PCM audio data \u0026amp; Encode/Decode Opus to PCM audio data\n\n## Features\n\n- Encode 16-bit integer PCM or floating point PCM to Opus packet using C++ Opus library.\n- Decode Opus packets to 16-bit integer PCM or floating point PCM using C++ Opus library.\n- Complete API for realtime audio input/output across Linux (native ALSA, JACK, PulseAudio and OSS), Macintosh OS X (CoreAudio and JACK), and Windows (DirectSound, ASIO and WASAPI) operating systems using C++ RtAudio library.\n\n## Installation\n\n```\nnpm install audify\n```\n\n**_Most regular installs will support prebuilds that are built with each release._**\n\n**_Prebuilds are available for Node/Electron versions that support N-API 5-9._**\n\n#### Requirements for source build\n\n- Node or Electron versions that support N-API 5 and up ([N-API Node Version Matrix](https://nodejs.org/docs/latest/api/n-api.html#node-api-version-matrix))\n- [CMake](http://www.cmake.org/download/)\n- A proper C/C++ compiler toolchain of the given platform\n  - **Windows**:\n    - [Visual C++ Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/) or a recent version of Visual C++ will do ([the free Community](https://www.visualstudio.com/products/visual-studio-community-vs) version works well)\n  - **Unix/Posix**:\n    - Clang or GCC\n    - Ninja or Make (Ninja will be picked if both present)\n\n## Example\n\n#### Opus Encode \u0026 Decode\n\n```javascript\nconst { OpusEncoder, OpusDecoder, OpusApplication } = require(\"audify\");\n\n// Init encoder and decoder\n// Sample rate is 48kHz and the amount of channels is 2\n// The opus coding mode is optimized for audio\nconst encoder = new OpusEncoder(48000, 2, OpusApplication.OPUS_APPLICATION_AUDIO);\nconst decoder = new OpusDecoder(48000, 2);\n\nconst frameSize = 1920; // 40ms\nconst buffer = ...\n\n// Encode and then decode\nvar encoded = encoder.encode(buffer, frameSize);\nvar decoded = decoder.decode(encoded, frameSize);\n```\n\n#### Record audio and play it back realtime\n\n```javascript\nconst { RtAudio, RtAudioFormat } = require(\"audify\");\n\n// Init RtAudio instance using default sound API\nconst rtAudio = new RtAudio(/* Insert here specific API if needed */);\n\n// Open the input/output stream\nrtAudio.openStream(\n  {\n    deviceId: rtAudio.getDefaultOutputDevice(), // Output device id (Get all devices using `getDevices`)\n    nChannels: 1, // Number of channels\n    firstChannel: 0, // First channel index on device (default = 0).\n  },\n  {\n    deviceId: rtAudio.getDefaultInputDevice(), // Input device id (Get all devices using `getDevices`)\n    nChannels: 1, // Number of channels\n    firstChannel: 0, // First channel index on device (default = 0).\n  },\n  RtAudioFormat.RTAUDIO_SINT16, // PCM Format - Signed 16-bit integer\n  48000, // Sampling rate is 48kHz\n  1920, // Frame size is 1920 (40ms)\n  \"MyStream\", // The name of the stream (used for JACK Api)\n  (pcm) =\u003e rtAudio.write(pcm) // Input callback function, write every input pcm data to the output buffer\n);\n\n// Start the stream\nrtAudio.start();\n```\n\n## Documentation\n\nFull documentation available [here](https://almoghamdani.github.io/audify/).\n\n## Legal\n\nThis project is licensed under the MIT license.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falmoghamdani%2Faudify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falmoghamdani%2Faudify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falmoghamdani%2Faudify/lists"}