I'd like to play back ogg vorbis audio from http in Silverlight. What do I need to make this happen?
A better answer than "Silverlight doesn't support Ogg Vorbis" is to say that Silverlight doesn't support playing them natively. As one of the other commenters pointed out, a way to play them is described at http://veritas-vos-liberabit.com/monogatari/2009/03/moonvorbis.html, with the current source for CSVorbis available at https://github.com/mono/csvorbis. You would indeed need to implement a MediaStreamSource to play the resulting PCM stream, but that's not rocket science.
Silverlight does not support playing ogg vorbis files.
If you'd like Silverlight to play files already encoded in ogg vorbis, I suggest converting them. Either do a one time sweeping convert of all your files, or convert them on the fly while your server is serving them.
Alternatively, In Silverlight 4, assuming you know enough about Media Formats and Ogg vorbis is particular, you can implement MediaStreamSource to support ogg vorbis.
http://msdn.microsoft.com/en-us/library/system.windows.media.mediastreamsource(VS.96).aspx
Related
I want to be able to load/save jpeg files on Windows via api, specifically gdi32.dll because it looks to universally exist in all versions of Windows.
But I'm unable to find any information on how to do this from an array of pixels with 4 bytes per color (rgba, bgra, rgb would be ok to since jpeg doesn't support alpha etc.)
Not interested in an external library or gdi+. gdi32 should have the ability, but I can't seem to find enough information on how to implement it.
I am going to ignore your refusal to use anything outside of gdi32.dll, because that kind of requirement is not likely to help anyone, and as #David Heffernan said, there is no JPEG support in gdi32.dll.
There are a number of ways to load/save JPEG pictures built into winapi, and supported all the way back to Windows 2000 (and earlier...).
OleLoadPicture / OleSavePicture - though I am not sure if it's very easy to save your own JPEG files this way.
Gdiplus::Image allows loading & saving JPEG files.
Plain GDI does not have any support for JPEG.
If you won't countenance using a library other than GDI, then you will have to write your own JPEG library. Allow me to recommend that you reconsider your requirements.
The GDI is the Graphical Device Interface. It's responsibility includes rendering primitives to the screen or offscreen device contexts. Encoders and decoders are not included.
The standard Windows encoders and decoders are provided through the Windows Imaging Component. This component is available starting with Windows XP SP2. It is also available for Windows Store apps.
I need to convert some hi res audio files to u-law compression. I find no documentation on this- I'm almost certain the codec is there on Windows machines, but how the heck do I access it?
Yes the codec is there, however it is outside of WASAPI. APIs that deal with codecs are:
Audio Compression Manager
DirectShow
Media Foundation
Not sure about the latter, however the first two have the μ-law encoder readily available (the codec itself has ACM interface, and DirectShow offers a wrapper over it).
Hey, I was looking for a good MP3 or OGG decoder that use the BSD license or public domain and that is also light-weight (something that comes with sources without the need of platform specific configuration).
You're not likely to find one for mp3 as there are a handful of licensing issues.
OGG is simply a container format that can hold audio, video, and more. Perhaps you mean ogg vorbis. Check out stb_vorbis. It's a free, public-domain C vorbis codec.
Like this one?
The Xiph.org libvorbis is available in pretty much every distro, and satisfies your requirement for a BSD-3-Clause license. "Light" is always relative... Also from Xiph.org available is libtremor, a integer-only vorbis decoder.
As other answers have mentioned, there are Vorbis decoders. The Fluendo MP3 decoder is MIT (simplified BSD) licensed.
Any suggestions on how to implement Compression of captured Audio in a Silverlight 4 Application? I'd prefer something lossy like MP3 or AAC but after my intial research only turned out one lonely pure C# FLAC encoder/decoder, anything better than this would be nice.
Please note that sending uncompressed audio to the server and compress it there is not an option because of a) traffic cost and b) the audio is additionally encrypted by the client so the server never sees the source material.
I don't know of any implementations of proprietary compression algorithms in C#. You pretty much would have to implement your own. ADPCM is silmple and offers 4:1 compression ratio. More on the subject: http://forums.silverlight.net/forums/p/145729/374278.aspx
Does it have to be C#? LAME is a pretty good, very configurable MP3 encoding library.
http://lame.sourceforge.net/
I have a video decrypter library that can decode an obsolete video format, and returns video frames in BMP and audio in WAV through callback functions. Now I need to encode a new video in any standard format under windows.
What might be the standard way to do this? I am using Win32/C. I guess Windows has its own encoding library and drivers and I don’t need to use FFMPEG. Any pointer to an example code or at least to a library to look at will be greatly helpful.
Edit: I accept. FFMPEG is the easiest way to do it.
On Windows, you have two native choices.
The old Windows Multimedia library which is too ancient to seriously consider, but does have the Video Compression Manager.
And then there's DirectShow.
It's certainly doable through DirectShow, but you better enjoy COM programming and the concepts of Filters, Graphs, and Monikers (oh my). See this tutorial for a crash course:
Recompressing an AVI File
And the MSDN documentation.
A simpler approach is indeed to use an library like FFMPEG or VLC.
To save yourself heartache, I echo Frank's suggestion of just using FFMPEG. Executing a separate FFMPEG process with the correct arguments will 100% be the easiest way to achieve your goals of encoding.
Your other options include:
libavcodec - The central library used in FFMPEG. I warn there don't appear to be many Windows binaries of libavcodec available, so you'd probably have to compile your own, which, at minimum, would require a Cygwin or MingW set up.
ffdshow-tryouts - A video codec library implemented as a DirectShow filter based on libavcodec. They do seem to have an API for manipulating it, but it's a .NET library.
I would suggest looking at the VirtualDub source code. It's a well known encoder that uses VFW. You may be able to get some ideas from that software.