You are not logged in.

#1 2011-02-08 04:53:00

GogglesGuy
Member
From: Rocket City
Registered: 2005-03-29
Posts: 610
Website

Audio Sync and Conversion Utility

Audio Sync and Conversion Utilitiy 0.2.0
(I'm still looking for a catchy name)

https://aur.archlinux.org/packages.php?ID=46306

The other day I needed a utility that would batch convert and/or copy a whole directory tree full of flac files so I could use them on my new portable music player. My first thought was to write something in bash, but I quickly  dropped that idea, since it was faster for me to write it in C++ than getting to know all the little details about bash scripting. Anyways, the end result does link to the FOX library, but it is a command line only utility.

Right now it supports: Flac, Ogg Vorbis, MP3, MP4 and Musepack.

It basically works very simple. You give it a input directory and (optionally) an output directory and tell it what it should do:

Basic syntax:

audioconvert <operation> <input_folder> <output_folder>

Converts all flac files to ogg:

audioconvert --flac=ogg <input_folder> <output_folder>

Converts all flac files to ogg and copies mp3 files as is:

audioconvert --flac=ogg  --mp3=copy <input_folder> <output_folder>

Copies all files, except for ogg which gets converted to mp3. (note the order matters here):

audioconvert --all=copy --ogg=mp3 <input_folder> <output_folder>

For all other commandline options:

audioconvert --help

or see the man page


Encoder and decoder settings may be set in a config file:  $(XDG_CONFIG_DIRS)/audioconvert/config.rc
A default one gets generated when you first run the program.


(Needs fixing: right now a default one gets generated on first run if you specify a valid operation. I recommend doing a dry-run (--dry-run), which should only print out the operations, but still generates the config file).

WARNING: Recommend you backup your music collection first.
WARNING: Audioconvert has the capability to send output to the same directory, thus has the ability to overwrite your files.
WARNING: Not responsible for any lost music files.

Last edited by GogglesGuy (2011-02-09 03:03:46)

Offline

#2 2011-05-14 01:29:50

ffuentes
Member
From: Santiago, Chile
Registered: 2009-08-23
Posts: 35

Re: Audio Sync and Conversion Utility

That gives me a building error.

==> Iniciando build()...
    Search for fox >= 1.6
        Found fox 1.6.43 in /usr

    Search for taglib >= 1.6.3
        Found taglib 1.6.3 in /usr

Install Path:
  Prefix => /usr
  Binaries => /usr/bin
  Man => /usr/share/man
Done.
Please run "make" and "make install" to compile and install audioconvert.
    Compiling src/main.cpp ...
    Compiling src/AudioTools.cpp ...
    Compiling src/AudioConvert.cpp ...
src/AudioConvert.cpp:494:8: aviso: parámetro ‘from’ sin uso [-Wunused-parameter]
src/AudioConvert.cpp:494:8: aviso: parámetro ‘to’ sin uso [-Wunused-parameter]
    Compiling src/AudioTags.cpp ...
src/AudioTags.cpp: En la función ‘FX::FXbool gm_read_string_be(FX::FXIO&, FX::FXString&)’:
src/AudioTags.cpp:839:34: aviso: comparación entre expresiones enteras signed y unsigned [-Wsign-compare]
src/AudioTags.cpp: En la función ‘GMCover* gm_flac_parse_block_picture(FX::FXIO&)’:
src/AudioTags.cpp:930:63: aviso: comparación entre expresiones enteras signed y unsigned [-Wsign-compare]
src/AudioTags.h: En el constructor ‘GMCover::GMCover(const FXuchar*, FX::FXival, const FX::FXString&, FX::FXuint, const FX::FXString&)’:
src/AudioTags.h:94:13: aviso: ‘GMCover::mime’ se inicializará después de [-Wreorder]
src/AudioTags.h:92:13: aviso:   ‘FX::FXuint GMCover::type’ [-Wreorder]
src/AudioTags.cpp:1043:1: aviso:   cuando se inicializó aquí [-Wreorder]
    Linking src/audioconvert ...
src/AudioTags.o: In function `std::list<TagLib::String, std::allocator<TagLib::String> >::_M_insert(std::_List_iterator<TagLib::String>, TagLib::String const&)':
AudioTags.cpp:(.text._ZNSt4listIN6TagLib6StringESaIS1_EE9_M_insertESt14_List_iteratorIS1_ERKS1_[std::list<TagLib::String, std::allocator<TagLib::String> >::_M_insert(std::_List_iterator<TagLib::String>, TagLib::String const&)]+0x29): undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)'
src/AudioTags.o: In function `std::list<TagLib::ID3v2::Frame*, std::allocator<TagLib::ID3v2::Frame*> >::_M_insert(std::_List_iterator<TagLib::ID3v2::Frame*>, TagLib::ID3v2::Frame* const&)':
AudioTags.cpp:(.text._ZNSt4listIPN6TagLib5ID3v25FrameESaIS3_EE9_M_insertESt14_List_iteratorIS3_ERKS3_[std::list<TagLib::ID3v2::Frame*, std::allocator<TagLib::ID3v2::Frame*> >::_M_insert(std::_List_iterator<TagLib::ID3v2::Frame*>, TagLib::ID3v2::Frame* const&)]+0x29): undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)'
src/AudioTags.o: In function `std::list<TagLib::MP4::CoverArt, std::allocator<TagLib::MP4::CoverArt> >::_M_insert(std::_List_iterator<TagLib::MP4::CoverArt>, TagLib::MP4::CoverArt const&)':
AudioTags.cpp:(.text._ZNSt4listIN6TagLib3MP48CoverArtESaIS2_EE9_M_insertESt14_List_iteratorIS2_ERKS2_[std::list<TagLib::MP4::CoverArt, std::allocator<TagLib::MP4::CoverArt> >::_M_insert(std::_List_iterator<TagLib::MP4::CoverArt>, TagLib::MP4::CoverArt const&)]+0x29): undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)'
collect2: ld devolvió el estado de salida 1
make: *** [src/audioconvert] Error 1

Offline

#3 2011-05-14 01:50:12

SS4
Member
From: !Rochford, Essex
Registered: 2010-12-05
Posts: 699

Re: Audio Sync and Conversion Utility

Excellent, I've been on the hunt for a CLI flac to ogg audio converter. The package has install fine from the AUR, just going to test it on some files


edit:  Can I change the quality of the output file? The default of 6 for vorbis is fine but I would like to change it. It's working fine though - just playing an output in mplayer and the files haven't been eradicated

Last edited by SS4 (2011-05-14 01:59:06)


Rauchen verboten

Offline

#4 2011-05-14 02:24:48

GogglesGuy
Member
From: Rocket City
Registered: 2005-03-29
Posts: 610
Website

Re: Audio Sync and Conversion Utility

SS4 wrote:

Excellent, I've been on the hunt for a CLI flac to ogg audio converter. The package has install fine from the AUR, just going to test it on some files


edit:  Can I change the quality of the output file? The default of 6 for vorbis is fine but I would like to change it. It's working fine though - just playing an output in mplayer and the files haven't been eradicated


Yes. In the config file (~/.config/audioconvert/config.rc) which should have been automatically generated, you can change the options.

FYI oggenc accept flac files as input. This tool just helps you convert whole directory structures as well smile

Last edited by GogglesGuy (2011-05-14 02:25:15)

Offline

#5 2011-05-14 02:26:09

GogglesGuy
Member
From: Rocket City
Registered: 2005-03-29
Posts: 610
Website

Re: Audio Sync and Conversion Utility

ffuentes wrote:

That gives me a building error.

==> Iniciando build()...
    Search for fox >= 1.6
        Found fox 1.6.43 in /usr

    Search for taglib >= 1.6.3
        Found taglib 1.6.3 in /usr

Install Path:
  Prefix => /usr
  Binaries => /usr/bin
  Man => /usr/share/man
Done.
Please run "make" and "make install" to compile and install audioconvert.
    Compiling src/main.cpp ...
    Compiling src/AudioTools.cpp ...
    Compiling src/AudioConvert.cpp ...
src/AudioConvert.cpp:494:8: aviso: parámetro ‘from’ sin uso [-Wunused-parameter]
src/AudioConvert.cpp:494:8: aviso: parámetro ‘to’ sin uso [-Wunused-parameter]
    Compiling src/AudioTags.cpp ...
src/AudioTags.cpp: En la función ‘FX::FXbool gm_read_string_be(FX::FXIO&, FX::FXString&)’:
src/AudioTags.cpp:839:34: aviso: comparación entre expresiones enteras signed y unsigned [-Wsign-compare]
src/AudioTags.cpp: En la función ‘GMCover* gm_flac_parse_block_picture(FX::FXIO&)’:
src/AudioTags.cpp:930:63: aviso: comparación entre expresiones enteras signed y unsigned [-Wsign-compare]
src/AudioTags.h: En el constructor ‘GMCover::GMCover(const FXuchar*, FX::FXival, const FX::FXString&, FX::FXuint, const FX::FXString&)’:
src/AudioTags.h:94:13: aviso: ‘GMCover::mime’ se inicializará después de [-Wreorder]
src/AudioTags.h:92:13: aviso:   ‘FX::FXuint GMCover::type’ [-Wreorder]
src/AudioTags.cpp:1043:1: aviso:   cuando se inicializó aquí [-Wreorder]
    Linking src/audioconvert ...
src/AudioTags.o: In function `std::list<TagLib::String, std::allocator<TagLib::String> >::_M_insert(std::_List_iterator<TagLib::String>, TagLib::String const&)':
AudioTags.cpp:(.text._ZNSt4listIN6TagLib6StringESaIS1_EE9_M_insertESt14_List_iteratorIS1_ERKS1_[std::list<TagLib::String, std::allocator<TagLib::String> >::_M_insert(std::_List_iterator<TagLib::String>, TagLib::String const&)]+0x29): undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)'
src/AudioTags.o: In function `std::list<TagLib::ID3v2::Frame*, std::allocator<TagLib::ID3v2::Frame*> >::_M_insert(std::_List_iterator<TagLib::ID3v2::Frame*>, TagLib::ID3v2::Frame* const&)':
AudioTags.cpp:(.text._ZNSt4listIPN6TagLib5ID3v25FrameESaIS3_EE9_M_insertESt14_List_iteratorIS3_ERKS3_[std::list<TagLib::ID3v2::Frame*, std::allocator<TagLib::ID3v2::Frame*> >::_M_insert(std::_List_iterator<TagLib::ID3v2::Frame*>, TagLib::ID3v2::Frame* const&)]+0x29): undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)'
src/AudioTags.o: In function `std::list<TagLib::MP4::CoverArt, std::allocator<TagLib::MP4::CoverArt> >::_M_insert(std::_List_iterator<TagLib::MP4::CoverArt>, TagLib::MP4::CoverArt const&)':
AudioTags.cpp:(.text._ZNSt4listIN6TagLib3MP48CoverArtESaIS2_EE9_M_insertESt14_List_iteratorIS2_ERKS2_[std::list<TagLib::MP4::CoverArt, std::allocator<TagLib::MP4::CoverArt> >::_M_insert(std::_List_iterator<TagLib::MP4::CoverArt>, TagLib::MP4::CoverArt const&)]+0x29): undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)'
collect2: ld devolvió el estado de salida 1
make: *** [src/audioconvert] Error 1

Hmm, I wonder if by accident I broke taglib 1.6 compatibility. taglib 1.7 is in extra, you seem to be slightly behind your updates...

Offline

#6 2011-05-14 14:13:58

SS4
Member
From: !Rochford, Essex
Registered: 2010-12-05
Posts: 699

Re: Audio Sync and Conversion Utility

GogglesGuy wrote:
SS4 wrote:

Excellent, I've been on the hunt for a CLI flac to ogg audio converter. The package has install fine from the AUR, just going to test it on some files


edit:  Can I change the quality of the output file? The default of 6 for vorbis is fine but I would like to change it. It's working fine though - just playing an output in mplayer and the files haven't been eradicated


Yes. In the config file (~/.config/audioconvert/config.rc) which should have been automatically generated, you can change the options.

FYI oggenc accept flac files as input. This tool just helps you convert whole directory structures as well smile

Yes it was cheers, it's a neat little converter especially for copying my mostly flac library to vorbis so it can fit on the Cowon smile


Rauchen verboten

Offline

#7 2011-05-14 14:25:07

GogglesGuy
Member
From: Rocket City
Registered: 2005-03-29
Posts: 610
Website

Re: Audio Sync and Conversion Utility

SS4 wrote:
GogglesGuy wrote:
SS4 wrote:

Excellent, I've been on the hunt for a CLI flac to ogg audio converter. The package has install fine from the AUR, just going to test it on some files


edit:  Can I change the quality of the output file? The default of 6 for vorbis is fine but I would like to change it. It's working fine though - just playing an output in mplayer and the files haven't been eradicated


Yes. In the config file (~/.config/audioconvert/config.rc) which should have been automatically generated, you can change the options.

FYI oggenc accept flac files as input. This tool just helps you convert whole directory structures as well smile

Yes it was cheers, it's a neat little converter especially for copying my mostly flac library to vorbis so it can fit on the Cowon smile

I needed it for my Cowon iAudio 9 smile

Offline

#8 2011-05-14 15:02:31

SS4
Member
From: !Rochford, Essex
Registered: 2010-12-05
Posts: 699

Re: Audio Sync and Conversion Utility

GogglesGuy wrote:
SS4 wrote:
GogglesGuy wrote:

Yes. In the config file (~/.config/audioconvert/config.rc) which should have been automatically generated, you can change the options.

FYI oggenc accept flac files as input. This tool just helps you convert whole directory structures as well smile

Yes it was cheers, it's a neat little converter especially for copying my mostly flac library to vorbis so it can fit on the Cowon smile

I needed it for my Cowon iAudio 9 smile

The iAudio 9 looks nice, I went for a D2 on size and cost considerations


edit: the program exits whenever it comes across an apostrophe:

convert (direct):                                                                                                                                                                                       
  from: /mnt/Music//Oasis/(What's The Story) Morning Glory_/12 - Champagne Supernova.flac                                                                                                               
    to: /home/ss4/testing/oot/Oasis/(What's The Story) Morning Glory_/12 - Champagne Supernova.ogg                                                                                                      
sh: -c: line 0: syntax error near unexpected token `)'                                                                                                                                                  
sh: -c: line 0: `oggenc -q 4.56 '/mnt/Music//Oasis/(What\'s The Story) Morning Glory_/12 - Champagne Supernova.flac' -o '/home/ss4/testing/oot/Oasis/(What\'s The Story) Morning Glory_/12 - Champagne Supernova.ogg''
  from: /mnt/Music//Nirvana/Nirvana/01 - You Know You're Right.flac                                                                                                                                     
    to: /home/ss4/testing/oot/Nirvana/Nirvana/01 - You Know You're Right.ogg                                                                                                                            
sh: -c: line 0: unexpected EOF while looking for matching `''                                                                                                                                           
sh: -c: line 1: syntax error: unexpected end of file 

Last edited by SS4 (2011-05-14 19:05:47)


Rauchen verboten

Offline

#9 2011-05-25 14:14:09

tladuke
Member
Registered: 2009-07-23
Posts: 176

Re: Audio Sync and Conversion Utility

If I run this on a flac directory, add more flacs, then run again, will it know not to re-convert everything?

Offline

#10 2011-06-01 00:06:25

SS4
Member
From: !Rochford, Essex
Registered: 2010-12-05
Posts: 699

Re: Audio Sync and Conversion Utility

My apologies for the bump - is there any way to enable support for special characters?


Rauchen verboten

Offline

#11 2011-12-22 02:32:27

GogglesGuy
Member
From: Rocket City
Registered: 2005-03-29
Posts: 610
Website

Re: Audio Sync and Conversion Utility

Sorry to bump this. Since I never registered for updates on this thread, I never noticed your message(s). I think the special character has been fixed some time ago.
At least I cannot reproduce it with the current version.

Offline

#12 2011-12-22 06:53:06

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: Audio Sync and Conversion Utility

I will surely try this... btw, you know this exists?:

http://cli-apps.org/content/show.php...content=137251


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#13 2011-12-22 06:55:29

GogglesGuy
Member
From: Rocket City
Registered: 2005-03-29
Posts: 610
Website

Re: Audio Sync and Conversion Utility

Rasi wrote:

I will surely try this... btw, you know this exists?:

http://cli-apps.org/content/show.php...content=137251

Apparently it doesn't tongue. Getting a 404...

But I assume you mean audenc. It doesn't look like it supports special characters like spaces and neither does it recursively traverse the input directory.

Last edited by GogglesGuy (2011-12-22 07:11:39)

Offline

#14 2011-12-22 07:07:27

GogglesGuy
Member
From: Rocket City
Registered: 2005-03-29
Posts: 610
Website

Re: Audio Sync and Conversion Utility

tladuke wrote:

If I run this on a flac directory, add more flacs, then run again, will it know not to re-convert everything?

Yes, if the destination already exist, it won't convert it unless the source has a newer timestamp.

Offline

#15 2011-12-22 08:56:09

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: Audio Sync and Conversion Utility

GogglesGuy wrote:
Rasi wrote:

I will surely try this... btw, you know this exists?:

http://cli-apps.org/content/show.php...content=137251

Apparently it doesn't tongue. Getting a 404...

But I assume you mean audenc. It doesn't look like it supports special characters like spaces and neither does it recursively traverse the input directory.

Indeed, I meant audenc


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#16 2011-12-22 08:57:07

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: Audio Sync and Conversion Utility

Do you plan to support custom naming scheme based on tags?


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#17 2011-12-22 15:05:29

GogglesGuy
Member
From: Rocket City
Registered: 2005-03-29
Posts: 610
Website

Re: Audio Sync and Conversion Utility

Rasi wrote:

Do you plan to support custom naming scheme based on tags?

I hadn't planned on it, but it would certainly be easy to add (since the code already exists in gogglesmm). I'll see if I can hack that in this weekend.

Offline

#18 2011-12-25 19:26:05

GogglesGuy
Member
From: Rocket City
Registered: 2005-03-29
Posts: 610
Website

Re: Audio Sync and Conversion Utility

Made a 0.3.0 release with tagbased naming.

Offline

#19 2012-02-25 23:22:48

andesho91
Member
From: London, UK
Registered: 2011-11-20
Posts: 71

Re: Audio Sync and Conversion Utility

I like this program, as it works with all the audio that I need to convert, unlike soundconvertor which seems to hissy fit all the time..


Laptop: AMD A4-3305M, 4GB RAM, Archlinux 64bit with XFCE4 and Linux Mint Maya with MATE.

Offline

#20 2012-02-27 17:40:24

GogglesGuy
Member
From: Rocket City
Registered: 2005-03-29
Posts: 610
Website

Re: Audio Sync and Conversion Utility

andesho91 wrote:

I like this program, as it works with all the audio that I need to convert, unlike soundconvertor which seems to hissy fit all the time..

Thanks for trying. I'm glad you found it useful!

Offline

#21 2012-02-27 19:11:19

RaisedFist
Member
From: Romania
Registered: 2007-01-30
Posts: 556
Website

Re: Audio Sync and Conversion Utility

I used your program to convert some files from FLAC to ogg, but I have a question: is it possible to have encoder options? Like bitrate, frequency, etc. Maybe I didn't read the manual as I should smile

Offline

#22 2012-02-27 19:13:38

GogglesGuy
Member
From: Rocket City
Registered: 2005-03-29
Posts: 610
Website

Re: Audio Sync and Conversion Utility

RaisedFist wrote:

I used your program to convert some files from FLAC to ogg, but I have a question: is it possible to have encoder options? Like bitrate, frequency, etc. Maybe I didn't read the manual as I should smile


"Encoder and decoder settings may be set in a config file:  $(XDG_CONFIG_DIRS)/audioconvert/config.rc"

Offline

#23 2012-02-27 19:17:22

RaisedFist
Member
From: Romania
Registered: 2007-01-30
Posts: 556
Website

Re: Audio Sync and Conversion Utility

Is there a template somewhere? I looked in my /etc/xdg and there's nothing related to audioconvert

Offline

#24 2012-02-27 19:20:29

GogglesGuy
Member
From: Rocket City
Registered: 2005-03-29
Posts: 610
Website

Re: Audio Sync and Conversion Utility

RaisedFist wrote:

Is there a template somewhere? I looked in my /etc/xdg and there's nothing related to audioconvert

For now a default one is automatically generated when you first run the program. Should be located in ~/.config/audioconvert/config.rc

Offline

#25 2012-02-27 19:22:08

SS4
Member
From: !Rochford, Essex
Registered: 2010-12-05
Posts: 699

Re: Audio Sync and Conversion Utility

RaisedFist wrote:

Is there a template somewhere? I looked in my /etc/xdg and there's nothing related to audioconvert

It runs on first use. From mine:

[19:22:23]  me@Ragnarok ~ $  cat .config/audioconvert/config.rc 
#[format]
#template=
#strip='\#~!"$&();<>|`^*?[]/.:

#[flac_decoder]
#bin=flac --decode --force
#options=

#[flac_encoder]
#bin=flac --force
#options=--verify --best

#[mp3_decoder]
#bin=lame --decode
#options=

[mp3_encoder]
bin=lame
options=--preset extreme

#[ogg_decoder]
#bin=oggdec
#options=

[ogg_encoder]
bin=oggenc
options=-q 7.3

#[mp4_decoder]
#bin=faad
#options=

#[mp4_encoder]
#bin=faac
#options=

#[mpc_decoder]
#bin=mpcdec
#options=

#[mpc_encoder]
#bin=mpcenc --overwrite
#options=--standard

Rauchen verboten

Offline

Board footer

Powered by FluxBB