libminau

Crates.iolibminau
lib.rslibminau
version0.1.0
created_at2025-10-10 16:31:13.393439+00
updated_at2025-10-10 16:31:13.393439+00
descriptionA library version of Minau, a music player built directly on top of Symphonia and CPAL.
homepage
repository
max_upload_size
id1877162
size150,584
木葉 (sirasaki-konoha)

documentation

README

Crates.io License

This is the library version of Minau, a music player built directly on Symphonia and CPAL. It provides simple functionality for playing audio from local files or URLs.

Key Features

  • Wide Format Support: Can decode many audio formats supported by Symphonia, such as MP3, FLAC, Ogg Vorbis, WAV, and more.
  • Cross-Platform: Thanks to CPAL, audio playback is supported on major platforms including Windows, macOS, and Linux.
  • Network Streaming: Supports playing music via HTTP/HTTPS.
  • Metadata Retrieval: Uses Lofty to read track tags (artist, album, etc.) and track duration.
  • Playlist Support: Can parse playlists in M3U format.

Installation

Add the following line to your Cargo.toml:

// filepath: Cargo.toml
// ...existing code...
[dependencies]
libminau = "0.1.0"
// ...existing code...

Usage

Here is a basic example for playing a local music file:

use libminau::player::Player;
use std::time::Duration;

#[tokio::main]
fn main() -> anyhow::Result<()> {
    // Play a local file
    let mut player = Player::from_file("/path/to/music.mp3")?;
    // If you want to specify a URL, use Player::from_url
    // let mut player = Player::from_url("https://example.com/music.mp3").await?;
    
    // Set volume
    player.set_volume(0.7)?;

    // Start playback
    player.play()?;

    println!("Playback started.");

    // Wait for the music to finish
    player.wait_until_finished().await;

    println!("Playback finished.");

    Ok(())
}

License

This project is released under the BSD-3-Clause license.

Commit count: 0

cargo fmt