Code Monkey home page Code Monkey logo

jammer's Introduction

Jammer — light-weight TUI music player

banner

Introduction

Tired of opening up a browser or app to play music, and even then you can't play local files or songs from different sites?

Jammer is a simple CLI music player that supports playing songs from your local files, Youtube and Soundcloud.

Compatible with Windows, Linux.

Jammer shines its best when using it as a playlist. That's why I created it, for the playlist feature across different platforms

  • The player doesn't stream the songs, but downloads them to local storage.
  • The Jammer folder is located in the user's home directory and contains the downloaded songs, playlists, settings, keybinds, locales and effects modification.
  • Jammer uses Bass for playing the songs and ManagedBass for being able to use it in .NET, SoundCloudExplode, YoutubeExplode for downloading the songs and Spectre.Console for the UI.

Install/Update

Install

Github latest Release Linux version of Jammer requires fuse2. Ubuntu 22.02 or newer install apt install libfuse2.

Update existing

jammer --update

Usage

when using Soundcloud or Youtube links do not forget to use https:// at the start.

jammer
jammer [song] ... [folder]
jammer https://soundcloud.com/username/track-name
jammer https://soundcloud.com/username/sets/playlist-name
jammer https://youtube.com/watch?v=video-id
jammer https://youtube.com/playlist?list=playlist-id
jammer https://raw.githubusercontent.com/jooapa/jammer/main/npc_music/616845.mp3
jammer https://raw.githubusercontent.com/jooapa/jammer/main/example/terraria.jammer
jammer "path/to/song.mp3"

jammer     --start        opens jammer folder
jammer     --update       checks for updates and installs
jammer -h, --help         show help
jammer -D                 debug mode
jammer -v, --version      show version
jammer -h, --help                             show this help message-
jammer -p, --play       <name>                play playlist
jammer -c, --create     <name>                create playlist
jammer -d, --delete     <name>                delete playlist
jammer -a, --add        <name> <song> ...     add song to playlist
jammer -r, --remove     <name> <song> ...     remove song from playlist
jammer -s, --show       <name> 
jammer -l, --list                             list all playlists
jammer -f, --flush                            deletes all the songs in songs folder
jammer -sp, --set-path  <path>, <default>     set path for songs folder
jammer -gp, --get-path                        get the path to the <jammer/songs> folder
jammer -hm, --home                            play all songs from the <jammer/songs> folder
jammer -so, --songs                           open <jammer/songs> folder

Example of making a playlist in cli

jammer -c new_playlist
jammer -a new_playlist https://www.youtube.com/playlist?list=PLnaJlq-zKc0WUXhwhSowwJdpe1fZumJzd
jammer -p new_playlist

Supported formats

Jammer supports the following audio formats: .mp3, .ogg, .wav, .mp2, .mp1, .aiff, .aif, .mod, .mo3, .s3m, .xm, .it, .aac, .adts, .mp4, .m4a, .m4b, .mid, .midi, .rmi, .kar

  • JAMMER Jammer playlist
  • FOLDER Folder/Directory (support playing all audio files within a folder)
  • YOUTUBE Youtube video/playlist
  • SOUNDCLOUD Soundcloud song/playlist

MIDI support

Jammer supports playing .mid, .midi, .rmi, .kar files. To play, you need to have a SoundFont file .sf2, .sf3, .sfz, sf2pack

Here is one sf2 file you can use ChoriumRevA.SF2, This is BASS's recommended SoundFont file.

To change the SoundFont file, press Shift + G (default keybind).

Link to a soundFont by path: This will link the SoundFont file by path. This will not copy the SoundFont file to the <jammer/soundfonts>.

Import soundfont by path: This will copy the SoundFont file to the <jammer/soundfonts>.

Will show all the SoundFont files in the <jammer/soundfonts> folder.

Themes

You can create your own theme by pressing Shift + T (default keybind)

Select 'Create a New Theme' and write the theme's name. Go to <jammer/themes>, you should see name.json. It will contain all the information needed for creating a theme.

Visualizer

You can change the visualizer style in custom Themes. To change the visualizer settings, go to <jammer/Visualizer.ini> and change the settings.

Effects

  • Reverb
  • Echo
  • Flanger
  • Chorus
  • Distortion
  • Compressor
  • Gargle
  • Parametric Equalizer

These can be changed in the Effects.ini file in the jammer folder.

Default Player Controls

Key Action
H Show/hide help
C Show/hide settings
F Show/hide playlist view
Shift + E Edit keybindings
Shift + L Change language
Space Play/pause
Q Quit
Forward
Backward
Volume up
Volume down
M Mute/unmute
L Toggle loop
S Toggle shuffle
R Play in random song
N Next song in playlist
P Previous song in playlist
Delete Delete current song from playlist
F2 Show playlist options
Tab Show CMD help screen
0 Goto start of the song
9 Goto end of the song
Shift + T Change Theme
Shift + G Change SoundFont

Default Playlist Controls

Key Action
Shift + A Add song to playlist
Shift + D Show songs in other playlist
Shift + F List all playlists
Shift + O Play other playlist
Shift + S Save playlist
Shift + Alt + S Save as
Alt + S Shuffle playlist
Shift + P Play song(s)
Shift + B Redownload current song
Shift + Y Search YouTube for songs

Language support

Translations may not be up-to-date

Currently supported languages:

  • English

  • Finnish

Create new translation by copying already existing .ini file from /locales and translating it.

Star History

Star History Chart

Developing

Build / Run yourself

Download the BASS and BASS_AAC libraries from the un4seen website or the libaries are included in the libs folder.

On Linux, you need to add the libraries to the $LD_LIBRARY_PATH.

export LD_LIBRARY_PATH=/path/to/your/library:$LD_LIBRARY_PATH

On Windows, you need to add the libraries to the executable folder.

Run

dotnet run --project Jammer.CLI -- [args]

Build

Windows

dotnet publish -r win10-x64 -c Release /p:PublishSingleFile=true -p:DefineConstants="CLI_UI" --self-contained
Linux

Add BASS and BASS_AAC libraries to the executable folder and to $LD_LIBRARY_PATH.

dotnet publish -r linux-x64 -c Release /p:PublishSingleFile=true -p:UseForms=false -p:DefineConstants="CLI_UI" --self-contained
Linux AppImage release

AppImage requires fuse. To install fuse

sudo apt install libfuse2

To install appimagetool

wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
chmod 700 appimagetool-x86_64.AppImage

To create AppImage run build-appimage.sh

or if you want to build it from usb

sh -c "$(wget -O- https://raw.githubusercontent.com/jooapa/jammer/main/usb-appimage.sh)"
Build script for NSIS installer
.\Jammer.CLI\buildcli.bat

you can use update.py to change the version of the app.

                 |-Major
                 ||--Minor
                 |||---Patch
python update.py 101

Incoming Features

  • Add more audio formats

Known Issues

Perfect app, no issues.

jammer's People

Contributors

antonako1 avatar dddmaster avatar jooapa avatar retroaalto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar

jammer's Issues

Planned support for playback/multimedia keys?

Describe the bug
I love the tool <3, do you plan on adding support for multimedia keys from keyboards? You know - play/pause; next, prev, you know - those:

PXL_20240503_070235626

To Reproduce
Steps to reproduce the behavior:

  1. start a playlist
  2. hit pause - nothing happens
  3. het prev/next - nothing happens

Expected behavior
Hitting pause - pauses the playback, hittin play - starts it. etc .

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

$ uname -a
Linux pop-os 6.8.0-76060800daily20240311-generic #202403110203~1713206908~22.04~3a62479 SMP PREEMPT_DYNAMIC Mon A x86_64 GNU/Linux

fuix download

i download song from youtube. it takes 100minutes or gives me error:
The filename, directory name, or volume label syntax is incorrect

happens here in trycatch. fix
private static async Task DownloadYoutubeTrackAsync(string url)
{
string formattedUrl = FormatUrlForFilename(url);

        songPath = Path.Combine(
            Utils.jammerPath,
            formattedUrl
        );
        string construction = songPath;
        string value = "";
        (value, pipe) = CheckExistingSong(url);
        // Message.Data("Value: " + value, "Check Existing Song:" + formattedUrl.Substring(0, formattedUrl.Length - 4));
        if (value != "")
        {
            songPath = value;
            return;
        }

        pipe = "";
        try
        {
            var streamManifest = await youtube.Videos.Streams.GetManifestAsync(url);
            var streamInfo = streamManifest.GetAudioStreams().FirstOrDefault();
            var video = await youtube.Videos.GetAsync(url);
            
            if (streamInfo != null)
            {
                var progress = new Progress<double>(data =>
                {
                    AnsiConsole.Clear();
                    Console.WriteLine($"{Locale.OutsideItems.Downloading} {url}: {data:P}");
                });

                // metadata to pipe
                pipe = video.Title;
                pipe = Start.Sanitize(pipe);

                await youtube.Videos.Streams.DownloadAsync(streamInfo, songPath, progress);
                int pos_dot = songPath.LastIndexOf(".");
                construction = songPath[..pos_dot] + "^" + pipe + ".mp4";
                File.Move(songPath, construction);
            }
            else
            {
                Message.Data(Locale.OutsideItems.NoAudioStream, Locale.OutsideItems.Error);
            }
            songPath = construction;
        }
        catch (Exception ex)
        {
            Message.Data($"{Locale.OutsideItems.Error}: " + ex.Message, "Error");
            songPath = "";
        }
    }

Save playlist when playlists directort doesn't exist

if $HOME/jammer/playlists doesn't exist program core dumps when saving a new playlst

│ Save as playlist                                                                                                          
│ │ Enter playlist name: asdf                                                                                             
Unhandled exception. System.IO.DirectoryNotFoundException: Could not find a part of the path '/home/ilako/jammer/playlists/asdf.jammer'.
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode, Func`4 createOpenException) 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Func`4 createOpenException) 
   at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.StreamWriter.ValidateArgsAndOpenPath(String path, Boolean append, Encoding encoding, Int32 bufferSize)   
   at System.IO.File.WriteAllLines(String path, IEnumerable`1 contents, Encoding encoding)
   at jammer.Playlists.Save(String playlistName, Boolean force)  
   at TUI.SaveAsPlaylist()                                
   at jammer.Start.CheckKeyboard()          
   at jammer.Start.Loop()                                                                                                   

Code dumped if playlist file is empty

$ cat asdf.jammer
$ jammer -p asdf
Launching Jammer...
Starting up asdf.jammer
Unhandled exception. System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at jammer.Playlists.Play(String playlist, Boolean fromCli)
   at jammer.Start.Run(String[] args)
   at Program.Main(String[] args)
zsh: IOT instruction (core dumped)  jammer -p asdf

[Linux] Local files won't play if there are spaces in the filename

Describe the bug
When you want to play a local mp3 file from your local drive and the filename has spaces in it, jammer won't play them.

To Reproduce
Steps to reproduce the behavior:

  1. Rename an mp3 file so it has spaces in it. Example: 01 Title Song.mp3
  2. Pass the mp3 file to jammer like this: $ jammer 01\ Title\ Song.mp3

The error should be visible now.

Expected behavior
The expectation is that local files with spaces in their names will be played the same way as files without spaces in their names.

Screenshots
image

Desktop (please complete the following information):

  • OS: ArchLinux
  • Jammer version 2.2.3.4

Fails to start if autosave is turned on and playlist is loaded from the net

  1. start jammer
  2. turn on autosave from config menu, quit jammer
  3. jammer https://cele.fr4nk.org/test.jammer
  4. Error
┌───────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Error                                                                                                 │
├───────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ ┌───────────────────────────────────────────────────────────────────────────────────────────────────┐ │
│ │ Can not initialize device                                                                         │ │
│ └───────────────────────────────────────────────────────────────────────────────────────────────────┘ │
└───────────────────────────────────────────────────────────────────────────────────────────────────────┘
│ Load Effects         │       │ 5 To Load Effects settings                                            │
│ Toggle Media Buttons │ False │ 6 To Toggle Media Buttons                                             │
│ Toggle Visualizer    │ True  │ 7 To Toggle Visualizer (change visualizer settings in Visualizer.ini) │
│ Load Visualizer      │       │ 8 To Load Visualizer settings                                         │
└──────────────────────┴───────┴───────────────────────────────────────────────────────────────────────┘
Press H to hide/show help
Press C for settings
Press F to show playlist

C:\Users\onethathasnoname>jammer https://cele.fr4nk.org/test.jammer
Checking https://cele.fr4nk.org/test.jammer
URL https://cele.fr4nk.org/test.jammer is valid
Downloaded 3432 of  5352 bytes (6,412.56%).
Downloaded 4812 of  5352 bytes (8,991.03%).
Downloaded 5352 of  5352 bytes (10,000.00%).
Song already in playlist
No songs in playlist

Cannot add to playlist from CLI

$ jammer -c asdf
Launching Jammer...
Creating playlist: asdf.jammer
$ ls
asdf.jammer
$ jammer -a asdf "https://soundcloud.com/synthwave80s/sets/dreams"
Launching Jammer...
https://soundcloud.com/synthwave80s/sets/dreams
Adding songs to /home/ilako/jammer/playlists/asdf.jammer
Done!
$ cat asdf.jammer
$ 

fix downlaod

i start jammer from folder C:\Users\user\jammer
I add youtube song there with shift+a
I redownload song it working
I shut down software
I go back to jammer to folder C:\Users\user\jammer
I try redownloading song and it breaks

also when i download song it shows title correctly and i go back to jammer folder it shows .mp4 in the name

mp3PRO files playing as normal mp3's

Describe the bug
The README claims that jammer supports mp3PRO (which is why I downloaded it in the first place), but when I play a song that is encoded in mp3PRO, the "PRO" part (i.e. SBR) is ignored and none of the frequencies above about 10kHz are playing (see screenshot below). If I play the same track via wine in WinAmp with the mp3PRO plugin or with JetAudio, the frequencies are present and it sounds "brighter" as one would expect when frequencies up to at least 16kHz are added.

Since mp3PRO is basically an abandoned format and you may have difficulty finding software that can still encode it, here is an archive containing 3 audio files with white noise for testing purposes where the difference is very obvious. white-noise-original.flac is the source file that I generated before transcoding to mp3PRO. white-noise.mp3 was then created by transcoding the original .flac file into mp3PRO, and white-noise.flac was created by converting the mp3PRO file back to flac. Because flac is a lossless format, white-noise.mp3 and white-noise.flac should sound identical, and they do via WinAmp+plugin and via JetAudio, but do not via jammer (or VLC which I used as a comparison for a player that supports mp3 but not mp3PRO).

To Reproduce
Steps to reproduce the behavior:

  1. Download the appimage.
  2. Add execution permissions to the appimage: chmod +x ./jammer-2.11.2.2-x86_64.appimage
  3. Play an audio file encoded in mp3PRO ./jammer-2.11.2.2-x86_64.appimage white-noise.mp3
  4. Listen and hear the high frequencies missing.

Expected behavior
The track should play with all the frequencies that would be present when the song is played on a player with mp3PRO support.

Screenshots
Here I have played the included white noise files while using a spectrum analyzer app on my phone. You see 4 blocks of audio. From the bottom to the top it's the original flac played in JetAudio, then the mp3PRO played in JetAudio, then the converted flac played in JetAudio, and the last block at the top where everything over 10kHz is missing is the mp3PRO played in jammer.
Spectrum analyzer

Desktop (please complete the following information):

  • OS: Linux 6.9.10-arch1-1 (EndeavourOS)

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.