
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
AMR audio codec is an audio compression format optimized for speech coding. Since AMR is not a supported web audio format, this library provides an implementation of AMR for use in the web.
Note: Currently this library only supports narrowband AMR.
# Using npm
npm install web-amr
# Using yarn
yarn add web-amr
# Using pnpm
pnpm add web-amr
import { AMRPlayer } from "web-amr";
const player = AMRPlayer(buffer); // pass file as ArrayBuffer
If the buffer failed to be decoded, player.error
will be set. You can check for player.error?.message
before proceeding.
The returned player
instance implements a subset of the HTMLMediaElement
API. Hence, you can use it as a drop-in for a real HTML5 audio player. It might be that this subset of APIs is all that you need from both; in that case, it's safe to do this:
import type { Player } from "web-amr";
// assume we have isAMR, audioElement, file,
// and a function "read" that returns ArrayBuffer
if (!isAMR) audioElement.src = file;
else audioElement.remove();
const player: Player = isAMR ? AMRPlayer(read(file)) : audioElement;
// use player normally
player.play();
addEventListener
Appends an event listener for events. The callback argument sets the callback that will be invoked when the event is dispatched.
removeEventListener
Removes the event listener in target's event listener list with the same type and callback.
play: (): Promise<void>
Loads and starts playback of the AMR audio.
pause: (): Promise<void>
Pauses the current playback.
fastSeek: (seconds: number): Promise<void>
Sets the current playback position, in seconds.
duration: number
Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available.
currentTime: number
Gets or sets the current playback position, in seconds.
readonly
paused: boolean
Gets a flag that specifies whether playback is paused.
readonly
ended: boolean
Gets information about whether the playback has ended or not.
readonly
error: MediaError | null
Returns an object representing the current error state of the audio.
Use pnpm
as your package manager while installing dependencies. Make sure pnpm build
runs without an error before raising a PR.
This project uses an emscripten build of OpenCORE-AMR from yxl.
FAQs
AMR Player for the web
The npm package web-amr receives a total of 124 weekly downloads. As such, web-amr popularity was classified as not popular.
We found that web-amr demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.