
Research
/Security News
Mini Shai-Hulud Campaign Hits Red Hat Cloud Services npm Packages
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.
wav-file-decoder
Advanced tools
A simple decoder for WAV audio files.
NPM package: wav-file-decoder
Online demo: www.source-code.biz/snippets/typescript/wavFileDecoder
Examples of how to use it: github.com/chdh/wav-file-decoder/tree/main/test/src
Compagnion package: wav-file-encoder
function isWavFile (fileData: ArrayBufferView | ArrayBuffer) : boolean
fileData: An ArrayBufferView
(e.g. Uint8Array
or Node.js Buffer)
or an ArrayBuffer
that contains the raw data bytes of a WAV file.true if the file looks like a valid and supported WAV file.function decodeWavFile (fileData: ArrayBufferView | ArrayBuffer) : AudioData
fileData: An ArrayBufferView
(e.g. Uint8Array
or Node.js Buffer)
or an ArrayBuffer
that contains the raw data bytes of a WAV file.interface AudioData {
channelData: Float32Array[]; // arrays containing the audio samples (PCM data), one array per channel
sampleRate: number; // sample rate (samples per second)
numberOfChannels: number; // number of channels, same as channelData.length
audioEncoding: AudioEncoding; // audio encoding in the WAV file (int or float)
bitsPerSample: number; // number of bits per sample in the WAV file
wavFileTypeName: string; // combination of audioEncoding and bitsPerSample, e.g. "int16" or "float32"
}
enum AudioEncoding {
pcmInt, // 0 = PCM integer
pcmFloat // 1 = PCM float
}
The audio sample values in the channelData arrays are within the range -1 to +1.
An exception is thrown when the passed file is not a WAV file or when the format of the WAV file is not supported.
FAQs
A simple decoder for WAV audio files
The npm package wav-file-decoder receives a total of 524 weekly downloads. As such, wav-file-decoder popularity was classified as not popular.
We found that wav-file-decoder 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 mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.

Security News
The Rust project is moving toward formal rules on LLM use in contributions after months of internal debate over maintainer burden, code quality, and contributor experience.