Skip to content
This repository was archived by the owner on Aug 30, 2025. It is now read-only.

maeda6uiui/LibSoundPlayer

Repository files navigation

LibSoundPlayer

Note

LibSoundPlayer is now part of the Mechtatel project. Check mechtatel-audio module and its test code for usage.

Overview

This is a sound player library that can be used in Java. Core part is written in Rust, using rodio.

Supported platforms

  • Linux x64
  • Windows x64
  • macOS x64 (not tested)

Installation

Maven

<dependency>
    <groupId>io.github.maeda6uiui</groupId>
    <artifactId>lib-sound-player-core</artifactId>
    <version>0.0.2</version>
</dependency>

Code example

Below is a code example for audio playback.

package com.github.maeda6uiui.libsoundplayertest;

import com.github.maeda6uiui.libsoundplayer.core.Sound;

import java.io.FileNotFoundException;

public class Main {
    public static void main(String[] args) {
        Sound sound;
        try {
            sound = new Sound("./Data/Op24.flac");
        } catch (FileNotFoundException e) {
            System.err.println(e);
            return;
        }

        sound.play();
        while (true) {
            if (sound.isFinished()) {
                break;
            }

            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                System.err.println(e);
                return;
            }
        }
    }
}

About

Sound player library

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published