HydrogenAudio

Hosted Forums => foobar2000 => General - (fb2k) => Topic started by: Egor on 2006-08-27 11:16:06

Title: How to set up Converter for WMA 9
Post by: Egor on 2006-08-27 11:16:06
[!--sizeo:1--][span style=\"font-size:8pt;line-height:100%\"][!--/sizeo--]Known issues:[/size]

1. Download and install Windows Media Encoder (http://www.microsoft.com/windows/windowsmedia/forpros/encoder/default.mspx). Additionally, to enable the latest available WMA encoder version you need to download and install the latest Windows Media Player (http://www.microsoft.com/windows/windowsmedia/download/AllDownloads.aspx). The latest versions of WMA are only available for Windows XP or newer.

2. Choose the codec you want: WMA Standard, WMA Professional or WMA Lossless. Most hardware players support only WMA Standard.

3. Your encoding will be Quality-based VBR. For other WMA codecs/formats see Windows Media Encoder help.
Quote
With quality-based VBR encoding, you specify a desired quality level (from 0 to 100). Then, during encoding, the bitrate fluctuates according to the complexity of the stream — a higher bitrate is used for intense detail, and a lower bitrate is used for simpler content. The advantage of quality-based VBR encoding is that quality remains consistent across all streams for which you specify the same quality setting. The disadvantage is that you cannot predict the file size or bandwidth requirements of the encoded content before encoding. Quality-based VBR encoding uses one-pass encoding.

Setup foobar2000 converter as follows:
 - go to Preferences -> Converter page
 - click Add New
 - choose Encoder -> Custom and change all the needed parameters (see below)
 - the list of green-colored argument options is based on the latest available (2008-07-20) WMA codec and some options may be not available for your system.

WMA Standard, Quality-based VBR

 Encoder: C:\Program Files\Windows Media Components\Encoder\WMCmd.vbs
 Extension: wma
 Parameters: -silent -a_codec WMA9STD -a_mode 2 -a_setting Q75_44_2 -input %s -output %d
 Format is: lossy
 Highest BPS mode supported: 24
 Encoder name: WMA Standard
 Bitrate: <blank>
 Settings: VBR quality-based

Change the argument marked with green color according to the table:
Code: [Select]
Argument                Quality         Sampling rate       Channel
------------------------------------------------------------------------------------
Q98_44_2                Q98            44                  2
Q98_48_2                Q98            48                  2
Q90_44_2                Q90            44                  2
Q90_48_2                Q90            48                  2
Q75_44_2                Q75            44                  2
Q50_44_2                Q50            44                  2
Q25_44_2                Q25            44                  2
Q10_44_2                Q10            44                  2

WMA Professional, Quality-based VBR

 Encoder: C:\Program Files\Windows Media Components\Encoder\WMCmd.vbs
 Extension: wma
 Parameters: -silent -a_codec WMA9PRO -a_mode 2 -a_setting Q75_44_2_24 -input %s -output %d
 Format is: lossy
 Highest BPS mode supported: 24
 Encoder name: WMA Professional
 Bitrate: <blank>
 Settings: VBR quality-based

Change the argument marked with green color according to the table:
Code: [Select]
Argument                Quality         Sampling rate       Channel   BitsPerSample
------------------------------------------------------------------------------------
Q98_44_2_24            Q98            44                  2        24
Q98_44_6_16            Q98            44                  6        16
Q98_48_2_24            Q98            48                  2        24
Q98_48_6_24            Q98            48                  6        24
Q98_88_2_24            Q98            88                  2        24
Q98_88_6_24            Q98            88                  6        24
Q98_96_2_24            Q98            96                  2        24
Q98_96_6_24            Q98            96                  6        24
Q90_44_2_24            Q90            44                  2        24
Q90_44_6_16            Q90            44                  6        16
Q90_48_2_24            Q90            48                  2        24
Q90_48_6_24            Q90            48                  6        24
Q90_88_2_24            Q90            88                  2        24
Q90_88_6_24            Q90            88                  6        24
Q90_96_2_24            Q90            96                  2        24
Q90_96_6_24            Q90            96                  6        24
Q75_44_2_24            Q75            44                  2        24
Q75_44_6_16            Q75            44                  6        16
Q75_48_2_24            Q75            48                  2        24
Q75_48_6_24            Q75            48                  6        24
Q75_88_2_24            Q75            88                  2        24
Q75_88_6_24            Q75            88                  6        24
Q75_96_2_24            Q75            96                  2        24
Q75_96_6_24            Q75            96                  6        24
Q50_44_2_24            Q50            44                  2        24
Q50_44_6_16            Q50            44                  6        16
Q50_48_2_24            Q50            48                  2        24
Q50_48_6_24            Q50            48                  6        24
Q25_44_2_24            Q25            44                  2        24
Q25_44_6_16            Q25            44                  6        16
Q25_48_2_24            Q25            48                  2        24
Q25_48_6_24            Q25            48                  6        24
Q10_44_2_24            Q10            44                  2        24
Q10_44_6_16            Q10            44                  6        16
Q10_48_2_24            Q10            48                  2        24
Q10_48_6_24            Q10            48                  6        24

WMA Lossless

Encoder: C:\Program Files\Windows Media Components\Encoder\WMCmd.vbs
 Extension: wma
 Parameters: -silent -a_codec WMA9LSL -a_mode 2 -a_setting Q100_44_2_16 -input %s -output %d
 Format is: lossless
 Highest BPS mode supported: 24
 Encoder name: WMA Lossless
 Bitrate: <blank>
 Settings: VBR Quality 100

Change the argument marked with green color according to the table:
Code: [Select]
Argument                Quality         Sampling rate       Channel
------------------------------------------------------------------------------------
Q100_44_2_16            Q100            44                  2        16
Q100_44_2_24            Q100            44                  2        24
Q100_48_2_24            Q100            48                  2        24
Q100_48_6_24            Q100            48                  6        24
Q100_88_2_24            Q100            88                  2        24
Q100_88_6_24            Q100            88                  6        24
Q100_96_2_24            Q100            96                  2        24
Q100_96_6_24            Q100            96                  6        24
Title: How to set up Converter for WMA 9
Post by: 4nt1 on 2006-08-27 11:32:43
maybe I am ignorant but why would anyone in their right mind want to use wma format?

I have wma's and foobar cannot edit their info so that basically makes them useless to me...

nice effort though as maybe someone people will appreciate your work.
Title: How to set up Converter for WMA 9
Post by: Egor on 2006-08-27 11:36:17
maybe I am ignoranct but why would anyone in their right mind want to use wma format?

I have wma's and foobar cannot edit their info so that basically makes them useless to me...

nice effort though as maybe someone people will appreciate your work.

There were several requests about setting up Converter for WMA, so I decided to post instructions. I'll add a warning about tagging problem, thanks for the notice.
Title: How to set up Converter for WMA 9
Post by: Apesbrain on 2006-09-02 13:09:09
It would really be great if someone who knows how could add tag support into the foobar 9.X WMA converter as was in the 8.X version.  I've tried using an external tag writer (TAG.EXE), but it doesn't seem to support WMA tags.

WMA conversion is useful.  My music library is Ogg q6 and that works great on my Rio Karma.  But I often convert tracks for my son's Rio Carbon which only supports WMA and MP3.  At the low bitrate he uses to fit as much as possible into his 5GB, WMA is a fine choice.

Thanks.

NOTE: As of foobar2000 v0.9.4B3, this has been addressed:
http://www.hydrogenaudio.org/forums/index....st&p=433132 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=48037&view=findpost&p=433132)
Title: How to set up Converter for WMA 9
Post by: Egor on 2006-09-03 10:36:21
Check out Mp3tag (and the first line of the message at the top).
Title: How to set up Converter for WMA 9
Post by: saivert on 2006-09-05 15:28:37
Altough I am not conding the use of Windows Media Audio because I have this fanatic fright of Microsoft software I do have to say that the codec is based on newer technology than the MP3 format (yes, MPEG-1/2 Layer 3) and thus is good to use when requiring a codec that handles lower bitrates better. 96kbps WMA just about equals 128kbps MP3.

The best thing would be to just swap the player with one that handles HE-AAC or AACplus. This format really knows how to make the best out of low bitrate.

Also FooBar2000 do not support streaming Windows Media Audio. In order to do this you would need a wrapper for the newer Winamp Windows Media plugin. This plugin handles streaming, tagging and the works.

Regarding the Custom conversion preset:
You have to specify to use the CSCRIPT version for running the VBScript.
Encoder: C:\Windows\System32\cscript.exe
Parameters: "C:\Program Files\Windows Media Components\Encoder\WMCmd.vbs" //nologo -silent -a_codec WMA9STD -a_mode 2 -a_setting Q75_44_2 -input "%s" -output "%d"
This will ensure proper operations under any circumstances.
Title: How to set up Converter for WMA 9
Post by: foosion on 2006-09-05 20:38:55
96kbps WMA just about equals 128kbps MP3.
Can you prove this claim?
Title: How to set up Converter for WMA 9
Post by: saivert on 2006-09-06 00:27:14
96kbps WMA just about equals 128kbps MP3.
Can you prove this claim?


It's not up to me to prove it. Find your own sources. For me it's equal at least. I did not say it is 100% equal. I used the phrase "just about". You will always find differences if you compare them bitwise.
Title: How to set up Converter for WMA 9
Post by: Egor on 2006-09-06 03:38:58
You have to specify to use the CSCRIPT version for running the VBScript.

No, it is not a must, the latest fb2k accepts .vbs and will launch cscript.exe on it's own.

It's not up to me to prove it.

Hehe, you are required to prove, otherwise you will desecrate our hallowed tradition.

Quote
8. All members that put forth a statement concerning subjective sound quality, must -- to the best of their ability -- provide objective support for their claims. Acceptable means of support are double blind listening tests (ABX or ABC/HR) demonstrating that the member can discern a difference perceptually, together with a test sample to allow others to reproduce their findings. Graphs, non-blind listening tests, waveform difference comparisons, and so on, are not acceptable means of providing support. (http://www.hydrogenaudio.org/forums/index.php?showtopic=3974#entry149481)
Title: How to set up Converter for WMA 9
Post by: CharlyAR2 on 2006-10-05 02:56:47
Hi guys.

It worked great, I did two encodes.

But now all I'm getting is "Error flushing file (Object not found) : file://C:\Documents and Settings\Carlos\My Documents\Temp\test.wma"

Have already tried different settings, recreate the "Convert" page, reinstall foobar2000, follow the http://www.hydrogenaudio.org/forums/lofive...php/t48340.html (http://www.hydrogenaudio.org/forums/lofiversion/index.php/t48340.html) post... any ideas? 

Edit: the only thing that changed, is that I removed dBpowerAMP from my computer since I was able to do wat I wanted using foobar2000... could this have a side-effect?  :S

Edit2: I've already tried reinstalling Windows Media Player 11 and Windows Media Encoder as well. And only happens with _THIS_ encoder/converter... and it looks like is _TOO_ fast to be making some conversion...

Edit3 (SOLUTION): I went to Preferences -> Reset All, then re entered the WMA configuration, and now is working again. Dunno why, but it works. 
Title: How to set up Converter for WMA 9
Post by: CharlyAR2 on 2006-10-10 19:13:08
Same error repeats now and then...  "Error flushing file (Object not found) : file://C:\Documents and Settings\Carlos\My Documents\Temp\test.wma" Ideas?

Also... For what I see here... is it possible that there is no way to encode WMAPro Stereo 44Khz, 16 bits, using other bitrate that 32 or 64 kbps??? Am I missing something?
Title: How to set up Converter for WMA 9
Post by: Egor on 2006-10-10 19:49:42
Same error repeats now and then...  "Error flushing file (Object not found) : file://C:\Documents and Settings\Carlos\My Documents\Temp\test.wma" Ideas?

It may be due to erroneous Parameters line or due to output file name that is not accepted by WM encoding script. You can see detailed log in foobar2000 -> View -> Console.

Also... For what I see here... is it possible that there is no way to encode WMAPro Stereo 44Khz, 16 bits, using other bitrate that 32 or 64 kbps??? Am I missing something?

Yes, WMA Professional 2-ch 16-bit option is not available in VBR mode by some reason (it is available for CBR mode though). I think it is safe to use the XXX_44_2_24 option to encode your CDs as there are probably optimizations that will not waste bits. The "24" value means the maximum available resolution, I believe.
Title: How to set up Converter for WMA 9
Post by: CharlyAR2 on 2006-10-10 20:05:03
Same error repeats now and then...  "Error flushing file (Object not found) : file://C:\Documents and Settings\Carlos\My Documents\Temp\test.wma" Ideas?

It may be due to erroneous Parameters line or due to output file name that is not accepted by WM encoding script. You can see detailed log in foobar2000 -> View -> Console.

All I get is this. Any idea why?

Code: [Select]
Startup time : 0:00.128316
CLI encoder: C:\Program Files\Windows Media Components\Encoder\WMCmd.vbs
Destination file: C:\Temp\Billie Jean.wma
cscript.exe "C:\Program Files\Windows Media Components\Encoder\WMCmd.vbs" -silent -a_codec WMA9PRO -a_mode 3 -a_setting 256_44_6_16 -input "C:\Temp\temp-B23E339F6824BF3E7F0725747977F4F0.wav" -output "n.wma"
directory: C:\Temp\


Yes, WMA Professional 2-ch 16-bit option is not available in VBR mode by some reason (it is available for CBR mode though). I think it is safe to use the XXX_44_2_24 option to encode your CDs as there are probably optimizations that will not waste bits. The "24" value means the maximum available resolution, I believe.


Mhmmm... Worth the shot. I will run some tests... as soon as I can get it to work 
Title: How to set up Converter for WMA 9
Post by: Egor on 2006-10-10 20:42:46
All I get is this. Any idea why?

Hmm, just tried on my system and it returns a error "One or more codecs required to open this content could not be found. (0xC00D1B83)". Apparently, Microsoft doesn't support 6-ch WAV files that are compliant with their own standard (http://www.microsoft.com/whdc/device/audio/multichaud.mspx).
Title: How to set up Converter for WMA 9
Post by: CharlyAR2 on 2006-10-10 20:46:01
All I get is this. Any idea why?

Hmm, just tried on my system and it returns a error "One or more codecs required to open this content could not be found. (0xC00D1B83)". Apparently, Microsoft doesn't support 6-ch WAV files that are compliant with their own standard (http://www.microsoft.com/whdc/device/audio/multichaud.mspx).


Oh. Sh.t! 
But... the "little" detail, is that a few days ago I encoded different DTS using this configuration. Even tried the same CD again and now it doesn't work... 
Title: How to set up Converter for WMA 9
Post by: CharlyAR2 on 2006-10-10 21:10:37
Shoot, I found it!
Seems the real filter being used was AC3Filter, and since I've been testing the new version, I deactivated the option “Use AC3Filter for… PCM”.
But I’ll be damned if I know why this works this way. Do you?
Title: How to set up Converter for WMA 9
Post by: Egor on 2006-10-10 21:20:53
OMG, foobar2000 doesn't write multichannel WAVs in WAVE_FORMAT_EXTENSIBLE format, it appears I was wrong about microsoft.

Then, we should [a href='index.php?showtopic=49191']ask[/a] fb2k devs to write multichannel wave files in WAVE_FORMAT_EXTENSIBLE format.

Edit: added a link to the corresponding topic in fb2k support subforum.
Title: How to set up Converter for WMA 9
Post by: CharlyAR2 on 2006-10-11 00:26:30
Arrggghhhhhh, now is not working again! WTF??!?!?!?!?!? 

Any idea where can I start looking? The only difference I find is that the AC3Filter tray icon appears and disapears at a very fast speed, almost flashing, when trying to convert the file. 

Edit: seems the encoding is very sensitive to AC3Filter settings and the input format resulting from that...The sollution was playing with it. If somebody wants (and tell me how to do it) I can post the AC3Filter settings here... I'm lazy abyout taking the screenshots and posting `em 
Title: How to set up Converter for WMA 9
Post by: ye110man on 2006-10-11 17:45:42
Also... For what I see here... is it possible that there is no way to encode WMAPro Stereo 44Khz, 16 bits, using other bitrate that 32 or 64 kbps??? Am I missing something?

Yes, WMA Professional 2-ch 16-bit option is not available in VBR mode by some reason (it is available for CBR mode though). I think it is safe to use the XXX_44_2_24 option to encode your CDs as there are probably optimizations that will not waste bits. The "24" value means the maximum available resolution, I believe.

Nope. I just tried it. Results in a much bigger file.
Looks like the only options are WMAPRO CBR or WMASTD VBR. Which do you think is better?
Title: How to set up Converter for WMA 9
Post by: CharlyAR2 on 2006-10-11 18:59:56
Yes, WMA Professional 2-ch 16-bit option is not available in VBR mode by some reason (it is available for CBR mode though). I think it is safe to use the XXX_44_2_24 option to encode your CDs as there are probably optimizations that will not waste bits. The "24" value means the maximum available resolution, I believe.

Nope. I just tried it. Results in a much bigger file.
Looks like the only options are WMAPRO CBR or WMASTD VBR. Which do you think is better?

The strange thing is that, from within Windows Media Player, the "quality" is being shown in bytes (and allows 192kbps) and not in %...

(http://img175.imageshack.us/img175/2926/wmams3.th.gif) (http://img175.imageshack.us/my.php?image=wmams3.gif)

Edit: BTW, anybody knows if is there a way to use the .dts as input for WMA, WITHOUT transcoding it to .wav? After all, is not a "standard" wav either, because AC3Filter is still needed to play it...
Title: How to set up Converter for WMA 9
Post by: Egor on 2006-10-12 05:29:00
Nope. I just tried it. Results in a much bigger file.

How did you compare?
Title: How to set up Converter for WMA 9
Post by: ye110man on 2006-10-12 05:57:39
Nope. I just tried it. Results in a much bigger file.

How did you compare?

16-bit CBR vs. 24-bit VBR.
Title: How to set up Converter for WMA 9
Post by: Egor on 2006-10-12 06:53:10
Nope. I just tried it. Results in a much bigger file.

How did you compare?

16-bit CBR vs. 24-bit VBR.

Well, it's obviously not a valid comparison.
Title: How to set up Converter for WMA 9
Post by: Aqua1ung on 2008-07-18 18:28:11
Here's the type of error I am getting:

Code: [Select]
Source: "D:\Aqualung\Desktop\MP3\Judas Priest\07 - Victim Of Changes.flac"
  An error occured while finalizing the encoding process (Object not found) : "D:\Aqualung\Desktop\MP3\Judas Priest\1 Victim Of Changes.wma"
  Conversion failed: Object not found


1 out of 1 tracks converted with major problems.


What am I doing wrong?
Title: How to set up Converter for WMA 9
Post by: Egor on 2008-07-18 18:31:53
Carefully verify your settings or post a screenshot of the corresponding settings window.
Title: How to set up Converter for WMA 9
Post by: Aqua1ung on 2008-07-18 23:49:29
Carefully verify your settings or post a screenshot of the corresponding settings window.


Here goes: [can't upload photos, will attempt to send them to you via email]
Title: How to set up Converter for WMA 9
Post by: Egor on 2008-07-20 10:02:11
Your settings are OK, but there's a known problem with x64 systems and foobar2000' converter (various command line encoders were used):
Error Flushing File: Object not found, "Convert to..." error (http://www.hydrogenaudio.org/forums/index.php?showtopic=56979)

Unfortunately, there's no comment or solution by the developer.
I use Vista x64 for development, been using it since RC1 days (late 2006), I'm yet to see any of those issues in Converter - if those occur only with custom presets, it sounds like another case of PEBKAC to me.
Title: How to set up Converter for WMA 9
Post by: gottogo99 on 2009-01-12 02:26:24
My car player only supports mp3 and wma.  This posting was a HUGE help in letting me try wma; couldn't have figured it out otherwise.  Thanks.

I find that using the encoder command listed in post #6 works best, as well as its parameters, only without the quotes around %s and %d.  If I follow the directions in post #1, I get Error flushing file (Object not found).  Using XP Home SP3, 32 bit.

Hope this helps someone in the future.
Title: How to set up Converter for WMA 9
Post by: shadpoo on 2009-01-17 00:12:51
Possible solution to x64 error found, see Edit2 below.

Hmmm if it is PEBKAC then can anyone see what I am doing wrong here?

console output from foobar
(http://dl.getdropbox.com/u/116047/encoder/foobar.png)

manual execution of same (copy/pasted) command line:
(http://dl.getdropbox.com/u/116047/encoder/manual.png)

vista x64 ultimate

edit:

this is what it says when I use a built in encoder(nero aac)
(http://dl.getdropbox.com/u/116047/encoder/working.png)

edit2:
I have found a solution to my problem, I first tried changing permissions on cscript.exe giving myself full control to no avail. I have now copied cscript.exe into the foobar2000 program directory and the converter is now working properly. I swapped back and forth between the one in system32 and the one in foobar directory and foobar directory always works and system32 never works.
(http://dl.getdropbox.com/u/116047/encoder/fixed.png)

Perhaps this will help someone
Title: How to set up Converter for WMA 9
Post by: nightfly on 2009-03-09 16:50:49
Perhaps this will help someone

indeed, it did! thank you very much. for some very weird reason, on x64 windows' (Vista and XP), foobar2000 cannot execute the WMCmd.vbs as a converter through the default C:\windows\system32\csript.exe. you really have to copy the cscript.exe to somewhere else (foobar2000 install directory works), and it works from there, but only if you set up your converter like this (this is for lossless):

Encoder: C:\Program Files (x86)\foobar2000\cscript.exe
Extension: wma
Parameters: "C:\Program Files\Windows Media Components\Encoder\WMCmd.vbs" //NoLogo -silent -a_codec WMA9LSL -a_mode 2 -a_setting Q100_44_2_16 -input %s -output %d

the thing is, while on x86 systems, you can specify the WMCmd.vbs as 'Encoder', and it will work, on x64 os' you have to specify the copied cscript.exe as 'Encoder', and add the WMCmd.vbs to parameters, like so. if you specify the windows\system32\cscript.exe as Encoder, it still won't work!

i've found this thread through google, i thought it would be nice to share the solution to this very annoying and long-time problem.
Title: How to set up Converter for WMA 9
Post by: musicmusic on 2009-03-09 17:56:50
foobar2000 is a 32-bit application, so what it sees as %windir%\system32\cscript.exe is actually the 32-bit version of cscript.exe in the SysWOW64 folder. I guess you have the 64-bit version of the encoder installed (this isn't something I do, so not sure what exactly Microsoft provides here with regards to encoders).
Title: How to set up Converter for WMA 9
Post by: Aqua1ung on 2009-03-09 19:40:00
for some very weird reason, on x64 windows' (Vista and XP), foobar2000 cannot execute the WMCmd.vbs as a converter through the default C:\windows\system32\csript.exe.

So, should we submit this as a bug to Foobar2000 devs.?
Title: How to set up Converter for WMA 9
Post by: nightfly on 2009-03-10 06:06:54
foobar2000 is a 32-bit application, so what it sees as %windir%\system32\cscript.exe is actually the 32-bit version of cscript.exe in the SysWOW64 folder. I guess you have the 64-bit version of the encoder installed (this isn't something I do, so not sure what exactly Microsoft provides here with regards to encoders).

maybe it is the case, if i specify the WMCmd.vbs as encoder, it executes just "cscript.exe", but if i explicitly specify C:\windows\system32\cscript.exe as encoder, it still throws the flush error. if i copy the same cscript.exe from system32 to e.g. foobar2000 folder, and specify C:\Program Files (x86)\foobar2000\cscript.exe as encoder, it works. i have the 64bit WMEncoder installed.

So, should we submit this as a bug to Foobar2000 devs.?

i'm not sure it's a foobar2000 bug, but it would be nice to hear something official about this issue, because obviously it has been around for years, and caused many headaches for users, but we are yet to hear from the devs about this.
Title: How to set up Converter for WMA 9
Post by: saivert on 2009-03-10 08:13:18
32 bit applications in Windows can execute and pipe data (stdin/stdout) to 64 bit executables as the operating systems handles it. A 32 bit program can not load 64 bit DLLs however or otherwise call directly into 64 bit code.

The reason the c:\windows\system32\cscript.exe doesn't work and manually copying this into foobar2000 works is because Windows is behind the scenes translating all filesystem calls to the system32 into syswow64 for all 32 bit applications. When you manually copy the file you are using a 64 bit explorer windows (most probably) and thus have access to the non-translated system32 directory (aka system64, too bad MS didn't adopt this name instead).

So you have to copy the 64 bit CSCRIPT.EXE to another folder for now.

If you use a 64 bit version of Windows you should know about these things as it saves you a lot of trouble. I've been using 64 bit Windows since 2005.
It's fun to come back to this very same thread that I posted in a couple of years ago. Still people are having issues with setting up the WMA encoder.
Title: How to set up Converter for WMA 9
Post by: nightfly on 2009-03-10 09:02:41
The reason the c:\windows\system32\cscript.exe doesn't work and manually copying this into foobar2000 works is because Windows is behind the scenes translating all filesystem calls to the system32 into syswow64 for all 32 bit applications.


so, if i understand you correctly, the problem is with the 64 bit encoder, no? foobar2000 being 32 bit calls for 32 bit cscript.exe (even if called directly from system32), but the encoder, being 64 bit cannot run with the 32 bit cscript.exe? maybe then the easiest solution would be to use the 32 bit encoder even on 64 bit systems? (even if it's a bottleneck)
Title: How to set up Converter for WMA 9
Post by: Aqua1ung on 2009-03-10 09:16:58
The reason the c:\windows\system32\cscript.exe doesn't work and manually copying this into foobar2000 works is because ... So you have to copy the 64 bit CSCRIPT.EXE to another folder for now.

Alright, so why not get the foobar2000 installer do that for a change?
Title: How to set up Converter for WMA 9
Post by: Krema+Or on 2009-03-10 16:54:58
Perhaps this will help someone

indeed, it did! thank you very much. for some very weird reason, on x64 windows' (Vista and XP), foobar2000 cannot execute the WMCmd.vbs as a converter through the default C:\windows\system32\csript.exe. you really have to copy the cscript.exe to somewhere else (foobar2000 install directory works), and it works from there, but only if you set up your converter like this (this is for lossless):

Encoder: C:\Program Files (x86)\foobar2000\cscript.exe
Extension: wma
Parameters: "C:\Program Files\Windows Media Components\Encoder\WMCmd.vbs" //NoLogo -silent -a_codec WMA9LSL -a_mode 2 -a_setting Q100_44_2_16 -input %s -output %d

the thing is, while on x86 systems, you can specify the WMCmd.vbs as 'Encoder', and it will work, on x64 os' you have to specify the copied cscript.exe as 'Encoder', and add the WMCmd.vbs to parameters, like so. if you specify the windows\system32\cscript.exe as Encoder, it still won't work!

i've found this thread through google, i thought it would be nice to share the solution to this very annoying and long-time problem.


STILL NO GO, THE SAME ERROR. vista x64 sp1
Title: How to set up Converter for WMA 9
Post by: nightfly on 2009-03-11 09:36:01
STILL NO GO, THE SAME ERROR. vista x64 sp1

sure as hell works for me. 

Windows XP x64 SP2
WMEncoder x64
foobar2000 0.9.4.5
cscript.exe from system32 copied to foobar2000 directory
converter set up exactly like i posted (i double checked)
Title: How to set up Converter for WMA 9
Post by: dl! on 2009-03-18 21:06:06
can we convert audio files to wma without create wav temp file?
Title: How to set up Converter for WMA 9
Post by: annulus on 2009-06-23 21:49:32
Perhaps this will help someone


Thanks!  I've been trying to figure this out and this worked great for me on 64bit Server 2008.
Title: How to set up Converter for WMA 9
Post by: HTS on 2009-06-30 02:54:01
Quote
3. Your encoding will be Quality-based VBR. For other WMA codecs/formats see Windows Media Encoder help.

I can't find the command settings for VBRpeak 2 pass, and how do you set the peak bit rate for a file?
Title: How to set up Converter for WMA 9
Post by: Egor on 2009-07-06 10:46:39
Quote
3. Your encoding will be Quality-based VBR. For other WMA codecs/formats see Windows Media Encoder help.

I can't find the command settings for VBRpeak 2 pass, and how do you set the peak bit rate for a file?

Quote
Peak Bit Rate-Based VBR Audio Mode :
        [0] WMA9STD : Windows Media Audio 9.2
        [1] WMA9PRO : Windows Media Audio 10 Professional


[-a_mode] <mode_number>
    Audio encoding to be used.
    0: 1-pass CBR (default).
    1: 2-pass CBR.
    2: Quality-based VBR.
    3: Bit rate-based VBR (two-pass).
    4: Bit rate-based peak VBR (two-pass).
[-a_peakbitrate] <peak bit rate>
    Specifies the peak bit rate in bits per second for peak bit rate-based
    VBR for audio. If not specified, the peak bit rate is 1.5 times the
    audio bit rate.
[-a_peakbuffer] <peak buffer>
    Buffer in msec for audio with peak bit rate-based VBR. If not specified,
    the default of 3000 msec is used.
[/size]
Title: How to set up Converter for WMA 9
Post by: ttalukder on 2009-07-11 16:31:58
Darn, I can't get this to work.

I'm using Win7 x64 Ultimate, whenever I try to convert Flac > wma the convertion process just hangs although the bar is at 100% It use to work perfectly on Vista x64.
Title: How to set up Converter for WMA 9
Post by: Egor on 2009-07-11 18:42:05
Darn, I can't get this to work.

I'm using Win7 x64 Ultimate, whenever I try to convert Flac > wma the convertion process just hangs although the bar is at 100% It use to work perfectly on Vista x64.

Have you tried the saivert's "cscript.exe workaround" (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=47759&view=findpost&p=620295)?
Title: How to set up Converter for WMA 9
Post by: ttalukder on 2009-07-12 15:37:35
Darn, I can't get this to work.

I'm using Win7 x64 Ultimate, whenever I try to convert Flac > wma the convertion process just hangs although the bar is at 100% It use to work perfectly on Vista x64.

Have you tried the saivert's "cscript.exe workaround" (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=47759&view=findpost&p=620295)?



I've tried that also, still have the same problem. I've tried the cscript.exe from the system32 folder and also the cscript.exe from sysWOW64. Still no luck, very annoying, as foobar has so far been the best music app for me.
Title: How to set up Converter for WMA 9
Post by: Steve Forte Rio on 2010-08-15 10:05:09
What does -a_mode parameter mean?

And can I encode to WMA 10 Pro using some script like this?
Title: How to set up Converter for WMA 9
Post by: lvqcl on 2010-08-15 10:32:45
By the way, the guide is a bit obsolete...

IIRC, foobar2000 does write WAVE_FORMAT_EXTENSIBLE, and it is possible to use foobar2000 + WME(32/64) in 64-bit OSes.

@Steve Forte Rio: about -a_mode: look at post #42.
Title: How to set up Converter for WMA 9
Post by: Steve Forte Rio on 2010-08-15 10:58:39
Quote
[1] WMA9PRO : Windows Media Audio 10 Professional


So is it WMA10 in fact? Very well if it is

And how can I specify 384 kbps for
Quote
3: Bit rate-based VBR (two-pass).
??

I did it!

Code: [Select]
-silent -a_codec WMA9PRO -a_mode 3 -a_setting 384_44_2_24 -input %s -output %d
Title: How to set up Converter for WMA 9
Post by: Steve Forte Rio on 2010-08-15 11:12:12
Hm.. but I can't get bit identical results to dbPower's. What mode does it use for 384 kbps wma pro 10 2pass?
Title: How to set up Converter for WMA 9
Post by: Steve Forte Rio on 2010-08-16 19:36:12
Quote
I can't get bit identical results to dbPower's


does anyone know why it happens?((

dbpower with q-based vbr 384 2pass gives 381 kbps, and WMCmd.vbs with -silent -a_codec WMA9PRO -a_mode 3 -a_setting 384_44_2_24 -input %s -output %d gives 382kbps
Title: How to set up Converter for WMA 9
Post by: Steve Forte Rio on 2010-11-09 22:49:15
WM Encoder 9 Fix for Windows 7 and Vista:
http://download.microsoft.com/download/0/3...929182-intl.exe (http://download.microsoft.com/download/0/3/d/03d35c05-67da-40e0-9e45-3ea0ca6329a4/windowsmedia9-kb929182-intl.exe)

It really works...
Title: How to set up Converter for WMA 9
Post by: Merlin_de on 2011-01-05 14:56:22
WM Encoder 9 Fix for Windows 7 and Vista:
http://download.microsoft.com/download/0/3...929182-intl.exe (http://download.microsoft.com/download/0/3/d/03d35c05-67da-40e0-9e45-3ea0ca6329a4/windowsmedia9-kb929182-intl.exe)

It really works...


hello,
this fix is nonsense.
since win7 MS use a new WMA interface. WM9Encoder.exe / WM9Encoder64.exe cant be install and never works.

i made a small console app that convert to wma.

see this topic
http://www.hydrogenaudio.org/forums/index....st&p=738082 (http://www.hydrogenaudio.org/forums/index.php?showtopic=85654&view=findpost&p=738082)
Title: How to set up Converter for WMA 9
Post by: lvqcl on 2011-01-05 16:21:23
hello,
this fix is nonsense.
since win7 MS use a new WMA interface. WM9Encoder.exe / WM9Encoder64.exe cant be install and never works.

THIS is nonsense. At least WMEncoder64.exe works flawlessly on my Windows7 64-bit.
Title: How to set up Converter for WMA 9
Post by: Merlin_de on 2011-01-05 19:42:01
hello,
this fix is nonsense.
since win7 MS use a new WMA interface. WM9Encoder.exe / WM9Encoder64.exe cant be install and never works.

THIS is nonsense. At least WMEncoder64.exe works flawlessly on my Windows7 64-bit.



lol, i dont know what you have, but not a official real win7 version. maybe you have a update version or whatever.

lock at this official MS side
Windows 7 Compatibility Center (http://www.microsoft.com/windows/compatibility/windows-7/en-us/Details.aspx?type=Software&p=Windows%20Media%20Encoder&v=Microsoft&uid=9&l=en&pf=0&pi=1&s=WMA%20Encoder&os=32-bit)

WM9Encoder.exe / WM9Encoder64.exe  ar not compatibel with win7 !!!!

you can also search inside MSDN for the new IMF Interface calld "Media Foundation".
What's New in the Windows SDK  7
(http://msdn.microsoft.com/de-de/library/ms717428(v=VS.85).aspx)
- Windows Media DRM Client Extended APIs
- Windows Media Player 11 SDK
- Media Foundation
Microsoft Media Foundation is the next generation multimedia platform and infrastructure for Microsoft Windows. The first release of Media Foundation in Microsoft Windows Vista focuses on content protection, audio and video quality, and interoperability for digital rights management (DRM).
Title: How to set up Converter for WMA 9
Post by: Apesbrain on 2011-01-22 16:40:54
I just wanted to confirm that Windows Media Encoder does indeed work within foobar2000 v.1.1.2 on Win 7 x64 (and I presume x86):

Converter Setup for WMA -profile a128
Encoder > Custom
Encoder: C:\Windows\sysnative\cscript.exe [if x86 it would be C:\Windows\system32\cscript.exe (I think)]
Extension: wma
Parameters: "C:\Program Files\Windows Media Components\Encoder\WMCmd.vbs" //NoLogo -silent -input %s -output %d -profile a128 [if x86 it would be "C:\Program Files (x86)\Windows Media Components\..." (again, I think)]

I just used it and it worked fine; tags and all.  In the past I've converted to WMA9STD, WMA9PRO and WMA9LSL so I believe it supports any/all WMA formats and switches.

The issue for anyone trying to set this up now is finding the WME installer as Microsoft is now pushing its newer Expression Encoder which does not appear to have a commandline interface.

P.S. I googled and "WMEncoder64" is still out there; just not on Microsoft USA.
Title: How to set up Converter for WMA 9
Post by: Ratzez on 2011-01-22 18:38:53
I'm running Win7 x64, and I tried the following:

1. Downloaded and installed WMEncoder64 from here. (http://download.microsoft.com/download/0/5/1/05150d9b-59dd-453c-8483-d618cec12b12/WMEncoder64.exe)

2. Setup foobar2000 v.1.1.2 like so:
   
    Encoder > Custom
    Encoder: C:\Windows\SysWOW64\cscript.exe
    Extension: wma
    Parameters: "C:\Program Files\Windows Media Components\Encoder\WMCmd.vbs" //NoLogo -silent -input %s -output %d -profile a128

3. Tried converting a FLAC file but I kept getting this error. (http://img502.imageshack.us/i/clipboard01qr.png/)

Am I doing anything wrong? What else could I try?
Title: How to set up Converter for WMA 9
Post by: lvqcl on 2011-01-22 19:08:05
Replace SysWOW64 with sysnative:

C:\Windows\sysnative\cscript.exe (see Apesbrain's post just above yours).
Title: How to set up Converter for WMA 9
Post by: Ratzez on 2011-01-22 21:20:35
That did it!

I also got it to work with
"C:\Program Files\Windows Media Components\Encoder\WMCmd.vbs" //NoLogo -silent -input %s -output %d -a_codec WMA9STD -a_mode 3 -a_setting 128_44_2
to make a 2-pass VBR file.
Title: How to set up Converter for WMA 9
Post by: mudlord on 2011-01-22 23:38:10
hello,
this fix is nonsense.
since win7 MS use a new WMA interface. WM9Encoder.exe / WM9Encoder64.exe cant be install and never works.

THIS is nonsense. At least WMEncoder64.exe works flawlessly on my Windows7 64-bit.



lol, i dont know what you have, but not a official real win7 version. maybe you have a update version or whatever.

lock at this official MS side
Windows 7 Compatibility Center (http://www.microsoft.com/windows/compatibility/windows-7/en-us/Details.aspx?type=Software&p=Windows%20Media%20Encoder&v=Microsoft&uid=9&l=en&pf=0&pi=1&s=WMA%20Encoder&os=32-bit)

WM9Encoder.exe / WM9Encoder64.exe  ar not compatibel with win7 !!!!

you can also search inside MSDN for the new IMF Interface calld "Media Foundation".
What's New in the Windows SDK  7
(http://msdn.microsoft.com/de-de/library/ms717428(v=VS.85).aspx)
- Windows Media DRM Client Extended APIs
- Windows Media Player 11 SDK
- Media Foundation
Microsoft Media Foundation is the next generation multimedia platform and infrastructure for Microsoft Windows. The first release of Media Foundation in Microsoft Windows Vista focuses on content protection, audio and video quality, and interoperability for digital rights management (DRM).


You are wrong.

The Windows Media encoder framework, version 9, works fine on Win7. After all, the APIs still exist, so you can leverage those.....
Title: How to set up Converter for WMA 9
Post by: Merlin_de on 2011-01-31 11:58:04
You are wrong.

The Windows Media encoder framework, version 9, works fine on Win7. After all, the APIs still exist, so you can leverage those.....


hmm do you have install windows media player 12 on win7 ?
if true 32bit wmp and or 64bit wmp ?
if false plese try to install wmp12 and test it again please

WMEncoder64.exe include WMEncoder64.msi from 19.10.2006 (over 4 jears old)
my win 7 x64 with wmp12 block the installation !!!

all official article from microsoft say that since win7 MS change from wmencoder to Microsoft Media Foundation !!
wmp 12 and windows media center (as part of win7) based on Microsoft Media Foundation  !!

read the msdn please
eg http://msdn.microsoft.com/en-us/library/dd...8(v=VS.85).aspx (http://msdn.microsoft.com/en-us/library/dd757928(v=VS.85).aspx)
Shows how to reencode a media file to Windows Media format. using the new IMF... API (Iinterface Media Foundation) and not the old IWM APIS
Title: How to set up Converter for WMA 9
Post by: richship on 2012-11-29 22:54:21
This thread has been pretty helpful in getting things set up, but I'm having issues in practice.

The converter is set up with:

Encoder file: cscript.exe
Extension: wma
Parameters: "C:\Program Files\Windows Media Components\Encoder\WMCmd.vbs" //NoLogo -silent -input %s -output %d -profile a128

When I run the convert operation through foobar2000, it creates a temp .wav file in the destination directory, then a .wma file is created, but it never finishes. It just says "Converting - 1/1 ..." and the time elapsed keeps going up. The .wma file that is created is damaged somehow and won't play in foobar2000. It plays in Media Player, but it doesn't track time correctly. I've tried variations to create other types of .wma files with the same results.

If I run the converter myself from the command line, the wma encoder takes the .wav file and creates a valid .wma that plays fine (but of course has no tags). The file is a little larger than when running through foobar2000.

It seems like foobar2000 is trying to do something that it never finishes, but ends up damaging the converted file. Is this something that anyone else has seen? Is there a debug mode where I can see what it might be hanging on?
Title: How to set up Converter for WMA 9
Post by: marc2003 on 2012-11-30 09:19:24
try this??

http://www.hydrogenaudio.org/forums/index....showtopic=90519 (http://www.hydrogenaudio.org/forums/index.php?showtopic=90519)
Title: How to set up Converter for WMA 9
Post by: richship on 2012-11-30 14:20:45
try this??

http://www.hydrogenaudio.org/forums/index....showtopic=90519 (http://www.hydrogenaudio.org/forums/index.php?showtopic=90519)


I have a converter that works. It seems that foobar2000 that can't deal with the the WMA file afterwards. Is anyone else able to convert to WMA with the latest version?
Title: How to set up Converter for WMA 9
Post by: lvqcl on 2012-11-30 14:42:18
I'm not sure that foobar2000 really hangs. That how it works when conversion requires a temp wav file:

1) foobar2000 converts an input file to a temporary WAV. The progress bar reaches 100% when this task is done.
2) foobar2000 calls an external encoder amd waits for its return. The progress bar is at 100% all this time, but the conversion doesn't hang.
3) The encoder returns and foobar2000 writes tags to the output file. The job is done.
Title: How to set up Converter for WMA 9
Post by: richship on 2012-11-30 15:00:25
try this??

http://www.hydrogenaudio.org/forums/index....showtopic=90519 (http://www.hydrogenaudio.org/forums/index.php?showtopic=90519)


After digging around for something that could extract from RAR files, I tried this and it worked. No idea why it didn't work the other way.

Thanks very much for the suggestion!
Title: How to set up Converter for WMA 9
Post by: richship on 2012-11-30 15:07:57
I'm not sure that foobar2000 really hangs. That how it works when conversion requires a temp wav file:

1) foobar2000 converts an input file to a temporary WAV. The progress bar reaches 100% when this task is done.
2) foobar2000 calls an external encoder amd waits for its return. The progress bar is at 100% all this time, but the conversion doesn't hang.
3) The encoder returns and foobar2000 writes tags to the output file. The job is done.


Possibly the converter was not returning for some reason. Not sure why since it worked fine from the command line. That could also explain why the wma file was incomplete.

In any case, WMAEncode64.exe from lvqcl works great.
Title: How to set up Converter for WMA 9
Post by: N8N on 2013-07-30 19:50:37
Replace SysWOW64 with sysnative:

C:\Windows\sysnative\cscript.exe (see Apesbrain's post just above yours).


Wow this is an old thread but I am fighting this myself... set everything up with the instructions in the first post and am getting errors.  Yes, Win7 64-bit.

I don't have a "sysnative" folder... any ideas?

I really need to find a way to convert all my FLAC files to WMA lossless as the latter is the only lossless codec that my car will recognize.

thanks for any help!

Edit:

I have tried it three ways, first exactly per the first post

second

Encoder: C:\Windows\SysWOW64\cscript.exe
Parameters: "C:\Program Files\Windows Media Components\Encoder\WMCmd.vbs" //NoLogo -silent -a_codec WMA9LSL -a_mode 2 -a_setting Q100_44_2_16 -input %s -output %d


third

Encoder: C:\Windows\System32\cscript.exe
Parameters: "C:\Program Files\Windows Media Components\Encoder\WMCmd.vbs" //NoLogo -silent -a_codec WMA9LSL -a_mode 2 -a_setting Q100_44_2_16 -input %s -output %d

unfortunately those seem to be the two places I can find cscript.exe - everywhere else that I find it on my hard drive it appears to be a copy of one or the other of those.

every time I end up with the same error

1 out of 1 tracks converted with major problems.
Quote
Source: "C:\Users\Studio\Music\Beethoven, Ludwig van\Beethoven - Symphonien Nos. 7 & 8\08 Symphonie Nr. 8 F-dur op. 93- 4. Allegro vivace.flac"
  An error occurred while finalizing the encoding process (Object not found) : "C:\Users\Studio\Music\Beethoven, Ludwig van\WMA Test\Symphonie Nr. 8 F-dur op. 93- 4. Allegro vivace.wma"
  Conversion failed: Object not found


there are no .wav files in the destination folder.

Any ideas greatly appreciated.  I am hating microsoft so much.  And BMW, for not supporting FLAC.
Title: How to set up Converter for WMA 9
Post by: eahm on 2013-07-30 19:53:41
N8N, http://www.hydrogenaudio.org/forums/index....showtopic=90519 (http://www.hydrogenaudio.org/forums/index.php?showtopic=90519)
Title: How to set up Converter for WMA 9
Post by: N8N on 2013-07-30 20:16:49
N8N, http://www.hydrogenaudio.org/forums/index....showtopic=90519 (http://www.hydrogenaudio.org/forums/index.php?showtopic=90519)


um... looks like someone actually created something nice, but I haven't a clue how to use it...  no documentation?
Title: How to set up Converter for WMA 9
Post by: lvqcl on 2013-07-30 20:19:34
I don't have a "sysnative" folder... any ideas?

Doesn't matter. C:\Windows\Sysnative\cscript.exe should work.

And there's also simpler & faster command-line encoder (eahm posted the link to it).

um... looks like someone actually created something nice, but I haven't a clue how to use it...  no documentation?

fb2k Parameters: --silent --codec lossless - %d
Title: How to set up Converter for WMA 9
Post by: N8N on 2013-07-30 20:25:42
I don't have a "sysnative" folder... any ideas?


Doesn't matter. C:\Windows\Sysnative\cscript.exe should work.

And there's also simpler & faster command-line encoder (eahm posted the link to it).


Just tried it... it apparently works, in that it is running the script

but I still get the same error

Also tried copying cscript.exe to foobar folder - still get the same error.

is there anywhere I can see what the various parameters are for the command line thing?  I think that is going to be my only option, but I don't have a clue how to use it, nor did the thread really help because I'm kind of a computer idiot.

or would the switches be the same as for using WMCmd?

Edit; I just copied the files from that link into my foobar2000 directory and tried the following settings (what could possibly go wrong?)

Encoder File: C:\Program Files (x86)\foobar2000\WMAEncode64.exe (and I also tried WMAEncode.exe)
Parameters: -silent -a_codec WMA9LSL -a_mode 2 -a_setting Q100_44_2_16 -input %s -output %d

I'm getting the exact same error message!  I'm going to have to walk away from this for a while otherwise a nice new laptop is going out the front window.

Title: How to set up Converter for WMA 9
Post by: Apesbrain on 2013-07-31 00:45:24
I haven't used WMA in quite some time, but just tried my old settings on foobar2000 v.1.2.9 converter on Win 7 x64 and they still work.  Have you followed the instructions in this thread (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=47759&view=findpost&p=740444), posts 56-58, to the letter?  You need to first download and install (double-click on the downloaded file) Windows Media Encoder from the link provided, then configure foobar2000 converter as follows:

Encoder file: C:\Windows\sysnative\cscript.exe => It doesn't matter if you can't see this folder
Extension: wma
Parameters: "C:\Program Files\Windows Media Components\Encoder\WMCmd.vbs" //NoLogo -silent -input %s -output %d -a_codec WMA9LSL -a_mode 2 -a_setting Q100_44_2_16
Format is: lossless (or hybrid)
Highest BPS mode supported: 24
Encoder name: WMA Lossless

Note that foobar2000 will appear to stall at the end of each file being converted.  It is actually standing by while WME does its thing in the background; this may take 30 sec.

After you install WME you will find a Windows Start Menu link to "Windows Media Encoding Script" help file.  Launch this and you can learn all about WME command line settings.
Title: How to set up Converter for WMA 9
Post by: N8N on 2013-07-31 14:21:52
yes, that's exactly what I did/am doing.  just tried it again

Quote
1 out of 1 tracks converted with major problems.

Source: "C:\Users\Studio\Music\Beethoven, Ludwig van\Beethoven - Symphonien Nos. 7 & 8\08 Symphonie Nr. 8 F-dur op. 93- 4. Allegro vivace.flac"
  An error occurred while finalizing the encoding process (Object not found) : "C:\Users\Studio\Music\Beethoven, Ludwig van\WMA Test\Symphonie Nr. 8 F-dur op. 93- 4. Allegro vivace.wma"
  Conversion failed: Object not found


Encoder file: C:\Windows\sysnative\cscript.exe
Extension: WMA
Parameters: "C:\Program Files (x86)\Windows Media Components\Encoder\WMCmd.vbs" //NoLogo -silent -input %s -output %d -a_codec WMA9LSL -a_mode 2 -a_setting Q100_44_2_16

(I copied your parameters above but my Windows Media Components folder is in (x86) for some reason)

Format: Lossless (or hybrid)
Highest BPS mode supported: 24 (I had this at 16 before, but it doesn't seem to make a difference)

I also don't appear to have any kind of help file although the encoder definitely is installed.

Edit: I just tried converting to .mp3 just to make sure it wasn't a foobar problem, that apparently works well both the default settings and also when changing to 320kbps.
Title: How to set up Converter for WMA 9
Post by: lvqcl on 2013-07-31 15:00:57
Encoder File: C:\Program Files (x86)\foobar2000\WMAEncode64.exe (and I also tried WMAEncode.exe)
Parameters: -silent -a_codec WMA9LSL -a_mode 2 -a_setting Q100_44_2_16 -input %s -output %d

I'm getting the exact same error message!  I'm going to have to walk away from this for a while otherwise a nice new laptop is going out the front window.

I updated my previous post just when you wrote yours. As I wrote, fb2k Parameters: --silent --codec lossless - %d.


Encoder file: C:\Windows\sysnative\cscript.exe
Extension: WMA
Parameters: "C:\Program Files (x86)\Windows Media Components\Encoder\WMCmd.vbs" //NoLogo -silent -input %s -output %d -a_codec WMA9LSL -a_mode 2 -a_setting Q100_44_2_16

You should use 64-bit exe (C:\Windows\Sysnative\cscript.exe) when you use 64-bit WMCmd (C:\Program Files\Windows Media Components\Encoder\WMCmd.vbs). And use 32-bit exe (C:\Windows\System32\cscript.exe or C:\Windows\SysWOW64\cscript.exe) when you use 32-bit WMCmd (C:\Program Files (x86)\Windows Media Components\Encoder\WMCmd.vbs).

Besides, what's the format of your input file (samplerate, bit depth, number of channels)?
Title: How to set up Converter for WMA 9
Post by: N8N on 2013-07-31 15:55:56
Encoder File: C:\Program Files (x86)\foobar2000\WMAEncode64.exe (and I also tried WMAEncode.exe)
Parameters: -silent -a_codec WMA9LSL -a_mode 2 -a_setting Q100_44_2_16 -input %s -output %d

I'm getting the exact same error message!  I'm going to have to walk away from this for a while otherwise a nice new laptop is going out the front window.

I updated my previous post just when you wrote yours. As I wrote, fb2k Parameters: --silent --codec lossless - %d.


Encoder file: C:\Windows\sysnative\cscript.exe
Extension: WMA
Parameters: "C:\Program Files (x86)\Windows Media Components\Encoder\WMCmd.vbs" //NoLogo -silent -input %s -output %d -a_codec WMA9LSL -a_mode 2 -a_setting Q100_44_2_16

You should use 64-bit exe (C:\Windows\Sysnative\cscript.exe) when you use 64-bit WMCmd (C:\Program Files\Windows Media Components\Encoder\WMCmd.vbs). And use 32-bit exe (C:\Windows\System32\cscript.exe or C:\Windows\SysWOW64\cscript.exe) when you use 32-bit WMCmd (C:\Program Files (x86)\Windows Media Components\Encoder\WMCmd.vbs).

Besides, what's the format of your input file (samplerate, bit depth, number of channels)?


I'm getting ready to run out so I will have to try messing with this later, but to answer your last question, my files are mostly ripped CDs (and those are the ones I'm using as proof of concept) so they're 44.1, stereo, 16 bit.
Title: How to set up Converter for WMA 9
Post by: N8N on 2013-07-31 21:52:24
different problem now...

Quote
1 out of 1 tracks converted with major problems.

Source: "C:\Users\Studio\Music\Beethoven, Ludwig van\Beethoven - Symphonien Nos. 7 & 8\08 Symphonie Nr. 8 F-dur op. 93- 4. Allegro vivace.flac"
  An error occurred while writing to file (The encoder has terminated prematurely with code 0 (0x00000000); please re-check parameters) : "C:\Users\Studio\Music\Beethoven, Ludwig van\WMA Test\08 Symphonie Nr. 8 F-dur op. 93- 4. Allegro vivace.wma"
  Additional information:
  Encoder stream format: 44100Hz / 2ch / 16bps
  Command line: "C:\Windows\System32\cscript.exe" "C:\Program Files (x86)\Windows Media Components\Encoder\WMCmd.vbs" //NoLogo --silent --codec lossless - "08 Symphonie Nr. 8 F-dur op. 93- 4. Allegro vivace.wma"
  Working folder: C:\Users\Studio\Music\Beethoven, Ludwig van\WMA Test\
 
  Conversion failed: The encoder has terminated prematurely with code 0 (0x00000000); please re-check parameters


My parameters:

C:\Windows\System32\cscript.exe
"C:\Program Files (x86)\Windows Media Components\Encoder\WMCmd.vbs" //NoLogo --silent --codec lossless - %d

I found this thread

http://forum.doom9.org/showthread.php?t=123812 (http://forum.doom9.org/showthread.php?t=123812)

looking for hte "cheat sheet"

tried firing up a terminaland changing directory to C:\Program Files (x86)\Windows Media Components\Encoder

then wmcmd.vbs -a_codecs

to see what the correct options were

I got this error in a window marked "Windows Script Host"

Script: C:\Program Files x(86)\Windows Media Components\Encoder\WMCmd.vbs
Line: 18
Char: 2
Error: Variable is undefined: 'WshShell'
Code: 800A01F4
Source: Microsoft VBScript runtime error

I'm about lost now...
Title: How to set up Converter for WMA 9
Post by: mehemed on 2015-01-11 01:15:27
If anyone interested in lossless WMA with more uptodate Expression encoder with foobar2000 on win7 64bit, then I've added comments to Jon Knepp's script (https://kneppscript.wordpress.com/2011/03/25/encoding-wma-files-using-powershell-and-microsoft-expression-encoder/) on setting it up...

You just need Expression encoder and PowerShell 4 installed. Tagging also works.

foobar_WMACompress.ps1
Code: [Select]
<#

EAC_WMACompress.ps1
Purpose:
 Used to convert/compress individual media files using Microsoft Expression Encoder.

Requirements:
 -  Microsoft Expression Encoder
 (http://www.microsoft.com/downloads/en/details.aspx?FamilyID=5c3c5f97-678c-4c99-a7fc-f84f320c626f)
 -  Expression Encoder requires .NET 4.0 assemblies therefore PowerShell must be
 configured to support the .NET 4.0 CLR (http://msdn.microsoft.com/en-us/library/w4atty68.aspx)
 The following content will need to be saved as 'powershell.exe.config' in the appropriate
 powershell home directory a.k.a. $psHome (e.g. C:\WINDOWS\system32\windowspowershell\v1.0 or
 C:\WINDOWS\syswow64\windowspowershell\v1.0 on 64-bit systems):
 <?xml version="1.0" encoding="utf-8" ?>
 <configuration>
 <!-- [url=http://msdn.microsoft.com/en-us/library/w4atty68.aspx]http://msdn.microsoft.com/en-us/library/w4atty68.aspx[/url] -->
 <startup useLegacyV2RuntimeActivationPolicy="true">
 <supportedRuntime version="v4.0.30319" />
 <supportedRuntime version="v3.5" />
 <supportedRuntime version="v3.0" />
 <supportedRuntime version="v2.0.50727" />
 </startup>
 </configuration>
 -  The Microsoft Expression Encoder libraries are 32-bit only, therefore this script
 will only work under a PowerShell (x86) session when run on a 64-bit system

Created 3/24/2011
By Jon Knepp

New instructions for foobar2000 (on Windows 7 64bit):
 - Install Microsoft Expression Encoder (http://www.microsoft.com/expression/eng/)
 - Install PowerShell (http://microsoft.com/powershell)
 - Replace %USERPROFILE% with direct paths in this script
 - Copy script and wmalpreset.xml into %USERPROFILE%\AppData\Roaming\foobar2000\
 - Create encoder preset in foobar2000:
  Encoder file: C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe
  Extension: wma
  Parameters: -executionpolicy remotesigned -noninteractive -noprofile -file "%USERPROFILE%\AppData\Roaming\foobar2000\foobar_WMACompress.ps1" %s %d
  Format is: lossless (or hybrid)
  Highest BPS mode supported: 24
  Encoder name: WMA Lossless

Added 1/11/2015
mehemed

#>

param ( [string]$Source,
 [string]$Destination,
 [string]$Comment,
 [string]$Artist = $($AlbumArtist),
 [string]$Title,
 [string]$AlbumArtist = $($Artist),
 [string]$Album,
 [string]$Year,
 [int]$Track,
 [string]$Genre,
 [string]$Preset = $("WMA Lossless 5.1 Audio")
 )

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Expression.Encoder") | Out-Null
$job = New-Object Microsoft.Expression.Encoder.Job

#$systemPresets = [Microsoft.Expression.Encoder.Preset]::SystemPresets
#$jobPreset = $systemPresets | ? { $_.Name -match $Preset }
$encoderPreset = [Microsoft.Expression.Encoder.Preset]::FromFile("%USERPROFILE%\AppData\Roaming\foobar2000\wmalpreset.xml")

if (Test-Path -Path $Source) { $srcFile = Get-ChildItem $Source }
else { throw "Source file ($Source) could not be found." }

if ($Destination) {
 $outFile = Split-Path -Leaf $Destination
 $outputDir = Split-Path -Parent $Destination
}
if (!$outputDir) { $outputDir = $PWD.Path }

try {
 # Define Encoder MediaItem
 $mediaItem = New-Object Microsoft.Expression.Encoder.MediaItem($srcFile)
 # Assign tag metadata to the new MediaItem
 if ($Destination) {    $mediaItem.OutputFileName = $outFile }
 if ($Title) { $mediaItem.Metadata["Title"] = $Title }
 if ($Artist) { $mediaItem.Metadata["Artist"] = $Artist }
 if ($Track) { $mediaItem.Metadata["Track"] = $Track }
 if ($AlbumArtist) { $mediaItem.Metadata["Album Artist"] = $AlbumArtist }
 if ($Album) { $mediaItem.Metadata["Album"] = $Album }
 if ($Year) { $mediaItem.Metadata["Year"] = $Year }
 if ($Genre) { $mediaItem.Metadata["Genre"] = $Genre }
 if ($Comment) { $mediaItem.Metadata["Comment"] = $Comment }

 # Complete job setup
 $job.MediaItems.Add($mediaItem)
 $job.CreateSubfolder = $false
 $job.OutputDirectory = $outputDir
 $job.ApplyPreset($encoderPreset)

 # Define EventHanlder ScriptBlock for EncoderProgress Event
 $onProgress_EventHandler = [ScriptBlock]{
 param ( [PSObject]$Sender,
 [Microsoft.Expression.Encoder.EncodeProgressEventArgs]$e
 )

 $activity = "Encoding '{0}' by {1} as {2}" -f $Title, $Artist, $encoderPreset.Name
 $status = "Encoding '{0}' {1}% Pass {2} of {3}" -f `
 $e.CurrentItem.ActualOutputFileName, `
 [int]$e.Progress, `
 $e.CurrentPass, `
 $e.TotalPasses
 Write-Progress -Activity $activity -Status $status -PercentComplete ([int]($e.Progress))
 }
 # Register onProgress Event Handler with Encoder Job object
 $job.add_EncodeProgress($onProgress_EventHandler)

 # Start Encoding Job
 $job.Encode()
}
catch {
 # Generate log file if error occurs
 $errLog = "{0}\{1}.log" -f $outputDir, $outFile
 "Command Line: {0}" -f $MyInvocation.Line | Out-File $errLog -Append
 $_ | Out-File $errLog -Append
 throw $_
}
finally {
 $job.Dispose()
}


wmalpreset.xml
Code: [Select]
<?xml version="1.0" encoding="utf-8"?>
<!--Created with Expression Encoder version 4.0.4276.0-->
<Preset
  Version="4.0">
  <Job />
  <MediaFile>
    <OutputFormat>
      <WindowsMediaOutputFormat>
        <AudioProfile>
          <WmaAudioProfile
            Codec="WmaLossless"
            Channels="2"
            BitsPerSample="16"
            SamplesPerSecond="44100">
            <Bitrate>
              <VariableQualityBitrate
                Quality="100" />
            </Bitrate>
          </WmaAudioProfile>
        </AudioProfile>
      </WindowsMediaOutputFormat>
    </OutputFormat>
  </MediaFile>
</Preset>
Title: How to set up Converter for WMA 9
Post by: serzh doom on 2015-09-28 14:56:07
What is //NoLogo option for? Is it necessary to add? I do without this option and can't see the difference
please explain
Title: How to set up Converter for WMA 9
Post by: Chlysm on 2015-11-24 19:24:40
I know this is an old thread but I managed to get this working in Windows 10 and I thought I'd share the info.

I was looking for a way to play lossless audio in my car with a USB stick and Ford Sync and as it turn out the only lossless codec supported by Ford Sync is WMA Lossess which is rather obscure and not too many people are even aware of it's existence. Because of this, finding the codec in standalone form to use in Foobar was not easy and finding instructions regarding it's use was almost as difficult to find.

Through some digging and stuff I managed to find WMA9 Encoder released by Microsoft despite it no longer being hosted on their site and I've mirrored it twice because this will only become more difficult to find in the future.



WMA 9 Encoder Mediafire Link (http://www.mediafire.com/download/6kqr382y16255yb/WMA-9_Lossless_Codec.7z)

WMA 9 Encoder Google Drive Link (https://drive.google.com/file/d/0B4j6HkqYpGM3a2d0c21hTGdSQnc/view?usp=sharing)


The original installer was unpacked to the files you see in the 7z folder because it wouldn't install on Windows 10 in it's original state. This download also includes the needed hotfix to make this work in Windows Vista x64 which also seems to work in Windows 10. Instructions are also included which link to this thread.

Here is what you need to do in Windows 10 x64 and most likely in Vista/7/8.1 to make this work in foobar.

Unpack 7z file
Navigate to the WME encoder 9 Directory and install WMEncoder.msi as administrator (right click)
Then go up one level and install the WindowsMedia 9 Hotfix.exe as administrator.

Then go into foobar and follow these instructions in the OP.

https://www.hydrogenaud.io/forums/index.php?showtopic=47759 (https://www.hydrogenaud.io/forums/index.php?showtopic=47759)


After that, you should be good to go
Title: Re: How to set up Converter for WMA 9
Post by: fyrstormer on 2018-09-18 05:34:59
I appreciate the OP's effort in writing the tutorial on the first page.

I store my music library in FLAC if I own the original disc the files came from, and MP3 if I don't. (what can I say? When I was in college, Napster was still a thing.) I also have a couple "vintage" (that word makes me cringe a little) Sony Hi-MD players, and I've been struggling for a while to find a way to import my music into Sony SonicStage to copy to my Hi-MD players without losing all the metadata.

SonicStage will read MP3 metadata correctly, and Hi-MD players have native support for MP3 as well, so that's the easy solution, but MP3 is a lossy format, and who likes easy solutions anyway? ;)
SonicStage will read WAV files, and they can either be transcoded to ATRAC3+ or copied bit-for-bit into raw PCM streams on Hi-MD discs, but SonicStage ignores the metadata, so I have to re-enter it manually for each track.
SonicStage can't read FLAC files at all, because it's an old program.

However, I recently (i.e. yesterday) discovered that WMA Lossless exists, and SonicStage can read WMA files and their metadata. So now, when I want to copy an album to a Hi-MD disc for the first time, I can convert the FLAC files into WMA Lossless and import them into SonicStage as an intermediate step. (I only plan to do it on a per-album basis as I decide to copy albums to Hi-MD discs, though, because otherwise I'd have duplicate lossless copies of all my music in two different formats for no reason.)

The files still get transcoded to the lossy ATRAC3+ format when I copy them to a Hi-MD disc, but ATRAC3+ is superior to MP3 at the same bitrate; with ATRAC3+, at 192kb/s I can no longer hear any artifacting, but with MP3 I have to go as high as 256kb/s to get the same result. So it's worth the trouble to transcode to ATRAC3+ so I can fit more music on each disc, for those times when I want to pretend to be some weird kind of Japanese-tech hipster -- and now I can do it without having to re-enter metadata by hand anymore!

Plus I get the satisfaction of knowing I figured out how to do it MY way instead of the easy way. :)

- - -

I miss Winamp. I still use it, and it still runs on Windows 10, but I'm finally making the leap to Foobar because Foobar has ongoing support. The best time to transition away from an abandoned software product is when you still have time to figure out how to make the transition. Winamp made the conversion to WMA Lossless a point-and-click affair, no configuration necessary, but I needed help getting Foobar to do it. This thread gave me that help.

Ironically, I'm running both SonicStage and Foobar inside a Windows XP virtual machine, so hypothetically I could rely on that Windows XP virtual machine to continue running Winamp forever as well, but this way I'm using the same music manager on all 5 of my active Windows machines.

You know what would be cool? A Winamp user interface with a Foobar back-end, so I don't have to learn anything new. ;)