{"id":15634737,"url":"https://github.com/goxr3plus/java-stream-player","last_synced_at":"2025-04-04T15:07:12.551Z","repository":{"id":37587735,"uuid":"107994469","full_name":"goxr3plus/java-stream-player","owner":"goxr3plus","description":"🌌Java Advanced Audio Controller Library (WAV, AU, AIFF, MP3, OGG VORBIS, FLAC, MONKEY's AUDIO and SPEEX audio formats )","archived":false,"fork":false,"pushed_at":"2024-10-03T18:43:53.000Z","size":5620,"stargazers_count":153,"open_issues_count":33,"forks_count":34,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-28T14:05:58.342Z","etag":null,"topics":["aiff","au","flac","mp3","ogg","speex","wav"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/goxr3plus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":"GOXR3PLUSTUDIO","open_collective":null,"ko_fi":"goxr3plusstudio","tidelift":null,"custom":"https://www.paypal.me/GOXR3PLUSCOMPANY"}},"created_at":"2017-10-23T14:33:38.000Z","updated_at":"2025-03-20T08:17:40.000Z","dependencies_parsed_at":"2024-10-23T03:23:18.888Z","dependency_job_id":null,"html_url":"https://github.com/goxr3plus/java-stream-player","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goxr3plus%2Fjava-stream-player","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goxr3plus%2Fjava-stream-player/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goxr3plus%2Fjava-stream-player/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goxr3plus%2Fjava-stream-player/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/goxr3plus","download_url":"https://codeload.github.com/goxr3plus/java-stream-player/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247198450,"owners_count":20900080,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aiff","au","flac","mp3","ogg","speex","wav"],"created_at":"2024-10-03T10:56:09.103Z","updated_at":"2025-04-04T15:07:12.533Z","avatar_url":"https://github.com/goxr3plus.png","language":"Java","funding_links":["https://patreon.com/GOXR3PLUSTUDIO","https://ko-fi.com/goxr3plusstudio","https://www.paypal.me/GOXR3PLUSCOMPANY","https://ko-fi.com/Q5Q3WBIC","https://patreon.com/preview/8adae1b75d654b2899e04a9e1111f0eb"],"categories":[],"sub_categories":[],"readme":"[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/Q5Q3WBIC)\n\n---  \n \n\u003ch3 align=\"center\" \u003e Java Stream Player ( Library )\u003c/h3\u003e     \n\u003cp align=\"center\"\u003e     \n🎶 \n\u003c/p\u003e  \n\u003cp align=\"center\"\u003e\n\u003csup\u003e\n\u003cb\u003eJava Audio Controller Library with (skip,skipTo,start,stop,pause,play,restart) \u003c/b\u003e\n\u003cb\u003e This is the next version of \u003ca href=\"http://www.javazoom.net/jlgui/api.html\" target=\"_blank\"\u003eJavaZoom BasicPlayer\u003c/a\u003e \u003c/b\u003e \n\u003c/sup\u003e \n\u003c/p\u003e   \n \n---\n\n[![Latest Version](https://img.shields.io/github/release/goxr3plus/java-stream-player.svg?style=flat-square)](https://github.com/goxr3plus/java-stream-player/releases)\n[![HitCount](http://hits.dwyl.io/goxr3plus/java-stream-player.svg)](http://hits.dwyl.io/goxr3plus/java-stream-player)\n\u003ca href=\"https://patreon.com/preview/8adae1b75d654b2899e04a9e1111f0eb\" title=\"Donate to this project using Patreon\"\u003e\u003cimg src=\"https://img.shields.io/badge/patreon-donate-yellow.svg\" alt=\"Patreon donate button\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://www.paypal.me/GOXR3PLUSCOMPANY\" title=\"Donate to this project using Paypal\"\u003e\u003cimg src=\"https://img.shields.io/badge/paypal-donate-yellow.svg\" alt=\"PayPal donate button\" /\u003e\u003c/a\u003e\n\n### What audio formats it supports?\n- **Fully Supported ✔️**\n  - WAV\n  - MP3\n- **Partially not full tested 🚧**\n  -  OGG VORBIS\n  -  FLAC\n  -  MONKEY's AUDIO\n  -  SPEEX\n- **Not Supported Yet ❌** \n  -  AAC\n  -  THEORA\n  -  ... all the others\n\n\n### Step 1.  Add the JitPack repository to your build file\nhttps://jitpack.io/private#goxr3plus/java-stream-player\n``` XML\n\u003crepositories\u003e\n\t\u003crepository\u003e\n\t   \u003cid\u003ejitpack.io\u003c/id\u003e\n\t   \u003curl\u003ehttps://jitpack.io\u003c/url\u003e\n        \u003c/repository\u003e\n\u003c/repositories\u003e\n```\n\n###  Step 2. Add the dependency\n``` XML\n\u003cdependency\u003e\n   \u003cgroupId\u003ecom.github.goxr3plus\u003c/groupId\u003e\n   \u003cartifactId\u003ejava-stream-player\u003c/artifactId\u003e\n   \u003cversion\u003e9.0.4\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nExample usage :\n\n``` JAVA\nimport java.io.File;\nimport java.util.Map;\n\nimport com.goxr3plus.streamplayer.enums.Status;\nimport com.goxr3plus.streamplayer.stream.StreamPlayer;\nimport com.goxr3plus.streamplayer.stream.StreamPlayerListener;\nimport com.goxr3plus.streamplayer.stream.StreamPlayerEvent;\nimport com.goxr3plus.streamplayer.stream.StreamPlayerException;\n\n/**\n * @author GOXR3PLUS\n *\n */\npublic class Main extends StreamPlayer implements StreamPlayerListener {\n\n    private final String audioAbsolutePath = \"Logic - Ballin [Bass Boosted].mp3\";\n\n    /**\n     * Constructor\n     */\n    public Main() {\n\n        try {\n\n            // Register to the Listeners\n            addStreamPlayerListener(this);\n\n            // Open a File\n            // open(new File(\"...\")) //..Here must be the file absolute path\n            // open(INPUTSTREAM)\n            // open(AUDIOURL)\n\n            // Example\n            open(new File(audioAbsolutePath));\n\n            // Seek by bytes\n            // seekBytes(500000L);\n\n            // Seek +x seconds starting from the current position\n            seekSeconds(15);\n            seekSeconds(15);\n\n            /* Seek starting from the begginning of the audio */\n            // seekTo(200);\n\n            // Play it\n            play();\n            // pause();\n\n        } catch (final Exception ex) {\n            ex.printStackTrace();\n        }\n\n    }\n\n    @Override\n    public void opened(final Object dataSource, final Map\u003cString, Object\u003e properties) {\n\n    }\n\n    @Override\n    public void progress(final int nEncodedBytes, final long microsecondPosition, final byte[] pcmData,\n            final Map\u003cString, Object\u003e properties) {\n\n        // System.out.println(\"Encoded Bytes : \" + nEncodedBytes);\n\n        // Current time position in seconds:) by GOXR3PLUS STUDIO\n        // This is not the more precise way ...\n        // in XR3Player i am using different techniques .\n        // https://github.com/goxr3plus/XR3Player\n        // Just for demostration purposes :)\n        // I will add more advanced techniques with milliseconds , microseconds , hours\n        // and minutes soon\n\n        // .MP3 OR .WAV\n        final String extension = \"mp3\"; // THE SAMPLE Audio i am using is .MP3 SO ... :)\n\n        long totalBytes = getTotalBytes();\n        if (\"mp3\".equals(extension) || \"wav\".equals(extension)) {\n\n            // Calculate the progress until now\n            double progress = (nEncodedBytes \u003e 0 \u0026\u0026 totalBytes \u003e 0) ? (nEncodedBytes * 1.0f / totalBytes * 1.0f)\n                    : -1.0f;\n            // System.out.println(progress*100+\"%\");\n\n            System.out.println(\"Seconds  : \" + (int) (microsecondPosition / 1000000) + \" s \" + \"Progress: [ \"\n                    + progress * 100 + \" ] %\");\n\n            // .WHATEVER MUSIC FILE*\n        } else {\n            // System.out.println(\"Current time is : \" + (int) (microsecondPosition /\n            // 1000000) + \" seconds\");\n        }\n\n    }\n\n    @Override\n    public void statusUpdated(final StreamPlayerEvent streamPlayerEvent) {\n\n        // Player status\n        final Status status = streamPlayerEvent.getPlayerStatus();\n        // System.out.println(streamPlayerEvent.getPlayerStatus());\n\n        // Examples\n\n        if (status == Status.OPENED) {\n\n        } else if (status == Status.OPENING) {\n\n        } else if (status == Status.RESUMED) {\n\n        } else if (status == Status.PLAYING) {\n\n        } else if (status == Status.STOPPED) {\n\n        } else if (status == Status.SEEKING) {\n\n        } else if (status == Status.SEEKED) {\n\n        }\n\n        // etc... SEE XR3PLAYER https://github.com/goxr3plus/XR3Player for advanced\n        // examples\n    }\n\n    public static void main(final String[] args) {\n        new Main();\n    }\n\n}\n```\n\n\n## Java Audio Tutorials and API's by GOXR3PLUS STUDIO\n - **Spectrum Analyzers**\n   - [Java-Audio-Wave-Spectrum-API](https://github.com/goxr3plus/Java-Audio-Wave-Spectrum-API)\n    ![image](https://github.com/goxr3plus/Java-Audio-Wave-Spectrum-API/raw/master/images/Screenshot_2.jpg?raw=true)\n   - [Jave Spectrum Analyzers from Audio](https://github.com/goxr3plus/Java-Spectrum-Analyser-Tutorials)\n   - [Capture Audio from Microphone and make complex spectrum analyzers](https://github.com/goxr3plus/Java-Microphone-Audio-Spectrum-Analyzers-Tutorial)\n  \n - **Java multiple audio formats player**\n   - [Java-stream-player](https://github.com/goxr3plus/java-stream-player)\n  \n - **Speech Recognition/Translation/Synthenizers**\n   - [Java Speech Recognition/Translation/Synthesizer based on Google Cloud Services](https://github.com/goxr3plus/java-google-speech-api)\n   - [Java-Speech-Recognizer-Tutorial--Calculator](https://github.com/goxr3plus/Java-Speech-Recognizer-Tutorial--Calculator)\n   - [Java+MaryTTS=Java Text To Speech](https://github.com/goxr3plus/Java-Text-To-Speech-Tutorial)\n   - [Java Speech Recognition Program based on Google Cloud Services ](https://github.com/goxr3plus/Java-Google-Speech-Recognizer)\n   - [Java Google Text To Speech](https://github.com/goxr3plus/Java-Google-Text-To-Speech)\n   - [Full Google Translate Support using Java](https://github.com/goxr3plus/java-google-translator)\n   - [Professional Java Google Desktop Translator](https://github.com/goxr3plus/Java-Google-Desktop-Translator)\n\n\n\n---\n\n### Looking for a ffmpeg wrapper in Java ?\n\u003e Check this -\u003e [jave2](https://github.com/a-schild/jave2) , currently updating it :)\n\n---\n\n### Originally being developed for [XR3Player Application](https://github.com/goxr3plus/XR3Player)\n\nAre you curious on how to make spectrum analysers in Java? Well the below tutorials plus the above code are the solution :)\n\nI hope you enjoy these tutorials and actually you can watch the youtube videos about them below:\n\n\n[![Java Spectrum Analyser Tutorial](http://img.youtube.com/vi/lwlioga8Row/0.jpg)](https://www.youtube.com/watch?v=lwlioga8Row)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoxr3plus%2Fjava-stream-player","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoxr3plus%2Fjava-stream-player","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoxr3plus%2Fjava-stream-player/lists"}