Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: how to convert WAV files to WMA lossless with Tags (Read 8478 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

how to convert WAV files to WMA lossless with Tags

Right, I've got all my CDs ripped to WAVs with Tags in them and I currently use an AudioTron for playback.

I've now got an XBOX360 and Media Center 2005 PC so I need to get the files into WMA lossless format which is simple enough with the Windows Media Encoder but what I can't figure out is how I add all of the tags.

Looking at a WMA file in the Windows Media File Editor there only appear to be entries for Title and Author.  Where do I put the Album name, Track number etc?

I'm not expecting the WMA converter to extract this from the WAV files - I've already got scripts that do this for conversion to MP3 so I can use it on a portable player but there doesn't seem to be anywhere in the command line tools that I can add these entries.

As an example, this is the command line used to convert a WAV file to the MP3 with the tags in using LAME:

F:\Music\lame\lame.exe --alt-preset standard --tt "Private Investigations" --ta "Dire Straits" --tl "Alchemy (Disc 1)" --tg "Rock" --tn "5" "F:\Music\WAV\Dire Straits\Alchemy (Disc 1)\\Private Investigations.wav" "F:\Music\MP3\Dire Straits\Alchemy (Disc 1)\Private Investigations.mp3"

Any suggestions on what I need to do to get these converted to WMA?

how to convert WAV files to WMA lossless with Tags

Reply #1
Are you sure the Xbox 360 can handle WMA Lossless files? If not, you may be wasting your time....
EAC>1)fb2k>LAME3.99 -V 0 --vbr-new>WMP12 2)MAC-Extra High

how to convert WAV files to WMA lossless with Tags

Reply #2
yep, it supports it.

thinking about this a bit more, I assume that media center actually builds its own database of the artist/track info which is why they're not stored in the WMA files themselves.

If that's the case, does anyone know of a utility for inserting entries into the database as then I could stick with WAV files and simply add all the releavant info into the database for them.

how to convert WAV files to WMA lossless with Tags

Reply #3
WMA files contain tags, as far as I know. Use foobar2000 to make your wma lossless files and write your tags, it should be pretty straightforward (just search for any transcoding guide or whatever...)

how to convert WAV files to WMA lossless with Tags

Reply #4
Quote
Any suggestions on what I need to do to get these converted to WMA?
[a href="index.php?act=findpost&pid=354539"][{POST_SNAPBACK}][/a]


Use dBPowerAmp to transcode the WAVs to WMA lossless, checking the "Preserve ID tags" option. The output files will have exactly the same tags as the WAVs.
EAC>1)fb2k>LAME3.99 -V 0 --vbr-new>WMP12 2)MAC-Extra High

how to convert WAV files to WMA lossless with Tags

Reply #5
And since you are a Windows Media Center user, just verify all the tagging of your new WMAL content is cool with Windows Media Player 10.  Obviously, it behaves similarly to what the Media Center interface (and WMC 2.0) expects.

how to convert WAV files to WMA lossless with Tags

Reply #6
Quote
Use dBPowerAmp to transcode the WAVs to WMA lossless, checking the "Preserve ID tags" option. The output files will have exactly the same tags as the WAVs.
[a href="index.php?act=findpost&pid=354717"][{POST_SNAPBACK}][/a]


Tried that and it creates the WMA files fine but they have no tags in them at all - it doesn't get the tags from the WAV file which is not completely surprising since very little actually supports tags in WAV files.

If I use one of my MP3 files (converted from the WAV file) and convert that to WMA using dbPowerAmp then the resulting file does include the tags so its definitely the fact that it cannot retrieve the tags from a WAV file.

I have already written utilities to do things with the tags in the WAV files so what I need is either:

- a converter with a command line interface like LAME that will take parameters for the tags
- a utilitity that will add tags to a WMA file from the command line

I can't find a way of doing either that with dbPowerAmp as it seems to be 'gui only'

how to convert WAV files to WMA lossless with Tags

Reply #7
Sadly there are no overiding standards for ID Tags in wave files (that darn MusicMatch even just writes ID3v2 tags to the end of the wave file, not even in any wave chunks...). Certain other programs just write an ID3v1 on the end, really ugly as it only needs 8 bytes more infront of the tag to put it into a chunk.

A few top-end programs use the LIST chunk, but this is not unicode (will be supported in dBpowerAMP R12 as it is possible to have all standard ID3v1 tags, ANSI only).

Any idea what format the IDtags are in?

how to convert WAV files to WMA lossless with Tags

Reply #8
Quote
Any idea what format the IDtags are in?
[{POST_SNAPBACK}][/a]


They are for use with an AudioTron created by an app called ATWavTag and editable in Voyetra Audiostation - I have programs (with source code) that will read the tags - pretty sure its in RIFF chunks, but I'll dig the code out and check.

I was actually wondering if I can use the default WAV plugin on the website and add the code to that (but I can't see any instrucations on how to install the plugin).

EDIT: Found a link to the source code that I based my apps on: [a href="http://www.nas-kan.org/detritus/audiotron.shtml#ATWavTag]http://www.nas-kan.org/detritus/audiotron.shtml#ATWavTag[/url]

From the page: "AtWavTag is a program to manipulate the LIST/INFO tags in a RIFF compliant WAV file....I have tried to make sure that any tags or RIFF chunks that I'm not interested in are copied verbatim to the new file, so the only thing that should be altered is the five specific LIST/INFO tags that the AudioTron is interested in."

how to convert WAV files to WMA lossless with Tags

Reply #9
>LIST/INFO tags in a RIFF compliant WAV file

That is the propper way, and looking at his code, it is ok (although his code does not make use of JUNK chunks after LIST to allow resizing of the Tag, other than that you could have the LIST chunk after the DATA so resizing is not a problem).

There will be a R12 plug-in codec emulator for dBpowerAMP R11.5 (R12 Codecs are a new design) that should read these tags, about 8 weeks I am guessing, keep your eye on the beta section of the db forum.

how to convert WAV files to WMA lossless with Tags

Reply #10
Quote
>LIST/INFO tags in a RIFF compliant WAV file

That is the propper way, and looking at his code, it is ok (although his code does not make use of JUNK chunks after LIST to allow resizing of the Tag, other than that you could have the LIST chunk after the DATA so resizing is not a problem).

There will be a R12 plug-in codec emulator for dBpowerAMP R11.5 (R12 Codecs are a new design) that should read these tags, about 8 weeks I am guessing, keep your eye on the beta section of the db forum.
[a href="index.php?act=findpost&pid=354780"][{POST_SNAPBACK}][/a]


Excellent, I'll keep an eye out.  In the WAV files that are produced (both by ATWavTag and when modified by Voyetra Audiostation) the LIST chunks are always at the end.

I take it there's no command line I can use in dbPowerAMP at the moment to force the tags through?

Do you think my idea of adding the tag code to the example WAV decoder would work ok though as I'd like to try and get it working so I can start the conversions running - it looks like just a case of including the code to parse for the tags and then copying the compiled dll over the top of the raw.dll that is already in the dbpoweramp directory...

how to convert WAV files to WMA lossless with Tags

Reply #11
Quote
>LIST/INFO tags in a RIFF compliant WAV file

That is the propper way, and looking at his code, it is ok (although his code does not make use of JUNK chunks after LIST to allow resizing of the Tag, other than that you could have the LIST chunk after the DATA so resizing is not a problem).

There will be a R12 plug-in codec emulator for dBpowerAMP R11.5 (R12 Codecs are a new design) that should read these tags, about 8 weeks I am guessing, keep your eye on the beta section of the db forum.
[a href="index.php?act=findpost&pid=354780"][{POST_SNAPBACK}][/a]


Hi spoon:

Any chance of including code to do the reverse? I too have an Audiotron and am getting ready to rerip my collection to WAV (Audiotron only supports gapless playback in this format). What would be perfect for me is to rip with dbPoweramp and AccurateRip directly to WAV with tags that the Audiotron understands.

how to convert WAV files to WMA lossless with Tags

Reply #12
It will also write tags

how to convert WAV files to WMA lossless with Tags

Reply #13
Quote
It will also write tags
[a href="index.php?act=findpost&pid=354881"][{POST_SNAPBACK}][/a]
Oh please don't encourage the use of non-standard tags in WAV files... on the pain!  We'll never get rid of it. 

how to convert WAV files to WMA lossless with Tags

Reply #14
Writing LIST chunks with certain tag fields is well documented for wave files and has been around for 10 years. Even Adobe Audition, Stienberg Wavlab, Sony Soundforge (off the top of my head) all make use of this 'non-standard'.

There are also BWF and cart chunks as used by commercial broadcasters. Not overly stuff for your Average Joe, but all equally valid and used.

how to convert WAV files to WMA lossless with Tags

Reply #15
Well, a quick bit of hacking around with the standard raw wave input decoder has at least proved it will work - converted a couple of albums to wma lossless and they work nicely on the Xbox 360

Code needs tidying up as four files ended up without tags and the error logging lines are commented out  And because the GetIDTagElement static member is called repeatedly with an incrementing file counter, it reads the file repeatedly to find the tags so its a bit slower than necessary.

I'm currently storing ARTIST, TITLE, GENRE, ALBUM AND TRACK but when viewing the tracks I can view them by Album or Artist but I can't view them by 'Albums by a specific Artist' - when looking at the Album the artist is showing as 'unknown'.

When looking in Windows Media Player's Advanced Tag Editor there seems to be an 'Album Artist' field - should I be filling that in too?

Cheers for the info spoon - if you need beta testers for the r12 let me know.  I'll probably have converted all my files by then but I'm happy to help out if you need some extra testing.

how to convert WAV files to WMA lossless with Tags

Reply #16
Quote
When looking in Windows Media Player's Advanced Tag Editor there seems to be an 'Album Artist' field - should I be filling that in too?


That should be optional if everything is working correctly; the idea is that you only need it set on albums where tracks may have different (or multiple) Artist tags on each track... but you still want to be able to sort by the overall "disc spine" Album Artist (like browsing through a record store)...

I like Album Artist, and all Microsoft media related tools (Windows Media Center, Media Player, Media Connect, Media Center Extender, etc.) seem to take advantage of it.  So, go ahead and set it... and see if the browsing behavior improves.  (WMP 10 adds it to everything ripped in WMA Lossless.)

By the way, you don't need to use the "Advanced Tag Editor" in WMP 10 -- Album Artist is a basic viewable library column in WMP 10.  If it's not there, right click and add it... you can make easy bulk changes this way.  (Highlight/select all the files you want changed, right click one file's column you want to tweak .. and click edit.)

how to convert WAV files to WMA lossless with Tags

Reply #17
Right, Album Artist tag is sorted - thanks for the help.

However, I am getting the following error on several of my WAV files:

- Error decoded data is not block aligned

I've managed to figure out the files that were failing and it happens every time (there's no filename included, even when it was running in a batch mode from the file selector!).

It gets all of the way through the conversion and fails right at the end - I can't see where/why because the main EXE has no debug info, but its after the destructor for the clsWave fires

I've gone back to the default source I downloaded and that does the same thing (though of course I changed .RAW to .WAV). 

The files convert absolutely fine when using the default WAVE converter so I take it the source code isn't the same as the actual WAV converter dbPowerAmp itself uses (the built file is 25k but the default one is 41k).

Any chance of getting an up to date one?

how to convert WAV files to WMA lossless with Tags

Reply #18
>Error decoded data is not block aligned

This likely means there are perhaps 2 channels of audio data in the source wave file, but the very last sample only channel 1 is given out, so 2 bytes are missing.

 

how to convert WAV files to WMA lossless with Tags

Reply #19
Quote
>Error decoded data is not block aligned

This likely means there are perhaps 2 channels of audio data in the source wave file, but the very last sample only channel 1 is given out, so 2 bytes are missing.
[a href="index.php?act=findpost&pid=355052"][{POST_SNAPBACK}][/a]


OK, but any ideas why the included decoder works fine (I guess it might ignore it?) when the one compiled from the source is failing - its the same WAV file passed in to both instances.

If it is that, I guess a fix would be to check for this in the OutputWantsABlockOfData function.

The clsWave constructor defines the align as:

   OutputingWFX.nChannels = 2;
   OutputingWFX.wBitsPerSample = 16;
   OutputingWFX.nBlockAlign = (OutputingWFX.nChannels * OutputingWFX.wBitsPerSample) / 8;

So that's 4 bytes a time that is expected so I guess if it sets up the IsEOF I should check that the buffer returned a number of bytes divisible by four, then if it didn't just decrement it to be on the 4-byte boundary.  Much like this:

Quote
//------is last of file?-----
   if (dwFileBytesRead == dwDataLen)
   {
  IsEOF = true;
  /* Right, now we need to ensure we have a correctly aligned final sample */
 
  DWORD remval;
  remval = ToRet % OutputingWFX.nBlockAlign;
  if (remval > 0)
     ToRet -= remval;
 
   }


Output from my debug logging:
Processing File Coldplay\X&Y\A Message.wav
Final sample is 29342 bytes
Final sample reduced to 29340 bytes (2 extra removed)

You were spot on! And it works perfectly - thanks again (I included the code here just in case anyone does a search and needs the fix themselves).

how to convert WAV files to WMA lossless with Tags

Reply #20
The real question is, why did that file have 1 channel sample (2 bytes) missing?

>OK, but any ideas why the included decoder works fine (I guess it might ignore it?)

It will do the same as you are, pass only block aligned data out.

how to convert WAV files to WMA lossless with Tags

Reply #21
Quote
The real question is, why did that file have 1 channel sample (2 bytes) missing?


Er, could be because I'm not stipping the header tags off the end of the file - the whole file is being passed through - will the encoder look for them, or should i be scanning the data as I read it for the RIFF chunks?