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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@flo-audio/reflo

v0.1.2

Published

WebAssembly audio converter for the flo™ audio format

Readme

reflo

Audio format converter for the flo™ audio format. Available on crates.io! https://crates.io/crates/reflo

Features

  • Convert audio files to/from flo™ format
  • Support for multiple input formats (MP3, WAV, FLAC, OGG, AAC, etc.)
  • Both lossless and lossy compression modes
  • Metadata preservation (tags, cover art, lyrics, etc.)
  • Cross-platform: Native (CLI) and WebAssembly (browser)
  • Pure Rust implementation using Symphonia

Installation

As a CLI tool (Native)

cargo install --path . --features cli

Or build from source:

cargo build --release --features cli

The binary will be available at target/release/flo.

As a library

Add to your Cargo.toml:

[dependencies]
reflo = { path = "path/to/reflo" }

For WebAssembly

Install wasm-pack:

cargo install wasm-pack

Build for web:

wasm-pack build --target web --features wasm --no-default-features

This generates a pkg/ directory with:

  • reflo.js - JavaScript bindings
  • reflo_bg.wasm - WebAssembly binary
  • TypeScript definitions

Usage

CLI

# Encode to flo (lossless)
flo encode input.mp3 output.flo

# Encode with lossy compression
flo encode input.wav output.flo --lossy --quality high

# Encode with target bitrate
flo encode input.flac output.flo --lossy --bitrate 320

# Decode to WAV
flo decode input.flo output.wav

# Show file info
flo info input.flo

# Show metadata
flo metadata input.flo

# Validate file
flo validate input.flo

Rust Library

use reflo::{encode_from_audio, decode_to_wav, EncodeOptions};
use std::fs;

// Read audio file
let audio_bytes = fs::read("input.mp3")?;

// Encode with options
let options = EncodeOptions::lossy(0.6) // High quality
    .with_level(5);

let flo_bytes = encode_from_audio(&audio_bytes, options)?;
fs::write("output.flo", flo_bytes)?;

// Decode
let flo_bytes = fs::read("output.flo")?;
let wav_bytes = decode_to_wav(&flo_bytes)?;
fs::write("output.wav", wav_bytes)?;

WebAssembly

<!DOCTYPE html>
<html>
<head>
    <script type="module">
        import init, { 
            encode_audio_to_flo, 
            decode_flo_to_wav,
            get_flo_file_info 
        } from './pkg-reflo/reflo.js';

        async function convertAudio() {
            await init();
            
            // Get file from input
            const file = document.getElementById('input').files[0];
            const audioBytes = new Uint8Array(await file.arrayBuffer());
            
            // Encode to flo (lossy, high quality)
            const floBytes = encode_audio_to_flo(
                audioBytes,
                true,  // lossy
                0.6,   // quality (0.0-1.0)
                5      // compression level
            );
            
            // Get info
            const info = get_flo_file_info(floBytes);
            console.log('Sample rate:', info.sample_rate);
            console.log('Channels:', info.channels);
            console.log('Compression:', info.compression_ratio);
            
            // Decode back to WAV
            const wavBytes = decode_flo_to_wav(floBytes);
            
            // Download
            const blob = new Blob([wavBytes], { type: 'audio/wav' });
            const url = URL.createObjectURL(blob);
            const a = document.createElement('a');
            a.href = url;
            a.download = 'output.wav';
            a.click();
        }
    </script>
</head>
<body>
    <input type="file" id="input" accept="audio/*">
    <button onclick="convertAudio()">Convert</button>
</body>
</html>

API Reference

Library Functions

  • encode_from_audio(bytes, options) - Encode audio to flo format
  • encode_from_samples(samples, sr, ch, metadata, options) - Encode raw samples
  • decode_to_wav(bytes) - Decode flo to WAV format
  • decode_to_samples(bytes) - Decode to raw samples
  • get_metadata(bytes) - Extract metadata from flo file
  • get_flo_info(bytes) - Get file information
  • get_audio_info(bytes) - Get audio file information
  • validate_flo(bytes) - Validate flo file integrity

WebAssembly Functions

  • encode_audio_to_flo(audio_bytes, lossy, quality, level) - Encode to flo
  • decode_flo_to_wav(flo_bytes) - Decode to WAV
  • decode_flo_to_samples(flo_bytes) - Decode to raw samples (returns object)
  • get_flo_file_info(flo_bytes) - Get file info
  • get_audio_file_info(audio_bytes) - Get audio info
  • get_flo_metadata_json(flo_bytes) - Get metadata as JSON
  • validate_flo_file(flo_bytes) - Validate file

Architecture

The crate is structured for maximum code reuse:

reflo/
├── src/
│   ├── lib.rs      # Core library API (cross-platform)
│   ├── audio.rs    # Audio I/O using Symphonia
│   ├── main.rs     # CLI binary (feature: cli)
│   └── wasm.rs     # WASM bindings (feature: wasm)

Cross-Platform Design

  • Core logic in lib.rs works with Vec<u8> for portability
  • Audio I/O in audio.rs uses Symphonia (works on all targets)
  • CLI interface in main.rs adds file system operations
  • WASM interface in wasm.rs adds JavaScript bindings

No platform-specific code in the core - it all works on native and WASM!

Building

# Native CLI
cargo build --release --features cli

# Library only
cargo build --release --no-default-features

# WebAssembly
wasm-pack build --target web --features wasm --no-default-features

# All features (for testing)
cargo build --all-features

License

Apache 2.0 License - see LICENSE