npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

audio-lena

v2.3.0

Published

The Lena test audio

Downloads

1,616

Readme

audio-lena stable Build Status

The Lena test audio. Returns ArrayBuffer with mp3 or wav of the record.

Appropriate for testing size (1Mb), length (~12s), noisy background, visible spectral peaks with harmonics, pitch variation, mono (not default number of channels). Good for sound recovery, sfx, filtering, decoding, encoding etc.

| Parameter | Value | |---|---| | samplesCount | 541184 | | duration | 12.27s | | numberOfChannels | 1 | | sampleRate | 44100 | | wav size | 1.03 Mb | | mp3 size | 192.8 Kb | | bitRate | 705kbps | | artist | Lena Stolze | | track title | Oh lad le | | album title | Das schreckliche Mädchen | | year | 2014 |

Usage

npm install audio-lena

// MP3 arrayBuffer
const lenaBuffer = require('audio-lena/mp3');
const context = require('audio-context')();

context.decodeAudioData(lenaBuffer, (buffer) => {
	source = context.createBufferSource();
	source.buffer = buffer;
	source.connect(context.destination);
	source.loop = true;

	source.start();
})
// Decoded arrayBuffer with float32 samples data
const buf = require('audio-lena/raw');

let lenaSamples = new Float32Array(lenaBuf)
let buffer = context.createBuffer(1, lenaSamples.length, 44100)
buffer.getChannelData(0).set(lenaSamples)

let source = context.createBufferSource();
source.buffer = buffer;
source.connect(context.destination);
source.loop = false;

source.start();
// Data-uri
const ogg = require('audio-lena/ogg-datauri')

let audio = new Audio()
audio.addEventListener('canplay', () => {
	audio.play()
})
audio.src = ogg

API

let lena = require('audio-lena')

| Entry | Meaning | |---|---| | audio-lena | Lena record constructor below. | | audio-lena/raw | ArrayBuffer with float32 samples. | | audio-lena/mp3 | ArrayBuffer with encoded mp3 data. | | audio-lena/wav | ArrayBuffer with encoded wav data. | | audio-lena/ogg | ArrayBuffer with encoded ogg data. | | audio-lena/flac | ArrayBuffer with encoded flac data. | | audio-lena/raw-base64 | Base64 string with encoded float32 samples. | | audio-lena/mp3-base64 | Base64 string with encoded mp3 data. | | audio-lena/wav-base64 | Base64 string with encoded wav data. | | audio-lena/ogg-base64 | Base64 string with encoded ogg data. | | audio-lena/flac-base64 | Base64 string with encoded flac data. | | audio-lena/raw-datauri | Data-URI string with encoded float32 samples. | | audio-lena/mp3-datauri | Data-URI string with encoded mp3 data. | | audio-lena/wav-datauri | Data-URI string with encoded wav data. | | audio-lena/ogg-datauri | Data-URI string with encoded ogg data. | | audio-lena/flac-datauri | Data-URI string with encoded flac data. |

let result = lena({format: 'mp3', type: 'float'}?)

Get lena record with defined format and type.

| Format | Meaning | |---|---| | 'mp3' | MP3-encoded data. | | 'wav' | WAV-encoded data. | | 'raw' | Raw float32 samples. | | 'ogg' | OGG-encoded samples. | | 'flac' | FLAC-encoded samples. |

| Type | Meaning | |---|---| | 'buffer' | ArrayBuffer with data. | | 'base64' | Base64-encoded string. | | 'data-uri' | Data-uri string. |

Reference

Related