You are not logged in.
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
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
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
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
Last edited by GogglesGuy (2011-05-14 02:25:15)
Offline
That gives me a building error.
==> Iniciando build()...
Search for fox >= 1.6
Found fox 1.6.43 in /usrSearch for taglib >= 1.6.3
Found taglib 1.6.3 in /usrInstall 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
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
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
Rauchen verboten
Offline
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
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
I needed it for my Cowon iAudio 9
Offline
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
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
I needed it for my Cowon iAudio 9
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
If I run this on a flac directory, add more flacs, then run again, will it know not to re-convert everything?
Offline
My apologies for the bump - is there any way to enable support for special characters?
Rauchen verboten
Offline
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
I will surely try this... btw, you know this exists?:
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
I will surely try this... btw, you know this exists?:
Apparently it doesn't . 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
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
Rasi wrote:I will surely try this... btw, you know this exists?:
Apparently it doesn't . 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
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
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
Made a 0.3.0 release with tagbased naming.
Offline
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
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
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
Offline
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
"Encoder and decoder settings may be set in a config file: $(XDG_CONFIG_DIRS)/audioconvert/config.rc"
Offline
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
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