GNOME powered sound conversion

Related tags

Audio soundconverter
Overview

SoundConverter

A simple sound converter application for the GNOME environment. It reads anything the GStreamer library can read, and writes Ogg Vorbis, FLAC, Wave, MP3 and M4A files.

This application is somewhat less fast than various command line tools. Not a whole lot, however, and not enough to make me worry about performance for the foreseeable future. If you want ultimate performance, the command line tools are always going to be preferable.

SoundConverter Screenshot

SoundConverter Screenshot

Building and Installation

Ubuntu and Arch packages exist in the official repositories.

Installing from source requires distutils-extra

git clone https://github.com/kassoulet/soundconverter.git
cd soundconverter
git checkout py3k
sudo python3 setup.py install
soundconverter

Help

For command line args, see

soundconverter --help
gst-launch-1.0 --help-gst

and https://gstreamer.freedesktop.org/documentation/application-development/appendix/checklist-element.html

Testing

To start unittests, use

sudo python3 setup.py install
python3 tests/test.py

Copyright and Acknowledgements

Copyright 2004 Lars Wirzenius

Copyright 2005-2020 Gautier Portet

Co-author Sezanzeb

Thanks to: Guillaume Bedot, Dominik Zabłotny, Noa Resare, Nil Gradisnik, Elias Autio, Thom Pischke, Qball Cow, Janis Blechert, Brendan Martens, Jason Martens, Wouter Stomp, Joe Wrigley, Jonh Wendell, Regis Floret, Toni Fiz, Seketeli Apelete, Cristiano Canguçu, Adolfo González Blázquez, Marc E., Tobias Kral, Hanno Böck, Pedro Alejandro López-Valencia, James Lee, Christopher Barrington-Leigh, Thomas Schwing, Remi Grolleau, Julien Gascard, Kamil Páral, Stefano Luciani, Martin Seifert, Claudio Saavedra, Ken Harris, Jon Arnold, Major Kong, Uwe Bugla

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 3 of the License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Comments
  • rewriting task, converter and queue architecture

    rewriting task, converter and queue architecture

    I'm using this documentation almost all the time by the way: https://lazka.github.io/pgi-docs/

    Stats as of 06. August:

    +2133 -244 from tests

    +493 -187 from the batch mode

    +2246 -2030 for the rest

    Changes

    Features

    • faster scanning of directories
    • more precise calculation of the remaining time
    • aligned some things in the settings dialog
    • added filename and line number to --debug logs
    • in batch mode, abr, cbr and vbr can be specified like -f mp3 -m abr.
    • batch mode logs errors to the console if the cli args are used wrong
    • batch mode supports path patterns like -p {artist}/{album}/{title}
    • batch mode can select whether to skip, overwrite or increment files when the output already exists
    • the invalid files dialog shows more of the path of each file than just the filename and has more beautiful paddings
    • batch mode supports arbitrary bitrates that are not available in the ui
    • info logs are colored as well with --debug

    Bugs

    • faac did not respect bitrate settings
    • soundfile objects from the discovery step are kept for conversion, hence fixing the mp4mux tag message problem because tags are already there https://github.com/kassoulet/soundconverter/pull/36

    Quality

    • more unittests. went from 36 to 105 tests and from 79 to 502 assertions.
    • went from a pylint rating of 7.49 to 8.83
    • fixed confusion between self.basename and basename in get_target_name
    • avoiding redundancy of storing stuff in settings and the gio settings at the same time
    • reduced confusion between various basename, folder and pattern variables in TargetNameGenerator
    • added many docstrings, especially to new functions
    • no more confusion between functions like done vs finished, __init__ vs init
    • removed unnecessary forwarding of Gio settings parameters, instead querying them exactly when they are needed, (some of them still need to be stored in the converter class though to avoid them getting changed during conversion by interacting with the ui) thus reducing function header sizes and complexity
    • batch mode uses Gio settings (without writing them persistently) in order to be more compatible to the rest of the code
    • tasks have less inheritance. Converter only inherits from task
    • taskqueue doesn't need any inheritance anymore
    • no more event emitting, but rather hardcoded calls to needed functions when they are needed, because the converter class doesn't need to cover for various use cases that require different code to be executed on events. Reduces complexity
    • moved code that can be generalized out of ui.py, so that it can be potentially used by the batch mode.
    • removed unused imports, variables, functions and classes
    • I'm pretty sure ftp uris in the tests were wrong and should start with ftp:// (see https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Generic_syntax)
    • sound_files only accept uris as parameters, selected_folder may only be an uri as well, and patterns may not be uris, which means the target name code can focus on a better defined set of rules and work well within that.
    • using discover_uri for tagreader and typefinder, which is faster and less complex. Multithreading is used to further increase the performance of the discoverers (which, however, added some complexity back)
    • added some tags to c.mp3 for tests
    • saving some redundancy of progress queries
    • added screenshot of the batch mode to the readme
    • moved logic of moving temporary files to final files to the converter class.
    opened by sezanzeb 9
  • Add some subfolder_patterns

    Add some subfolder_patterns

    I added some some subfolder patterns that i think are useful. And I also properly renamed the old ones which otherwise seems to use the artist tag, but instead they use the album-artist tag

    opened by DriverXX 4
  • set self.error in the on_error event handler

    set self.error in the on_error event handler

    I tried once to convert a file on a device having not enough place, with the "delete original files" option checked. The converted file has not been created because of the missing place, but the original file has been deleted.

    I set self.error in Converter.on_error, so the test "if self.delete_original and self.processing and not self.error:" properly fails in Converter.finished.

    Please let me know if it is the good way to achieve this.

    opened by padawin 4
  • Fixed the discoverer test

    Fixed the discoverer test

    There were two discoverer tasks, and one of them received only non-audio files, so it was removed from queue.running right away.

    No idea why this is suddenly happening, maybe gstreamers behaviour changed a little bit with an update

    opened by sezanzeb 3
  • Threaded batch mode

    Threaded batch mode

    • threaded conversion in batch mode
    • reduced number of prints with -q
    • -t option: when -q is provided don't print nothing at all, rather just hide errors and files without tags because otherwise the combination of -t and -q makes no sense at all
    • removed info about which gtk version is used and such. Not relevant to the user
    • fixed an error from one of my recent commits
    • added -c mode, doing what the gtk interface does when loading files. showing which ones cannot be converted.
    • the CliProgress class accepts multiple arguments like print to create messages now: show("a", "b")
    • nicer console output

    example output of -b (-q disables all output):

    SoundConverter 3.0.1
    
    checking files and walking dirs in the specified paths...
    Queue start: 36 tasks, 4 thread(s).
    Queue done in 0.052s (36 tasks)
    
    preparing converters...
    overwriting '/funky_files/converted/original/audio 2.ogg'
    skipping 'not_music.ogg': invalid soundfile
    skipping 'not_music.flac': invalid soundfile
    (...)
    overwriting '/funky_files/converted/original/foo/audio 4.ogg'
    overwriting '/funky_files/converted/original/foo/bar/audio 5.ogg'
    overwriting '/funky_files/converted/original/foo/bar/audio 6.ogg'
    
    starting conversion...
    Queue start: 6 tasks, 4 thread(s).
    1/6: '/funky_files/original/audio 2.flac'
    2/6: '/funky_files/original/audio 1.flac'
    3/6: '/funky_files/original/foo/audio 3.flac'
    4/6: '/funky_files/original/foo/audio 4.flac'
    5/6: '/funky_files/original/foo/bar/audio 5.flac'
    6/6: '/funky_files/original/foo/bar/audio 6.opus'
    Queue done in 12.346s (6 tasks)
    

    example output of -c (-q just prints a naked list of file paths):

    SoundConverter 3.0.1
    Queue start: 36 tasks, 4 thread(s).
    Queue done in 0.052s (36 tasks)
    
    Non-Audio Files:
    /funky_files/original/not_music.ogg
    /funky_files/original/not_music.flac
    (...)
    /funky_files/original/pictures/pic (another copy).jpg
    
    opened by sezanzeb 3
  • Code Cleaning and Invalid Audiofiles Handling

    Code Cleaning and Invalid Audiofiles Handling

    1. gtk tool, add folder and broken/non audiofiles

    When I put a text file into the sound source directory and renamed it to foobar.flac, no other flac files from other subdirectories were added if this textfile was the first .flac file seen. This was caused, because the TypeFinder only looked at one single sample of .flac files to detect the mime type. Hence the .flac type was not added to the list of accepted file extensions.

    This change checks the mime type of all the sound files instead in order to find out which ones are broken. After this fix, all the .flac files are added to the list for conversion except those that don't contain sound (those for which gstreamer throws errors)

    This increases the time to read in large folders, but it is the way for integrity, which is the first priority when handling files. Also, reading in the files is still fast compared to the conversion. Because of this longer required time for reading in files, the statusbar now also shows the progress of reading in the files.

    An Error message appears to show how many files (only those with audio extensions) failed. The ErrorDialog apperance was also fixed.

    old: old_dialog

    new: new_dialog

    After reading this message, the user can decide whether or not to start the conversion.

    2. Cleanup Changelog

    • added some docstrings
    • removed a dead path from .gitignore
    • removed 7 year old TODO file in a foreign language. If those TODOs are still relevant, can you please create issues in github in english?
    • added building and installation information to readme
    • used vulture and removed some unused variables and imports (after checking if it really is unused)
    • added missing whitespaces after commas in lists and functions
    • formatted docstring whitespaces into a uniform format across all python files
    • removed all trailing whitespaces in python files

    3. soundconverter.py

    • moved imports and such things to the top, dividing it from the mode, command line arg and settings handling. It is considered better practice to have them on the top.
    • if from soundconverter.ui import gui_main fails, it would switch to batch mode. However, this would start conversion immediatelly, either with no command line arguments at all or some files, which would convert all the files into their folders without further user configuration. This is sudden unexpected behaviour and therefore I would rather go a different way. The import of gui_main will fail if there is an e.g. syntax error in that file. So the proper way would be not make sure gui_main doesn't throw errors upon importing. I moved this import to the top.
    • grouped batch options in --help using an OptionParser group. Also some modifications to the help output for batch parameters.
    opened by sezanzeb 3
  • Better CLI

    Better CLI

    I was having trouble with the command line interface, mostly due to missing features.

    So I set up some directories containing files that should be converted with a subdirectory structure and worked on the soundconverter cli until I was able to convert them into a target directory.

    added -i, -r, -Q and -o options:

    • -r goes into subdirectories
    • -i ignores files that have already been converted
    • -o specifies an output directory in which the original file structure is restored
    • -Q takes values between 0 and 5 and indicates the quality of the conversion

    furthermore:

    • removed --help-gst from help since it is not used
    • added example usage to --help
    • reduced redundancy of quality numbers in ui.py with get_quality in settings.py

    in .gitignore was a path "src/soundconverter". This is something old and can be removed, right?

    opened by sezanzeb 3
  • Remove unused <data> list in soundconverter.glade

    Remove unused list in soundconverter.glade

    This fixes the following runtime warning(s):

    /app/lib/python3.8/site-packages/soundconverter/interface/ui.py:1443: Warning: g_value_type_transformable: assertion 'src_type' failed
      builder.add_from_file(gladefile)
    
    (soundconverter:2): Gtk-WARNING **: 18:11:39.109: ../gtk/gtkliststore.c:834: Unable to convert from (null) to gchararray
    
    opened by jmaibaum 2
  • cleanup

    cleanup

    • using setup.py instead of make to reduce complexity, similar to https://github.com/bluesabre/menulibre
    • moved from .rst to .md readme
    • removed unused files
    • made readme more beautiful, added screenshot and logo, removed some redundancy, condensed it
    • added spec that checks if '#' is getting quoted https://github.com/kassoulet/soundconverter/pull/31
    • fixed permission denied when %(genre)s/%(title)s results in a path in root '/...' after os.path.join
    • established cleaner folder structure
    • using githubs default python .gitignore

    note, the branch name mentions ffmpeg but nothing in that direction has been done yet in this PR. I'm thinking about making a base class that gstreamer.py and future ffmpeg.py inherit, so that both can be used interchangeably. Some people have issues with gstreamer, so this might make soundconverter work for them as long as one of the two works. A dropdown or radio button will then be added to the settings menu to select gstreamer or ffmpeg.

    opened by sezanzeb 2
  • logging, format strings, tests don't change settings, split tests, --gst- arguments

    logging, format strings, tests don't change settings, split tests, --gst- arguments

    • uses the logging module now, since that is what many python modules use - makes the code possibly more familiar - and it allows to log to files and such if that is required at some point.
    • correctly forwards --gst- arguments. For example soundconverter --gst-debug-level=3. See https://gstreamer.freedesktop.org/documentation/application-development/appendix/checklist-element.html?gi-language=python#debugging and gst-launch-1.0 --help-gst
    • does not modify the users setting during make test using a memory backend (https://github.com/kassoulet/soundconverter/pull/30#issuecomment-485700568). The way how the code gets the Gio.Settings object had to be changed a bit for this.
    • moved from '%s' % 'string' to the newer '{}'.format('string') formatting almost everywhere
    • clarified differences between argv and gio settings
    • put audio-format related code from settings into separate file
    • splitted test file into multiple files
    • fixed changing the number of jobs required a restart
    • fixed deprecation warnings for Gtk.Dialog
    • rearranged readme a bit
    • limit-jobs is treated as boolean now instead of int

    example showing gstreamers debug messages and our new colored debug logs. The lines saying "WARN" in yellow are gstreamers debug messages.

    Screenshot_2020-06-20_20-05-57 Screenshot_2020-06-21_10-35-45

    gstreamer really logs a lot of things with increasing verbosity (up to 9). I removed the debug logs for the message types at some point because they were actually a bit too much, so the screenshot is a bit outdated.

    opened by sezanzeb 2
  • Quote base folder when building target paths.

    Quote base folder when building target paths.

    The basefolder is not quoted as it should be. If the converted file is within a subdirectory containing for example a # sign, soundconverter would hang.

    opened by F-i-f 2
  • More precise remaining time calculation, ui.py split

    More precise remaining time calculation, ui.py split

    More precise remaining time calculation by replicating how soundfiles are distributed among processes. It also calculates a correction factor based on historic calculations and actual outcomes. The leftover problems are, that the decoding speed of the source files depends on the format. If it werent for the uncertain encoding speed due to various settings, the only way to avoid that would be to generate a lookup table of type -> bitrate -> relative speed, query the closest value and multiplicate that on the second return value of get_progress in converter.py. Even worse, the conversion speed for files slows down over time, and I need to fit a linear function to it and do some integration and inversion stuff, and I can't do that quickly and need to properly verify what the hell I'm doing since it has been a few years since I learned that.

    The progressbar doesn't reflect how many seconds of data have been converted anymore, but rather how much of the time has passed. As long as all processes are working, this is almost identical. This avoids having an almost full progressbar when a single process is still working on a large file that takes a long time to finish. Since this calculation happens only once per second, it is wrapped into a class that interpolates smoothly to the next value.

    Created multiple files from ui.py, because that file was very long and contained multiple classes

    opened by sezanzeb 0
Sound-Equalizer- This is a Sound Equalizer GUI App Using Python's PyQt5

Sound-Equalizer- This is a Sound Equalizer GUI App Using Python's PyQt5. It gives you the ability to play, pause, and Equalize any one-channel wav audio file and play 3 different instruments.

Mustafa Megahed  1 Jan 10, 2022
Graphical interface to control granular sound synthesis.

Granular sound synthesis interface SoundGrain is a graphical interface where users can draw and edit trajectories to control granular sound synthesis

Olivier Bélanger 122 Dec 10, 2022
Open Sound Strip, Sequence or Record in Audacity

Audacity Tools For Blender Sound editing in Blender Video Sequence Editor with Audacity integrated. Send/receive the full edited sequence or single st

null 64 Dec 31, 2022
Reading list for research topics in sound event detection

Sound event detection aims at processing the continuous acoustic signal and converting it into symbolic descriptions of the corresponding sound events present at the auditory scene.

Soham 64 Jan 5, 2023
A python script that can play .mp3 URLs upon the ringing or motion detection of a Ring doorbell. The sound plays through Sonos speakers.

Ring x Sonos A python script that plays .mp3 files whenever a doorbell is rung or a doorbell detects motion. Features Music! Authors @braden Running T

braden 0 Nov 12, 2021
A simple python script to play bell sound in your system infinitely, just for fun and experimental purposes

A simple python script to play bell sound in your system infinitely, just for fun and experimental purposes

نافع الهلالي 1 Oct 29, 2021
extract unpack asset file (form unreal engine 4 pak) with extenstion *.uexp which contain awb/acb (cri/cpk like) sound or music resource

Uexp2Awb extract unpack asset file (form unreal engine 4 pak) with extenstion .uexp which contain awb/acb (cri/cpk like) sound or music resource. i ju

max 6 Jun 22, 2022
Analyze, visualize and process sound field data recorded by spherical microphone arrays.

Sound Field Analysis toolbox for Python The sound_field_analysis toolbox (short: sfa) is a Python port of the Sound Field Analysis Toolbox (SOFiA) too

Division of Applied Acoustics at Chalmers University of Technology 69 Nov 23, 2022
PyAbsorp is a python module that has the main focus to help estimate the Sound Absorption Coefficient.

This is a package developed to be use to find the Sound Absorption Coefficient through some implemented models, like Biot-Allard, Johnson-Champoux and

Michael Markus Ackermann 8 Oct 19, 2022
Library for working with sound files of the format: .ogg, .mp3, .wav

Library for working with sound files of the format: .ogg, .mp3, .wav. By work is meant - playing sound files in a straight line and in the background, obtaining information about the sound file (author, performer, duration, bitrate, and so on). Playing goes through the pygame, and getting information through the mutagen.

Romanin 2 Dec 15, 2022
Open-Source bot to play songs in your Telegram's Group Voice Chat. Powered by @Akki_ThePro

VcPlayer Telegram Voice-Chat Bot [PyTGCalls] ⇝ Requirements ⇜ Account requirements A Telegram account to use as the music bot, You cannot use regular

Akki ThePro 2 Dec 25, 2021
A simple music player, powered by Python, utilising various libraries such as Tkinter and Pygame

A simple music player, powered by Python, utilising various libraries such as Tkinter and Pygame

PotentialCoding 2 May 12, 2022
Read-only mirror of https://gitlab.gnome.org/GNOME/pybliographer

Pybliographer Pybliographer provides a framework for working with bibliographic databases. This software is licensed under the GPLv2. For more informa

GNOME Github Mirror 15 May 7, 2022
Read-only mirror of https://gitlab.gnome.org/GNOME/meld

About Meld Meld is a visual diff and merge tool targeted at developers. Meld helps you compare files, directories, and version controlled projects. It

GNOME Github Mirror 847 Jan 5, 2023
Read-only mirror of https://gitlab.gnome.org/GNOME/ocrfeeder

================================= OCRFeeder - A Complete OCR Suite ================================= OCRFeeder is a complete Optical Character Recogn

GNOME Github Mirror 81 Dec 23, 2022
:sound: Play and Record Sound with Python :snake:

Play and Record Sound with Python This Python module provides bindings for the PortAudio library and a few convenience functions to play and record Nu

spatialaudio.net 750 Dec 31, 2022
Sound-Equalizer- This is a Sound Equalizer GUI App Using Python's PyQt5

Sound-Equalizer- This is a Sound Equalizer GUI App Using Python's PyQt5. It gives you the ability to play, pause, and Equalize any one-channel wav audio file and play 3 different instruments.

Mustafa Megahed  1 Jan 10, 2022
Matlab Python Heuristic Battery Opt - SMOP conversion and manual conversion

SMOP is Small Matlab and Octave to Python compiler. SMOP translates matlab to py

Tom Xu 1 Jan 12, 2022
Plots is a graph plotting app for GNOME.

Plots is a graph plotting app for GNOME. Plots makes it easy to visualise mathematical formulae. In addition to basic arithmetic operations, it supports trigonometric, hyperbolic, exponential and logarithmic functions, as well as arbitrary sums and products.Plots is designed to integrate well with the GNOME desktop and takes advantage of modern hardware using OpenGL, and currently supports OpenGL 3.3+.

Alex Huntley 138 Dec 14, 2022
Drop-down terminal for GNOME

Guake 3 README Introduction Guake is a python based dropdown terminal made for the GNOME desktop environment. Guake's style of window is based on an F

Guake 4.1k Dec 25, 2022