HydrogenAudio

Hosted Forums => foobar2000 => General - (fb2k) => Topic started by: OrcaMarinha on 2010-12-17 23:44:55

Title: Converting to WMA
Post by: OrcaMarinha on 2010-12-17 23:44:55
Is there a way to convert FLAC to WMA using foobar just like its possible to converto to mp3 ?
Title: Converting to WMA
Post by: kode54 on 2010-12-18 01:23:49
[a href='index.php?showtopic=47759']This topic[/a] has instructions for setting up the converter to produce WMA 9 files.
Title: Converting to WMA
Post by: Merlin_de on 2011-01-05 14:39:42
Is there a way to convert FLAC to WMA using foobar just like its possible to converto to mp3 ?


hello,
since win7 MS decide to change from old WM9Encoder (COM based ) to the new Windows Media Encoder IWMEnc Interface.
WME is afaik part of the Windows Media Player. therfor win7 user dont need to install WM9Encoder (dont work anny more).

based on the BASS audio library http://www.un4seen.com/ (http://www.un4seen.com/) i made a small console app that convert
*.mp3;*.mp2;*.mp1;*.ogg;*.wav;*.aiff;*wma -> wma.

the command line is the same as used by the known WMCmd.vbs / WME9.vbs
eg.

Encoder: WMAenc.exe
Ext: wma
Parameter: -a_codec WMASTD -a_setting Q50_44_2 -input "-" -output %d

-input "-" = input from STD
-input "%s" = foobar temp file
-input "D:\myFile.mp3" = file

-output %d = output file name (foobar variable)
-output"D:\myFile.mp3" = output file name

-a_setting Q50_44_2 = VBR 50% 44000 kbits 2 channel    (use other supportet wma codecs if you want)
-a_setting Q100_44_2 = lossless

you use
.\ WMAenc.exe
.\Bass\bass.dll
.\Bass\basswma.dll

WMAenc.exe work on all win >= win2k
on win2k - xp  WM9Encoder.exe codecs from MS must be install onyour system (like for WMCmd.vbs / WME9.vbs)
on win7 only the win7 Windows Media Player must be install.

i am noob in dev plugins for foobar, so i need help from a dev to create a foobar plugin enviroment for the Converter Setup page (like the Flac GUI page). if some dev can help me, i can make a nice GUI Plugin for foobar.

maybe some dev contact me.

DOWNLOAD:
WMAEncoder.zip (http://merlins-miranda.googlecode.com/files/WMAEncoder.zip)
Title: Converting to WMA
Post by: tgckpg on 2011-01-10 20:29:25
Good! Thanks! I'm using windows 7 and confused with wma!
Great! Works fine!
Title: Converting to WMA
Post by: mudlord on 2011-01-11 04:36:08
GUI component?

What do you need? Does it need to be a context menu item? To me, it would make much more sense taking selected entries, decoding to PCM, and then piping them to the WMA encoder. Only issue I can see there then is you need to make BASS/BASSWMA somehow multiinstance usable. But then you support *any* format that FB2K supports...Plus, it should remove the dependancy on bass.dll itself, as it seems BASSWMA's encoder can be called without a BASS instance.

edit: Noticed a issue with your encoder. Seems to crash whenever no parameters are given to it. I assume the encoder was coded in Delphi or Visual Basic? (judging from the error message)
Title: Converting to WMA
Post by: saivert on 2011-01-11 18:47:54
It is because he didn't check for parameters in his program. The only error is that you didn't provide the required paramters -input -output and -a_setting.

pebkac
(http://i29.photobucket.com/albums/c276/saivert/wmaenc-fb2k-setup.png)

Quote
i am noob in dev plugins for foobar, so i need help from a dev to create a foobar plugin enviroment for the Converter Setup page (like the Flac GUI page). if some dev can help me, i can make a nice GUI Plugin for foobar.

FLAC has a special setup dialog because foobar2000 directly supports it. You still need to provide flac.exe as it doesn't come with the encoder. It only has a built-in setup dialog. Same with wavpack, ogg vorbis, mp3, wav, et.al.
All other formats need to be setup with the custom option, including wmaenc.
Title: Converting to WMA
Post by: eevan on 2011-01-12 16:59:05
I tried this tool on x32 Win 7 Ultimate and got the WMAPRO encoded files without any problems. But when I tried to play them in Rockboxed Fuze v2, I noticed some issues, so I run them through foobar2000's Verify Integrity tool. This is the result:
Code: [Select]
Item: "G:\MUSIK\Alice In Chains\The Essential\10 - Them Bones.wma"
Warning: Reported length is inaccurate : 2:30.045000 vs 2:30.000000 decoded

Item: "G:\MUSIK\Alice In Chains\The Essential\11 - Angry Chair.wma"
Warning: Reported length is inaccurate : 4:48.413000 vs 4:48.367347 decoded

Item: "G:\MUSIK\Alice In Chains\The Essential\12 - Would_.wma"
Warning: Reported length is inaccurate : 3:28.163000 vs 3:28.117914 decoded

Item: "G:\MUSIK\Alice In Chains\The Essential\13 - Dirt.wma"
Warning: Reported length is inaccurate : 5:16.746000 vs 5:16.700680 decoded

Item: "G:\MUSIK\Alice In Chains\The Essential\16 - Rooster.wma"
Warning: Reported length is inaccurate : 6:16.236000 vs 6:16.190476 decoded


All items decoded successfully.
5 items decoded with minor problems.

List of decodable but suspicious items:
"G:\MUSIK\Alice In Chains\The Essential\10 - Them Bones.wma"
"G:\MUSIK\Alice In Chains\The Essential\11 - Angry Chair.wma"
"G:\MUSIK\Alice In Chains\The Essential\12 - Would_.wma"
"G:\MUSIK\Alice In Chains\The Essential\13 - Dirt.wma"
"G:\MUSIK\Alice In Chains\The Essential\16 - Rooster.wma"

Files play normally in foobar or WMP, but I'd like to know if anybody else get these inaccurate length warnings. Maybe that's a source of playback problem on Rockbox...

Files were converted from TAK lossless sources using foobar2000's converter and WMAenc.exe tool. Parameters used:
-a_codec WMAPRO -a_mode 2 -a_setting Q90_44_2_24 -input %s -output %d

Cheers!
Title: Converting to WMA
Post by: lvqcl on 2011-01-12 17:37:18
Quote
I'd like to know if anybody else get these inaccurate length warnings

That's normal for WMA in foobar2000.
Title: Converting to WMA
Post by: kode54 on 2011-01-12 22:25:11
This is a limitation of the stream format used by WMA files, namely ASF. It appears to store packet play position timestamps and durations in milliseconds. Thus, Microsoft's own WMA handling code is limited to returning track lengths in milliseconds.
Title: Converting to WMA
Post by: eevan on 2011-01-12 23:38:11
Thanks for clarification!
Title: Converting to WMA
Post by: Zin-Uru on 2011-01-20 13:56:55
Very good! Thank you!
Title: Converting to WMA
Post by: Zin-Uru on 2011-01-21 07:10:29
It seems like your encoder does not support 2-pass encoding. Or some special parameters needed?
Title: Converting to WMA
Post by: dazzle on 2011-01-21 11:09:19
Hi,

I have just tried the WMAenc.exe in EAC and it's working flawless. What I miss is an opportunity to tag my .wma files when I rip them. With the old WMencoder from EAC it was possible. Does anyone know if there are any parameters that could be added which would then write the tags. EAC has already the tags from freedb.

I have tried this: -output %d -author "%a" -title "%t"

But it does not work - no tags :-(

Can anyone help?

Regards
Dazzle
Title: Converting to WMA
Post by: Merlin_de on 2011-01-21 23:58:56
It seems like your encoder does not support 2-pass encoding. Or some special parameters needed?


no it dont support 2-pass encoding coz basswma.dll dont support it.


I have tried this: -output %d -author "%a" -title "%t"

But it does not work - no tags :-(


tagging is not support, maybe in next release if more people want tagging
Title: Converting to WMA
Post by: Steve Forte Rio on 2011-01-22 13:29:17
Why does encoder can't work without bass libraries even if they aren't needed (foobar2000 encoding)?
Can you fix this?
Title: Converting to WMA
Post by: Merlin_de on 2011-01-22 14:43:08
Why does encoder can't work without bass libraries even if they aren't needed (foobar2000 encoding)?
Can you fix this?


WMAenc is only a wrapper for bass libs. the encoding is done inside basswma.dll.
i don't intend to code the whole wma encoding for the diffrent windows version native by c++ at this time.

what is the problem with the 2 dll ?
Title: Converting to WMA
Post by: Steve Forte Rio on 2011-01-22 17:08:06
It is always more convenient to use only one executable file for encoding...



Quote
the encoding is done inside basswma.dll


And this library in it's turn uses some Windows libs? Am I right?
Title: Converting to WMA
Post by: mudlord on 2011-01-22 21:30:42
Most likely is a wrapper to the encoder/decoder DMO...

Quote
It is always more convenient to use only one executable file for encoding...


Yes, it would make sense using the encoder DMOs natively...no matter how obtuse and stupid the APIs are.
Title: Converting to WMA
Post by: Ljubo44 on 2011-01-22 22:51:30
is there any way to convert WAV 24-bit/96kHz 2CH to WMA 24/96 - 768kbps 2CH
So far I have seen only 5,1 CH but how to be in only 2 channels stereo on that bitrate?
Title: Converting to WMA
Post by: Merlin_de on 2011-01-22 23:36:04
is there any way to convert WAV 24-bit/96kHz 2CH to WMA 24/96 - 768kbps 2CH
So far I have seen only 5,1 CH but how to be in only 2 channels stereo on that bitrate?


he microsoft wma encoding always depend on the source audio format
if you dont resample (change input audio format) afaik you only can use wmaprofessional

Parameter: -a_codec WMAPRO -a_setting xxx_96_2_24 -input "-" -output "%d"

xxx can be afaik
Q100, Q98, Q90 or Q75 (VBR mode - Q100= lossless )
or
440, 384, 256 or 128 (CBR mode)

other values like 768kbps not support by microsoft (for 96kHz, 2 channel, 24bps source)
Title: Converting to WMA
Post by: Ljubo44 on 2011-01-23 00:36:10
on Q98_96_2_24 after encoding i get wma on 337kbps with a lot of losses and missing blocks in audio file from 16kHz to 48kHz 
Q100_96_2_24 is 3207kbps and very big file. 
but thanks for help
Title: Converting to WMA
Post by: Apesbrain on 2011-01-23 01:46:16
The only form of WMA that supports 24/96 is WMA Lossless.  You can follow the guidelines in this thread (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=47759&view=findpost&p=740429) and use the following parameters:

//NoLogo -silent -input %s -output %d -a_codec WMA9LSL -a_mode 2 -a_setting Q100_96_2_24

Or continue what you've started here and make the equivalent changes.

I just converted a 2-channel 24/96 FLAC file to 24/96 WMA Lossless in foobar2000 using WMEncoder and it worked fine; converting from a 24/96 WAV should be no different.
Title: Converting to WMA
Post by: dazzle on 2011-01-23 10:32:13

Thank you for the answer - I just have to use mp3tag for now then until hopefully more would like to see the tag function. Thank you for the converter - it works great.
Title: Converting to WMA
Post by: mudlord on 2011-01-23 12:54:21
Quote
It is always more convenient to use only one executable file for encoding...


Started to write a native Windows Media Audio encoder though...so no outside DLLs.
Title: Converting to WMA
Post by: Merlin_de on 2011-01-23 21:04:16
WMAenc 0.1.0.2 beta released

changelog:
- fix crash if call with no args
- add preencode tagging support
  (do not use inside foobar convert !!! foobar tagg after convert)

Tagging:
Code: [Select]
option          related wma attribute (hardcodet)
-album          "WM/AlbumTitle"
-albumartist    "WM/AlbumArtist"
-trackno        "WM/TrackNumber"
-discno         "WM/PartOfSet"
-title          "Title"
-author         "Author"
-description    "Description"
-copyright      "Copyright"
-rating         "Rating"
-year           "WM/Year"
-genre          "WM/Genre"


example for EAC:
-a_codec WMASTD -a_setting Q50_44_2 -input "-" -output "Test.wma" -album "%g" -trackno "%n" -title "%t" -author "%a" -year "%y" -genre "%m"


Download (http://merlins-miranda.googlecode.com/files/WMAEncoder.zip)
Title: Converting to WMA
Post by: polemon on 2011-01-25 12:32:51
Is there a Linux build of WMAenc? I mean something like LAME but for WMA and since it's closed source, I wonder if there's a windows build for it.
I'm not too much interested in using it, but I'd like to run some tests, since judging by what's on the Wikipedia page about WMA (http://en.wikipedia.org/wiki/Windows_Media_Audio#Sound_quality), there seems to be quite a lot of arguing going on about the quality WMA has...
Title: Converting to WMA
Post by: dv1989 on 2011-01-25 12:45:23
I'd like to run some tests, since judging by what's on the Wikipedia page about WMA (http://en.wikipedia.org/wiki/Windows_Media_Audio#Sound_quality), there seems to be quite a lot of arguing going on about the quality WMA has...

From that article (Microsoft’s own outlandish claims aside):
Quote
Double blind listening tests with other lossy audio codecs have shown varying results, from failure to support Microsoft's claims about its superior quality to supremacy over other codecs.
The only test that purports to indicate the latter is this one:
Quote
At 64 kbit/s (http://www.microsoft.com/windows/windowsmedia/forpros/codecs/comparison.aspx), WMA Pro outperformed Nero HE-AAC in a commissioned, independent listening test performed by the National Software Testing Labs in 2005. Out of 300 participants, "71% of all listeners indicated that WMA Pro was equal to or better than HE AAC."
The given link now redirects to a page that merely describes Windows Media codecs. Is there a functional link? Was the test double-blind, as the others organised by Hydrogenaudio members Sebastian Mares, rjamorim, etc. obviously were?
Title: Converting to WMA
Post by: polemon on 2011-01-25 17:30:29
From that article (Microsoft’s own outlandish claims aside):
Quote
Double blind listening tests with other lossy audio codecs have shown varying results, from failure to support Microsoft's claims about its superior quality to supremacy over other codecs.
The only test that purports to indicate the latter is this one:
Quote
At 64 kbit/s (http://www.microsoft.com/windows/windowsmedia/forpros/codecs/comparison.aspx), WMA Pro outperformed Nero HE-AAC in a commissioned, independent listening test performed by the National Software Testing Labs in 2005. Out of 300 participants, "71% of all listeners indicated that WMA Pro was equal to or better than HE AAC."

All I can conclude from that article, is that results were inconclusive, so I decided to make my own testing. Also, that Test were 71% said it outperforms HE-AAC, is already almost six years old, there has been a number of releases of NeroAAC in the meantime.
Title: Converting to WMA
Post by: jaro1 on 2011-01-29 14:10:38
Quote
It is always more convenient to use only one executable file for encoding...


Started to write a native Windows Media Audio encoder though...so no outside DLLs.


It will be great to create cmd wma encoder, that will depend only on system dll (wmadmoe.dll). Will it be difficult to do it with pipe support (without the need to create tmp file at first)?
Title: Converting to WMA
Post by: Merlin_de on 2011-01-31 01:29:55
It will be great to create cmd wma encoder, that will depend only on system dll (wmadmoe.dll). Will it be difficult to do it with pipe support (without the need to create tmp file at first)?


pipe support is easy, the main work is stupid coz we need one way for the old wm9 support and a second way for the new media foundation.

the basswma.dll dev make a great work and do all this for us. it is designed as a free lib.
1. it is portable coz user dont need to register the dll.
2. we can use the my WMAencoder independent from foobar and convert eg flac or other codec direct from source to wma (not yet implement: basswv.dll, bass_ape.dll, bassflac.dll bassmidi.dll,  bass_aac.dll ..... etc)
3. bass.dll has direct pipe support

it is no problem to put the dll inside the exe file, but this only grow up the exe file size
i like the design of the bass plugins coz it is very expandable and user-friendly 

feel free to reinvent the wheel again (to code all this again and again)
i think you dont have the know how and the time to do this 
Title: Converting to WMA
Post by: jaro1 on 2011-02-20 10:05:43
Merlin or someone else who knows his command functions 100% properly, please write an EXACT command for losslessly converting file.wav (16/44) to file.wma (16/44) when using normal Windows cmd (not the command related to fb2k, eac, etc...), with your bass related encoder.

Than please, write an EXACT command for the same type of conversion, using fb2k.

I know the instructions in this topic, the problem is, that in foobar the conversion will start when applied the parameters written in this thread, but the conversion is terribly slow (~0.80x realtime), and in Windows cmd the conversion doesn't start at all.

I want only to know, where is the flaw, because i don't think this is a normal behavior (in the case of fb2k, with Windows cmd i'm completelly wrong), thanks.

os: W7 x86
fb2k parameter applied: -silent -input - -output %d -a_codec WMA9LSL -a_mode 2 -a_setting Q100_44_2_16
Title: Converting to WMA
Post by: lvqcl on 2011-02-20 10:40:57
Works here:
WMAenc.exe -silent -input test.wav -output test.wma -a_codec WMA9LSL -a_mode 2 -a_setting Q100_44_2_16
Or even:
WMAenc.exe -silent -input - -output test.wma -a_codec WMA9LSL -a_mode 2 -a_setting Q100_44_2_16 < test.wav

Foobar2000:
parameters: -silent -input %s -output %d -a_codec WMA9LSL -a_mode 2 -a_setting Q100_44_2_16
or even: -input %s -output %d -a_codec WMA9LSL -a_setting Q100_44_2
highest BPS mode: 16

("-input -" works too, but foobar2000 reports "Length mismatch" for WMA files coverted this way: e.g. original file has 7479360 samples, WMA file has 7479000 samples)
Title: Converting to WMA
Post by: jaro1 on 2011-02-20 11:41:46
In the case of fb2k, nothing has changed, so conversion starts with the rate below 1.0x realtime.
In the case of Windows cmd, it will start but with the same rate as with fb2k. Nobody didn't mention this problem here (maybe WXP), so from my point of view if its all right with my system, bass related encoder is unusable under W7, its strange.
Thanks for your reply and help.
Title: Converting to WMA
Post by: lvqcl on 2011-02-20 12:28:00
My OS is Win7 x64.  Core2 2500 MHz, ~50 x realtime encoding.

Maybe your HDD is too fragmented?
Title: Converting to WMA
Post by: jaro1 on 2011-02-20 14:50:04
So, it seems it could be related to cpu architecture (nothing to do with fragmentation).
My PC: W7 x86, K8 (Athlon 64 3200+, sc. 754)

I've done the testing conversion on one notebook with Core2 mobile (Pentium DC) without the problem.
It will be good if someone else with old K8 could confirm the strange encoding behavior (encoding rate <1.0x realtime) with this bass related cmd wma encoder.
Otherwise its something with my system, but i haven't slightest clue what it should be.
Title: Converting to WMA
Post by: lvqcl on 2011-02-20 15:51:34
What is the speed of WAV->FLAC converting?
Title: Converting to WMA
Post by: Merlin_de on 2011-02-20 16:43:51
So, it seems it could be related to cpu architecture (nothing to do with fragmentation).
My PC: W7 x86, K8 (Athlon 64 3200+, sc. 754)


hi,
do you work on network path (with wlan) ?
do you has low RAM ?
do you have other prog like virusscanner active for check wav and wma on demand ?
Title: Converting to WMA
Post by: jaro1 on 2011-02-20 18:33:07
I don't understand, how is Flac related with bass wma encoder, but the answer is ~55x realtime. I haven't similar problem with other encoders as with standalone usage or with fb2k.
I don't work on network path, have enough RAM (1.5GB), MS Security essentials installed but cpu usage during conversion is almost 100% allocated by WMAenc, antivirus is idle at that moment.
It will be really good to check the case with other K8, because i really don't see any collidating process with the conversion.
Thanks for comments.
Title: Converting to WMA
Post by: lvqcl on 2011-08-30 21:15:39
A small command-line WMA encoder is available here - http://www.hydrogenaudio.org/forums/index....showtopic=90519 (http://www.hydrogenaudio.org/forums/index.php?showtopic=90519)
Title: Converting to WMA
Post by: Nick.C on 2011-08-30 21:47:47
Excellent - tried it with my 55 sample test set both losslessly and after processing with lossyWAV (using --codec lossless).

It doesn't work with mono unfortunately.

It does however take advantage of the zeroed LSBs in lossyWAV output, resulting in smaller output files for lossyWAV processed audio (402 kbit/s [-q X] vs 806 kbit/s).
Title: Converting to WMA
Post by: jaro1 on 2011-08-30 22:52:22
Wow, many thanks, works fine here.

Only short note to Merlins bass-based wma encoder, now i remember, shortly after a discussion stopped in this thread for some time i´ve discovered the problem, with the Process Explorer help. It seemed slow encoding (<1.0x)  was in wrong "priority redistributing"(?) of hard-adjusted two encoding threads competing with each other and it is related to all single-core CPUs (regardless of architecture, this problem can be reproduced also with dual-core with setting the WMAenc.exe affinity (e.g. in Taskman) to one core only) i´ve sent him a PM about it, no fix since then. Curious, what is the behavior with more than dual-core CPUs..
Title: Converting to WMA
Post by: lvqcl on 2011-08-31 15:48:34
It doesn't work with mono unfortunately.


Yes, WMA lossless supports only stereo and 5.1 files.

In theory, it is possible to add mono -> stereo conversion to the encoder, but now it doesn't perform any conversion itself.
Title: Converting to WMA
Post by: nbarzgar on 2012-04-17 17:33:59
hello,
since win7 MS decide to change from old WM9Encoder (COM based ) to the new Windows Media Encoder IWMEnc Interface.
WME is afaik part of the Windows Media Player. therfor win7 user dont need to install WM9Encoder (dont work anny more).

based on the BASS audio library http://www.un4seen.com/ (http://www.un4seen.com/) i made a small console app that convert
*.mp3;*.mp2;*.mp1;*.ogg;*.wav;*.aiff;*wma -> wma.

the command line is the same as used by the known WMCmd.vbs / WME9.vbs
eg.

Encoder: WMAenc.exe
Ext: wma
Parameter: -a_codec WMASTD -a_setting Q50_44_2 -input "-" -output %d

-input "-" = input from STD
-input "%s" = foobar temp file
-input "D:\myFile.mp3" = file

-output %d = output file name (foobar variable)
-output"D:\myFile.mp3" = output file name

-a_setting Q50_44_2 = VBR 50% 44000 kbits 2 channel    (use other supportet wma codecs if you want)
-a_setting Q100_44_2 = lossless

you use
.\ WMAenc.exe
.\Bass\bass.dll
.\Bass\basswma.dll

WMAenc.exe work on all win >= win2k
on win2k - xp  WM9Encoder.exe codecs from MS must be install onyour system (like for WMCmd.vbs / WME9.vbs)
on win7 only the win7 Windows Media Player must be install.

i am noob in dev plugins for foobar, so i need help from a dev to create a foobar plugin enviroment for the Converter Setup page (like the Flac GUI page). if some dev can help me, i can make a nice GUI Plugin for foobar.

maybe some dev contact me.

DOWNLOAD:
WMAEncoder.zip (http://merlins-miranda.googlecode.com/files/WMAEncoder.zip)


Thanks so much, works great here from inside foobar2000 (x86)!!
Was searching around for quite a while since the former method (http://www.hydrogenaudio.org/forums/index.php?showtopic=47759) stopped working.

I use as parameters (just in case someone was wondering - I liked that setting):
(using the Custom-settings-window in f2k's convert-dialogue)
-silent -a_codec WMA9STD -a_mode 2 -a_setting Q75_44_2 -input %s -output %d