Skip to main content

Topic: TAudioConverter (Read 207699 times) previous topic - next topic

0 Members and 2 Guests are viewing this topic.
TAudioConverter
Reply #500
Gave it a try and ran into some problems:

- encoding to flaccl/flac results in invalid files. The size seems fine but they're missing all tags and foobar2000 says files are corrupted. TAK/WAVpack works fine

- no replaygain tag copied even though copy tags is ticked? As discussed somewhere here on HA, it's safe to copy RG tags for lossless -> lossless conversion

- reading the changelog, only wma artwork tagging is supported i guess, because for .tak they didn't work. Also, no tags at all for wavpack, as well.

Otherwise everything seems to be working well. Suggestion: add an option to edit encoder command line, or alternatively a "custom encoder" preset.

  • ozok
  • [*][*][*][*]
TAudioConverter
Reply #501
Thanks for the test ChronoSphere.
-I couldn't reproduce that problem with my test set. Can you post output of flac encoder? Or maybe a sample?
-You are right. This because of new tag writing method. But as I said I'll add replaygain support soon.
-I couldn't get my tagger to write artwork properly to apev2 tags. TAC writes apev2 tags to formats you listed so they don't have artwork support yet.

Edit: @jkauff what do you think about new GUI layout http://i.imgur.com/fymHspT.png?
  • Last Edit: 23 August, 2013, 12:28:24 PM by ozok

TAudioConverter
Reply #502
Here is an example log:
Code: [Select]
 -y -i "\\ZACATE\Music (Azure)\Accel World\Accel World ED Single\01 →unfinished→.flac" -threads 0 -vn -acodec pcm_s16le -f wav   -ss 00:00:00 -t 00:04:42 "R:\TEMP\TAudioConverter\001 →unfinished→.wav"
 -8 -f  --picture="R:\TEMP\TAudioConverter\\01 →unfinished→.jpg"  "R:\TEMP\TAudioConverter\001 →unfinished→.wav" -o "r:\ACATE\Music (Azure)\Accel World\Accel World ED Single\01 →unfinished→.flac"
" " "R:\TEMP\TAudioConverter\\0tag.txt" "r:\ACATE\Music (Azure)\Accel World\Accel World ED Single\01 →unfinished→.flac"

ffmpeg version N-55159-gf118b41 Copyright © 2000-2013 the FFmpeg developers
  built on Aug  1 2013 18:11:15 with gcc 4.7.3 (GCC)
  configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 40.100 / 52. 40.100
  libavcodec    55. 19.100 / 55. 19.100
  libavformat    55. 12.102 / 55. 12.102
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter    3. 82.100 /  3. 82.100
  libswscale      2.  4.100 /  2.  4.100
  libswresample  0. 17.103 /  0. 17.103
  libpostproc    52.  3.100 / 52.  3.100
Input #0, flac, from '\\ZACATE\Music (Azure)\Accel World\Accel World ED Single\01 竊置nfinished竊・flac':
  Metadata:
   ALBUM          : 竊置nfinished竊・
   ARTIST          : KOTOKO
   COMMENT        :  YEAR: 2012
   DATE            : 2012
   GENRE          : JPop
   TITLE          : 竊置nfinished竊・
   TRACKTOTAL      : 4
   track          : 1
   REPLAYGAIN_ALBUM_GAIN: -11.78 dB
   REPLAYGAIN_ALBUM_PEAK: 1.000000
   REPLAYGAIN_TRACK_GAIN: -12.60 dB
   REPLAYGAIN_TRACK_PEAK: 1.000000
  Duration: 00:04:42.04, bitrate: 1181 kb/s
   Stream #0:0: Audio: flac, 44100 Hz, stereo, s16
   Stream #0:1: Video: mjpeg, yuvj420p, 1423x1423, 90k tbr, 90k tbn, 90k tbc
   Metadata:
     comment        : Cover (front)
Output #0, wav, to 'R:\TEMP\TAudioConverter\001 竊置nfinished竊・wav':
  Metadata:
   IPRD            : 竊置nfinished竊・
   IART            : KOTOKO
   ICMT            :  YEAR: 2012
   ICRD            : 2012
   IGNR            : JPop
   INAM            : 竊置nfinished竊・
   TRACKTOTAL      : 4
   IPRT            : 1
   REPLAYGAIN_ALBUM_GAIN: -11.78 dB
   REPLAYGAIN_ALBUM_PEAK: 1.000000
   REPLAYGAIN_TRACK_GAIN: -12.60 dB
   REPLAYGAIN_TRACK_PEAK: 1.000000
   ISFT            : Lavf55.12.102
   Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (flac -> pcm_s16le)
Press [q] to stop, [?] for help
size=  48586kB time=00:04:42.04 bitrate=1411.2kbits/s   
video:0kB audio:48586kB subtitle:0 global headers:0kB muxing overhead 0.000414%


flac 1.3.0, Copyright © 2000-2009, 2011-2013  Josh Coalson & Xiph.Org Foundation
flac comes with ABSOLUTELY NO WARRANTY.  This is free software, and you are
welcome to redistribute it under certain conditions.  Type `flac' for details.

001 ?unfinished?.wav: WARNING: skipping unknown chunk 'LIST' (use --keep-foreign-metadata to keep)
001 ?unfinished?.wav: wrote 41566991 bytes, ratio=0,835

TTagger - 0.1 Beta - © 2013 ozok - GPLv2
Simple tool to write tags to audio files.
Uses tagging components from 3delite.hu.
Usage: ttagger.exe tagsfile.txt filetowritetags

Reading tags from 0tag.txt and writing to 01 →unfinished→.flac
Following tags will be written:
Title=→unfinished→
Artist=KOTOKO
Album=→unfinished→
Genre=JPop
Date=2012
TrackNo=1
TrackTotal=4
DiscNo=
Comment= YEAR: 2012
AlbumArtist=
Composer=
NameSort=
ArtistSort=
AlbumArtistSort=
AlbumSort=
Cover=R:\TEMP\TAudioConverter\01 →unfinished→.jpg
Tag type to write is FLAC.
Starting to write tags.
Saving to file.
Saved to file: r:\ACATE\Music\Accel World\Accel World ED Single\01 →unfinished→.flac

Two things I see is that it skips some "foreign metadata". Also, handling network paths is still messy when telling it to recreate folder structure
Comparing the source file to the output one, the tags are seen as FLAC (FLAC) at source in MP3Tag, but the column is blank for the output file - as are all tags, except for the image tag, which appears just fine. If it helps, I told TAC to embed the artwork, embedded first.

It's also interesting that even though the log is in utf-8, some of the → appear corrupted. And MP3Tag cannot remove or write tags to those files.
  • Last Edit: 23 August, 2013, 04:38:00 PM by ChronoSphere

  • ozok
  • [*][*][*][*]
TAudioConverter
Reply #503
@ChronoSphere I still cannot reproduce that problem. In my case, all the tags and artwork are copied and only one tag field (album artist) is missing. Perhaps the problem is with your file? Can you send me a sample? Log is UTF-8 but some of the backends don't have unicode support so they print stuff wrong.

BTW I might have solved the problem with "Create Folder Tree" and network source. I couldn't test it because I'm not on a network but it should work. This is just 64-bit portable exe and can be copied into the folder of beta I posted earlier. Also it has new GUI layout.

Regards.

  • ozok
  • [*][*][*][*]
TAudioConverter
Reply #504
I've just released a new beta, build 2204. You can get it from https://bitbucket.org/ozok/taudioconverter-...erter/downloads . It includes a new GUI layout, track replaygain for aac encoders and lame. Both 32-bit and 64-bit portable versions are available.

  • jkauff
  • [*][*][*]
  • Members (Donating)
TAudioConverter
Reply #505
Edit: @jkauff what do you think about new GUI layout http://i.imgur.com/fymHspT.png?

I like it! Simple and clean, and access to the various functions should be obvious to a new user. Great work.
  • Last Edit: 25 August, 2013, 03:25:46 PM by jkauff

  • eahm
  • [*][*][*][*][*]
TAudioConverter
Reply #506
Thanks ozok, I really like the new interface.

Two small annoyances for now:

- "[LossLess]" = "[Lossless]". Why the capital L?
- "[Hybrid] WavPack" -> "[Lossless/hybrid] WavPack". David never capitalizes hybrid, anywhere. Also it's better to remember the user that WavPack is lossless before and it can become hybrid.

edit1:
- You should add the option to select the switch "--no-delay" as well for qaac. For what I understood it will make .m4a files without delay so they can be used right away in video muxing (2.0, 5.1, 7.1). More info here.
- AAC extension in Settings -> Order alphabetically but keep m4a selected.
- AAC extension in Settings -> All lowercase
- "[Lossless] OptimFROG"?
- "[Lossless] Shorten"? Optional, I don't think anyone uses this anymore.
- Agree with I don't remember who to change the default codec to MP3 V2 or V0. Actually I would change it to AAC (qaac) but I guess MP3 is fine.
- "[Lossy] MP2 (TwoLAME)"?
  • Last Edit: 25 August, 2013, 05:26:09 PM by eahm

  • ozok
  • [*][*][*][*]
TAudioConverter
Reply #507
Thanks for your comments about GUI. As jkauff said, it was becoming a bit crowded. Also, carrying codec settings to a different form gives me more room to add additional options if needed.

@eahm, It must have been a typo. And I'll change wavpack's info too.
  • Last Edit: 25 August, 2013, 04:59:14 PM by ozok

  • sundance
  • [*][*][*]
TAudioConverter
Reply #508
Hi ozok,

Quote
I've just released a new beta, build 2204. You can get it from https://bitbucket.org/ozok/taudioconverter-...erter/downloads . It includes a new GUI layout, track replaygain for aac encoders and lame. Both 32-bit and 64-bit portable versions are available.


Tested the 32-bit-version on Windows 7 Professional 32-bit.
App starts fine, but after trying to add some audio files (no matter what type, FLAC or MP3), an exception is thrown.

Btw, the help windows says "Build 1930", not 2204 as supposed.
And the crash report says "Build 1973"...
Telling from that report, TAudioConverter feels incompatible with the version of Windows (32/64)...
Code: [Select]
operating system  : Windows 7 Service Pack 1 build 7601
system language   : German
version           : 0.9.0.1973
compiled with     : Delphi XE3
madExcept version : 4.0.7
callstack crc     : $9a4920a2, $4351ec45, $4351ec45
count             : 2
exception number  : 2
exception class   : EOSError
exception message : System Error. Code: 216. Die Version von %1 ist nicht mit der ausgeführten Windows-Version kompatibel. Öffnen Sie die Systeminformationen des Computers, um zu überprüfen, ob eine x86-(32 Bit)- oder eine x64-(64 Bit)-Version des Programms erforderlich ist, und wenden Sie sich anschließend an den Herausgeber der Software.

  • ozok
  • [*][*][*][*]
TAudioConverter
Reply #509
Sorry sundance, looks like one of the tools included in 32bit package was actually 64bit. I'm re-uploading the package. About build numbers, I use 64bit version of TAC to do test etc. so, build number of 32bit stays the same until point of release.

  • sundance
  • [*][*][*]
TAudioConverter
Reply #510
Thanks for the quick fix; now adding files and conversion to MP3 worked.

One thing I don't understand, though.
The FLAC files I converted have valid ReplayGain-Tags (album and track). It was my understanding that (when selecting "Apply ReplayGain" (Track gain)) TAC is supposed to apply the RG track value (e.g. -6dB) to the FLAC audio before or while it is converted to MP3. The resulting MP3 should then be down by 6dB in volume and a RG scanning of that MP3 should result in something like 0dB.
But my MP3s came out with the same volume and RG values as the FLACs had.

.sundance.

  • ozok
  • [*][*][*][*]
TAudioConverter
Reply #511
To tell you the truth I don't know much about ReplayGain. I'm trying to understand how it works and how it should be applied. This is what causes delay in this release. So far, what TAC does is, it encodes files and makes backends scan and write replaygain tags to output files. So no information from source is involved at that point. But from my understanding, you can copy replaygain tags if convertion is from lossless to lossless. If anything is wrong/missing with this process please don't hasitate to correct me.
  • Last Edit: 27 August, 2013, 08:54:42 AM by ozok

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
TAudioConverter
Reply #512
The current behaviour sounds ideal. Lossless files can have tags copied to the destination as, of course, the audio and hence the RG values will not change. Lossy encoding may alter amplitudes, so, even though it might not be the end of the world to copy tags from the source, it’s highly advisable to ignore them and re-scan the new lossy file.

In relation to what sundance said, you would need to provide two options: (1) copy or re-compute RG tags as normal, or (2) take the RG values from the source and apply them to the intermediate uncompressed stream so that the adjustment is directly written into the physical audio of the destination file.

I’m not sure about the latter. Especially for MP3 and AAC, which have their own lossless ways of adding universally compatible adjustments to gain. But if others have some good reason to do it, it’s a valid option to offer them.
  • Last Edit: 27 August, 2013, 09:02:15 AM by db1989

  • ozok
  • [*][*][*][*]
TAudioConverter
Reply #513
@db1989 thanks, I'll follow this path which makes sense to me, if noone else has more to say to that.

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
TAudioConverter
Reply #514
Just to clarify:

Lossy encoding may alter amplitudes, so, even though it might not be the end of the world to copy tags from the source, it’s highly advisable to ignore them and re-scan the new lossy file.
I mean that the alteration may or may not be perceptually relevant (and, of course, we can’t say without ABXing), but it’s by far the best practice to recompute the RG anyway.

Quote
I’m not sure about [writing RG into the stream before re-encoding]. Especially for MP3 and AAC, which have their own lossless ways of adding universally compatible adjustments to gain. But if others have some good reason to do it, it’s a valid option to offer them.
This is more valid than my wording there might have suggested. I think it would be a good and relevant thing to include as an option.

  • sundance
  • [*][*][*]
TAudioConverter
Reply #515
@ozok,
Quote
To tell you the truth I don't know much about ReplayGain. I'm trying to understand how it works and how it should be applied.

HOW it works is described in detail here (http://en.wikipedia.org/wiki/ReplayGain) or here (http://wiki.hydrogenaudio.org/index.php?title=ReplayGain_1.0_specification).

And this is just my 2 cents about a possible implementation of ReplayGain in TAudioConverter.
(I used this in an old project of mine to convert lossless files to LAME)

Let's say you have a source file with these RG values (MediaInfo):
Code: [Select]
Queen - Bohemian Rhapsody
REPLAYGAIN_ALBUM_GAIN                    : -4.61 dB
REPLAYGAIN_ALBUM_PEAK                    : 1.000000
Replay gain                              : -3.73 dB
Replay gain peak                         : 1.000000

... and you want to apply album gain, you'll apply a negative "gain" of -4.61 dB (scale factor = 0.588166), of course assuming you've selected a reference level of 89 dB.
Applying positive gain values require some attention for possible clipping (see peak levels).

Code: [Select]
function GainToScaleFactor(dBGain: Extended): Extended;
// (0 dB -> SF = 1.0,   -6.0 dB -> SF = 0.501)
// ScaleFactor = 10^(dbGain/20)
begin
  result := JclMath.TenToY(dbGain/20);
end;

You could use either LAME's command line (--scale 0.588) or (maybe better) SoX, if you'd like to use dithering/noise shaping (where SoX does an excellent job).
After that step, the RG tags should be either recalculated or simply adjusted with the scale factor, like:
Code: [Select]
 REPLAYGAIN_ALBUM_GAIN                    : -0.00 dB
REPLAYGAIN_ALBUM_PEAK                    : 0.588166
Replay gain                              : +0.98 dB
Replay gain peak                         : 0.588166

And you're done.
This has the advantage of being usable with ALL MP3 players, since most of them don't honor RG tags.

Additionally you could calculate and add "SoundCheck" values (for iDevices); I couldn't find detailed information on that, though.
The basic calculation is (can't remember the source):
Code: [Select]
function GainToSoundCheckStr(dBGain: Extended): String;
// (0 dB -> SC = 000003E8 (=1000),   -6.0 dB -> SC = 00000F8D (=3981))
// SoundCheck = 1000 * 10^(-dbGain/10)
begin
  result := IntToHex(Round(1000 * JclMath.TenToY(-dbGain/10)),8);
end;

These hex values are stored in a "iTunNORM" comment tag.

Of course there's lossless ways of applying RG to MP3/AAC, but you'll have to use "mp3Gain" and "aacGain" to postprocess your files after the encoding. It's debatable if this lossless approach is neccessary, since you convert from lossless source anyway.


  • eahm
  • [*][*][*][*][*]
TAudioConverter
Reply #516
ozok, does the ReplayGain you add have the R128 "scanner/engine" like the one in foobar2000?
  • Last Edit: 27 August, 2013, 03:29:57 PM by eahm

  • ozok
  • [*][*][*][*]
TAudioConverter
Reply #517
@sundance I plan to offer lossless approach as first option and permantly applying gain as second one. But I want to first make sure that lossless way works smoothly.

@eahm I guess not, because I'm using mp3gain, aacgain etc.

  • nu774
  • [*][*][*][*][*]
  • Developer
TAudioConverter
Reply #518
You could use either LAME's command line (--scale 0.588) or (maybe better) SoX, if you'd like to use dithering/noise shaping (where SoX does an excellent job).

When gain adjustment is applied to the intermediate PCM before passing it to encoder, it's better to be processed/passed in the form of float PCM as long as encoder supports reading it. No need of dither/noise shape in this case.
IIRC, SoX uses int32 as internal PCM format, therefore it might not be an optimial choice here.
http://www.hydrogenaudio.org/forums/index....howtopic=101850

  • sundance
  • [*][*][*]
TAudioConverter
Reply #519
Quote
I plan to offer lossless approach as first option and permantly applying gain as second one. But I want to first make sure that lossless way works smoothly.

I'm perfectly fine with a lossless approach using mp3gain/aacgain.
The reason I didn't use it in my project was the nasty habit of mp3gain (v1.4.6) to use APEv2 tags. Now that I see v1.5.2 has a switch to force using ID3v2 tags (almost) everything looks good. And I think the gain granularity of 1.5 dB doesn't hurt, although I did not test that.

The only "glitches" I found:
a) "mp3gain /r /s i file.mp3" applies a track gain found in the given file correctly. But it doesn't correct the RG tags correspondingly. So if your file has a track gain of -9.2 dB, mp3gain applies 6*1.5 dB (negative gain of 9 dB) but leaves the RG tag unchanged with -9.2 dB instead of correcting it to -0.2 dB. So an RG aware player like foobar applies another -9.2 dB.
b) mp3gain/aacgain writes ID3v2.4 tags, even when the source file has ID3v2.3 tags. Some (many?) mp3 players don't support v2.4 tags correctly.

Both of these issues would make an additional (but easy to implement, imho) step (recalculation of RG values & changing v2.4 to v2.3 tags) neccessary.

@nu774:
Quote
IIRC, SoX uses int32 as internal PCM format, therefore it might not be an optimial choice here.
http://www.hydrogenaudio.org/forums/index....howtopic=101850
Thanks a lot for the pointer; very interesting discussion. I was under the impression that SoX uses float for internal calculations.

.sundance.
  • Last Edit: 28 August, 2013, 05:07:51 AM by sundance

  • sundance
  • [*][*][*]
TAudioConverter
Reply #520
A little bit off topic, but connected to mp3gain vs. applying appropiate volume gain before encoding:
I tested that on a (heavily compressed CD track (Blurred Lines by Robin Thicke), which has a RG track gain of -9.46 dB and a DynamicRange of 6.
I encoded the file with latest LAME (-V2) in 2 ways:
a) Plain encoding with mp3gain postprocessing (mp3gain /g -6)
b) Applying -9dB volume correction before encoding.

Both MP3 files have the same volume (~ +0.4 dB RG track gain), but file a) has 5.7 MB and file b) only 5.5 MB.
Does LAME do a better job with "unclipped" of lower volume files?
Just a thought...

Unfortunatelly my hearing isn't good enough to ABX both versions.

.sundance.

  • nu774
  • [*][*][*][*][*]
  • Developer
TAudioConverter
Reply #521
I was under the impression that SoX uses float for internal calculations.

Since many of filter-internal calculations (FFT convolution or something) is done with floating point, that impression is natural and correct in a sense.

TAudioConverter
Reply #522
@ChronoSphere I still cannot reproduce that problem. In my case, all the tags and artwork are copied and only one tag field (album artist) is missing. Perhaps the problem is with your file? Can you send me a sample? Log is UTF-8 but some of the backends don't have unicode support so they print stuff wrong.

BTW I might have solved the problem with "Create Folder Tree" and network source. I couldn't test it because I'm not on a network but it should work.
Sorry for disappearing on you, but my net has suddenly died, so I'm stuck on a metered connection for now. I will send you an example once the net is back, but it seems to affect all files for me. This might or might not have something to do with me running Japanese locale, but on the other hand the previous version worked fine...

  • ozok
  • [*][*][*][*]
TAudioConverter
Reply #523
@ChronoSphere It seems the changes I made don't agree with your system. It might be specific to your system or as you said caused by different locale of your system.

BTW did you have a chance to test the fix related to network paths?

  • jkauff
  • [*][*][*]
  • Members (Donating)
TAudioConverter
Reply #524
I've been telling people on other forums how great TAC is, and how simple to use. Any idea when the version with the new UI will be ready for release?