Here is command-line WMA encoder. Inspired by this thread (http://www.hydrogenaudio.org/forums/index.php?showtopic=85654).
Requirements: Windows XP or later, Window Media Codecs installed.
Usage examples:
WmaEncode --codec lossless in.wav out.wma
WmaEncode -c lsl in.wav out.wma
WmaEncode --codec pro --quality 90 in.wav out.wma
WmaEncode -c pro -q 90 in.wav out.wma
WmaEncode --mode vbr2pass --bitrate 128 in.wav out.wma
WmaEncode -m vbr2pass -b 128 in.wav out.wma
...etc.
Sources included. Don't expect them to be well-commented though.
---------
changelog:
0.2.9c: another minor fix in WAV parsing.
0.2.9b: minor fixes in WAV parsing. Sources are attached as a separate file.
0.2.9a: new switches -c, -m, -i, -s (short versions of --codec, --mode, --ignorelength, --silent)
0.2.9: maintenance update
0.2.8: allows 2-pass mode for stdin by default
0.2.7: progress indicator added
0.2.6: raw PCM input added
Any source?
The sources will be uploaded later. Want to add comments, etc.
Maybe someone will find bugs in the program meanwhile...
thanks a lot...
_
Cool, just was wondering since it would be nice to make a WMAdrop
Version 0.2.5 was uploaded. Several bugs were fixed, probably new added.
Sources included.
thanks a lot...
_
please, could you enable (add) wma/wmv input support? this is very handy for quick wma/wmv multichannel transcoding to wma stereo!
_
you don't have to do something special...WMEncoder has support for .wav and .wmv/.wma input (and pcm in .avi too)...all you have to do is to allow it...
you don't have to do something special...WMEncoder has support for .wav and .wmv/.wma input (and pcm in .avi too)...all you have to do is to allow it...
Where and what should be allowed?
with WMEncoder installed on WinXP i can do this:
cmd /c cscript.exe "C:\Program Files\Windows Media Components\Encoder\wmcmd.vbs" -input audio6.wma -output audio2.wma -audioonly -a_codec WMA9PRO -a_mode 0 -a_setting 256_48_2_24
this is a proof that WMEncoder can decode .wmv/.wma...
this line is identical:
WMAEncode --codec pro --mode cbr --bitrate 256 --out-channels 2 audio6.wma audio2.wma
but i get:
Not a valid WAV file
_
All right, but my program doesn't use Windows Media Encoder at all - it uses functions from Wmvcore.dll.
For my encoder to read WMA/WMV files, another reading functions should be added to the program, and I have no plans to do this.
please, can you add support for raw pcm input?
suggestion for syntax:
--raw: signals raw pcm input
--in-samplerate n: sets intput format with n samples per second
--in-channels n: sets intput format with n channels
--in-bitdepth n: sets intput format with n bits per sample
to avoid confusion maybe "--priority" should become "--lowpriority"
_
Mono now working. Thanks!
Version 0.2.6, with raw PCM input support.
thanks a lot...
_
Version 0.2.7: progress report was added by request. Also added --silent switch to disable it.
thanks a lot...
_
Thank you so much! Microsoft inexplicably has completely removed any command line support in their wma encoder running under Windows 7.
thanks a lot...
_
Once more many thanks for this encoder, i use it very often, its a shame something like this wasn't made by MS himself, using wme was useless and uncomfortable for me, as i always wanted only audio conversion.
thanks a lot...change log?
_
WMA TAG Does not support unicode (UTF-8) text
The tags are of type WMT_TYPE_STRING (http://msdn.microsoft.com/en-us/library/windows/desktop/dd757834.aspx) ("null-terminated Unicode string"). And Unicode in Windows (http://msdn.microsoft.com/en-us/library/windows/desktop/dd374081.aspx) means UTF-16.
thanks a lot...
_
Thank you very much for development
Thanks alot, i was waiting for this type of app!
This is great, thanks. Any chance of adding a --scale option to scale the input source, as lame and oggenc2 support?
I have made a small wrapper command line tool for the new Microsoft Expression Encoder WMA Encoder, which supports WMA 9 and WMA Professional 10.
You can use it like:
wmaenc -i input.wav -o output.wma
It requires the Microsoft Expression Encoder to be installed, otherwise it won't work. Do a google search on where to download it. Also, please note this is not a polished piece of software, merely a quick and dirty tool, so there may be errors and quirks. But it does the job for me.
I also attached the source code (c# visual studio) in case you want to see how it's basically done, you may want to write your own version.
Hi,
Could you give me exact line I should give foobar to convert a file to wma pro q50?
--codec pro --quality 50 - %d
EZ CD Audio Converter supports WMA 11. It that version worse than 9 and 10?
http://www.poikosoft.com/help/encoder_versions.html (http://www.poikosoft.com/help/encoder_versions.html)
EZ CD Audio Converter supports WMA 11. It that version worse than 9 and 10?
http://www.poikosoft.com/help/encoder_versions.html (http://www.poikosoft.com/help/encoder_versions.html)
It says Windows Media Format 11, not WMA 11. WMF is not an audio codec.
http://msdn.microsoft.com/en-us/library/wi...8(v=vs.85).aspx (http://msdn.microsoft.com/en-us/library/windows/desktop/dd757738(v=vs.85).aspx)
At least that's how I understood it, I'm not that familiar with Windows Media Format.
WMA 9 and WMA 10 Professional are the newest codecs currently available.
bernhold, thanks for that.
lvqcl, wha do I need to install to use "-c voice"? I keep getting "Requested encoder not found".
My bad I was using the wrong command, everything works perfectly. Thanks.
thank u,lvqcl
love it.
fb2k+windows 8 pro
works perfect
Hi!lvqcl ,thank you very much ,your encode is just what i want to find.this time i can convert music to .wma more conveniently.I'm very glad to see your achievement!!!
Thank you for making this handy tool available. I can't seem to get stereo to mono downmix working, though. Here's what I've tried:
input file as per ffmpeg:
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s
wmaencode --out-channels 1 "links, rechts.wav"
output file as per ffmpeg:
Stream #0:0(ger): Audio: wmav2 (a[1][0][0] / 0x0161), 44100 Hz, stereo, fltp, 128 kb/s
And it is stereo indeed, verified using my ears. What am I missing?
a) WMAencode doesn't downmix itself. It asks Windows Media Runtime to do this (the same is true for --out-samplerate and --out-bitdepth options)
b) 128 kbps mono wma files aren't supported by WM Runtime, so it ignores downmix request.
Try to create 48 kbps WMA file and you'll see that --out-channels 1 works in this case.
Thank you for your prompt reply. It works as you're saying.
So, knowing that the Windows Media Runtime does not blindly support any random combination of encoding parameters but only specific ones, the user can find clues about what the combinations are and what parameters to supply by reading wmaencode --print-formats.
lvqcl, I just wanted to say thank you for putting this app together. Years ago, while I was working at Microsoft, I had made modifications to the original WMCmd.vbs (http://citizeninsomniac.com/WMV/#WMCmd (http://citizeninsomniac.com/WMV/#WMCmd)) that allowed a lot of advanced functionality for VC-1 and WMA encoding, but I'm glad somebody just skipped the entire WME9 SDK altogether and did a native implementation based on the WM Format SDK (or Media Foundation, whichever one you used). That's definitely the best way to go.
I have a feature suggestion too:
It'd be really nice if the tool was able to:
1) print to screen the DLL version of the WMA encoder DMO (wmadmoe.dll) installed on the system
2) embed the WMA encoder DLL version into the "WM/ToolVersion" or "WM/EncodingSettings" ASF attribute, so it's documented which WMA codec version was used
2) embed the WMA encoder DLL version into the "WM/ToolVersion" or "WM/EncodingSettings" ASF attribute, so it's documented which WMA codec version was used
When I open .wma file in Winamp, I can see in its properties:
WMFSDKVersion 12.0.7601.17514
so it's sort of documented already.
When I open .wma file in Winamp, I can see in its properties: WMFSDKVersion 12.0.7601.17514 so it's sort of documented already.
Oh, good call. I was only checking with MediaInfo, which probably only registers a subset of ASF attributes. When I checked with ASF Viewer, I was able to see the attribute you mentioned. Thanks!
lvqcl, I have another question:
Do you know which encoder complexity value (MFPKEY_ENCCOMPLEXITY) you're using for WMA Lossless?
Looks like the default value changed from 100 (worst performance, best efficiency) to 0 (best performance, worst efficiency) between Vista and Win7, which is probably something most people are unaware of. https://msdn.microsoft.com/en-us/library/wi...9(v=vs.85).aspx (https://msdn.microsoft.com/en-us/library/windows/desktop/ff819329(v=vs.85).aspx)
This program uses Windows Media Format SDK, not Media Foundation. So I have no idea and I'm not sure that this property is applicable to WMF SDK.
This program uses Windows Media Format SDK, not Media Foundation. So I have no idea and I'm not sure that this property is applicable to WMF SDK.
It's been a while since I've used them, but I believe every MFT property is also exposed as a DMO property and configurable via the
IPropertyBag interface. I'm not sure if the property names are the same or if you have to query the interface first for a complete list, but you should be able to get to them one way or another. https://msdn.microsoft.com/en-us/library/wi...8(v=vs.85).aspx (https://msdn.microsoft.com/en-us/library/windows/desktop/dd443228(v=vs.85).aspx) might shed more light on the matter.
According to https://technet.microsoft.com/en-US/ff819329 (https://technet.microsoft.com/en-US/ff819329)
Available only by using IPropertyStore.
So, no luck.
Available only by using IPropertyStore.
So, no luck.
Is there a way to query IPropertyBag for a list of available properties?
I don't remember specifically for WMA encode, but I do remember for WMV9 (VC-1) encoder that there was a 1:1 mapping between DMO and MFT properties.
Consider that most of these codecs were developed before Media Foundation was introduced in Vista, so it would make sense that their properties were primarily exposed via the DMO interface and then later supplemented via the MFT interface. I'd be very surprised if the DMO property bag was completely disabled.
Is there a way to query IPropertyBag for a list of available properties?
I have no idea. I'm not very familiar with COM, interfaces, and so on.
I do realize this is an ancient thread, but since it talks about windows media encoder, and the owner seems to have a great knowledge about this application...
Is there any chance of making WMAVoice ENCODER available for ffmpeg? That would be very nice since I can't seem to get the same quality at such low bitrates (5~7kbps for dialogues) even with Opus and the such (not to mention it's not natively suported by WMP).
@lvqcl Is there are a bare minimum subset of Windows Media Format SDK that is required to allow WMAEncode.exe to run? That is: a list of required dlls rather than a simple installation of the full Windows Media Format SDK package...
I don't know about such list. Also remember that you need to register those DLLd anyway (via regsvr32).
I don't know about such list. Also remember that you need to register those DLLd anyway (via regsvr32).
I confess that my aim is to use your encoder under Linux and Wine, so I am trying to work out the most minimal installation required under Wine to get it all running...
How to make so that at 48 kbps encoding, he circumcised at 16 kHz instead of 12 kHz?
You likely mean the low pass filtering. Sorry, if you want that much frequency response from that low a bitrate, you'll either need to use WMA Pro, or another codec, such as Opus or AAC HEv2.
(Quick hint, most English speaking people only use that word to refer to the removal of the foreskin from the penis.)
wma standart play almost all mp3 players. WMA Pro, Opus and AAC HEv2 almost no one plays.
Good luck finding a high quality third party WMA encoder. Microsoft's encoder won't let you change anything other than the bitrate profile.
Can someone please help me with this encoder? I'm trying to run a FLAC to WMA (lossless) conversion, but need help pointing to the correct encoder and using the correct parameters.
My car's GraceNote system only supports lossless in WMA format for some odd reason. No FLAC or ALAC.
JXL
Nevermind. I figured it out.
Place both WMAEncode,exe and WMAEncode64.exe in the C:/Windows/Program Files (x86)/Foobar2000/Encoders/ folder.
Select custom encoder and set the encoder file as the WMAEncode64.exe file that you just saved. At least that is what worked for me on Windows 10.
Encoder file: C:/Windows/Program Files (x86)/Foobar2000/Encoders/WMAEncode64.exe
Extension: wma
Parameters: --codec lossless -input %s -output %d
Am I missing anything?
Thanks in advance.
JXL
Update: --silent --codec lossless - %d
Works flawlessly, but the GraceNote POS system does not support gapless playback when connecting your music via a flash drive or SSD. I can only get gapless playback from my iPod Classic through the USB connection. Even my Samsung S10 has a pause between tracks when hooked up via USB.... total joke. What else should I expect from a software designed by a Sony owned company? MP3, AAC, and WMA files loaded on a flash drive, my Samsung S10, and a 500 GB SSD all played and the tags were readable and searchable through the HUD, but there was a pause between each and every track.. kills DJ mixes completely. *GRACENOTE FAILS*
FYI... fully updated GraceNote in my car to the latest and did a bunch of research on it. Looks like I'll have to shell out $450 to get Android Auto installed in my car from the dealership. They have an upgrade program going on that replaces the USB hub with a more powerful one and installs Android Auto in the car. Might fix this mess and allow me to enjoy lossless and gapless music in my ride.
JXL