GithubHelp home page GithubHelp logo

umjammer / mp3spi Goto Github PK

View Code? Open in Web Editor NEW
21.0 3.0 2.0 15.07 MB

๐Ÿ”Š MP3 Java sound SPI

Home Page: https://web.archive.org/web/20210108055829/http://www.javazoom.net/mp3spi/mp3spi.html

License: GNU Lesser General Public License v2.1

Java 100.00%
java sound spi mp3 pure-java jitpack

mp3spi's Introduction

Release Java CI CodeQL Java Parent

MP3SPI

mp3 logo๐Ÿ…ฎ fraunhofer

MP3 Java Sound SPI.

Both are in pure Java.

Install

Usage

References

TODO


Original

JavaZOOM 1999-2005

Project Homepage :
http://www.javazoom.net/mp3spi/mp3spi.html

JAVA and MP3 online Forums :
http://www.javazoom.net/services/forums/index.jsp

DESCRIPTION

MP3SPI is a SPI (Service Provider Interface) that adds MP3 support for JavaSound. It allows to play MPEG 1/2/2.5 Layer 1/2/3 files thanks to underlying JLayer and Tritonus libraries. This is a non-commercial project and anyone can add his contribution. MP3SPI is licensed under LGPL (see LICENSE).

FAQ

How to install MP3SPI ?

Do I need JMF to run MP3SPI player ?

No, JMF is not required. You just need a JVM JavaSound 1.0 compliant. (i.e. JVM1.3 or higher). However, MP3SPI is not JMF compliant.

Does MP3SPI support streaming ?

Yes, it has been successfully tested with SHOUTCast and ICEcast streaming servers.

Does MP3SPI support MPEG 2.5 ?

Yes, MP3SPI includes same features as JLayer.

Does MP3SPI support VBR ?

Yes, It supports XING and VBRI VBR header too.

How to get ID3v2 tags from MP3SPI API ?

MP3SPI exposes many audio properties such as ID3v1/v2 frames, VBR, bitrate ... See online examples from MP3SPI homepage to learn how to get them. MP3SPI supports most used ID3v1.0, v1.1, v2.2, v2.3, v2.4 tags.

How to skip frames to have a seek feature ?

Call skip(long bytes) on AudioInputStream.

How to run jUnit tests ?

Run mvn test. You can update src/test/resources/test.mp3.properties file with the audio properties of the MP3 you want to use for testing.

How to enable debug/traces for the MP3SPI ?

Set the following system variable : "tritonus.TraceAudioFileReader=true" It means java.exe -Dtritonus.TraceAudioFileReader=true your.package.Player

How to contact MP3SPI developers ?

Try to post a thread on Java&MP3 online forums at : http://www.javazoom.net/services/forums/index.jsp You can also contact us at [email protected] for contributions. or me.

How to specify mp3 tag's encoding

Set the system property javazoom.spi.mpeg.encoding. e.g javazoom.spi.mpeg.encoding=MS932

mp3spi's People

Contributors

umjammer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

cc8848 dhiyu

mp3spi's Issues

provider is not loaded by JDK13Services

Caused by: java.nio.file.FileSystemNotFoundException
	at com.sun.nio.zipfs.ZipFileSystemProvider.getFileSystem(ZipFileSystemProvider.java:171)
	at com.sun.nio.zipfs.ZipFileSystemProvider.getPath(ZipFileSystemProvider.java:157)
	at java.nio.file.Paths.get(Paths.java:143)
	at javazoom.spi.mpeg.sampled.file.MpegAudioFileReader.<clinit>(MpegAudioFileReader.java:97)

[Question/Help] Is it possible to use this mvn based library with an Ant based Project?

I'm working on a project using Ant, and I need to incorporate MP3 playback and control. I came across this mp3spi library, which is based on Maven. Since I'm new to this, I'm unsure if I can use mp3spi in my Ant-based project. Additionally, I'm open to suggestions for alternative approaches to control playback and seeking. Any guidance would be greatly appreciated.

Using:

  • Netbeans 17
  • Java 8
  • Ant

monaural source is not supported (was java.lang.ArrayIndexOutOfBoundsException )

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
	at javazoom.spi.mpeg.sampled.convert.DecodedMpegAudioInputStream$DMAISObuffer.append(DecodedMpegAudioInputStream.java:292)
	at javazoom.jl.decoder.Obuffer.appendSamples(Obuffer.java:59)
	at javazoom.jl.decoder.SynthesisFilter.compute_pcm_samples(SynthesisFilter.java:1510)
	at javazoom.jl.decoder.SynthesisFilter.calculate_pcm_samples(SynthesisFilter.java:1550)
	at javazoom.jl.decoder.LayerIIIDecoder.decode(LayerIIIDecoder.java:324)
	at javazoom.jl.decoder.LayerIIIDecoder.decodeFrame(LayerIIIDecoder.java:219)
	at javazoom.jl.decoder.Decoder.decodeFrame(Decoder.java:147)
	at javazoom.spi.mpeg.sampled.convert.DecodedMpegAudioInputStream.execute(DecodedMpegAudioInputStream.java:193)
	at org.tritonus.share.TCircularBuffer.read(TCircularBuffer.java:136)
	at org.tritonus.share.sampled.convert.TAsynchronousFilteredAudioInputStream.read(TAsynchronousFilteredAudioInputStream.java:195)
	at java.desktop/com.sun.media.sound.DirectAudioDevice$DirectClip.open(DirectAudioDevice.java:1120)
	at ml.mckuhei.utils.AudioUtil.main(AudioUtil.java:77)

This is my test code:

	public static void main(String[] args) throws Exception {
		AudioInputStream audio = fromNetease(1440363337);
		audio = AudioSystem.getAudioInputStream(new AudioFormat(Encoding.PCM_SIGNED, 44100, 16, 1, 2, 44100, false) , audio);
		Clip c = AudioSystem.getClip();
		c.open(audio);
		c.start();
		Thread.sleep((long) (c.getFrameLength()/44100F)*1000L);
	}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.