Using NAudio to convert an online radio stream to PCM, in real-time - naudio

Could NAudio be used to convert a radio-stream to PCM samples, in real-time?
I've seen documentation and questions regarding conversion of local audio-files, but did not find reference to real-time conversion of an online (radio) stream.
My current specific interest is in a ShoutCAST MP3 stream.
Solution is to embedded in a Winforms application written using VB.Net. Target OS is Windows 7.
Your assistance would be much obliged.

Here's an answer by Mark Heath, on CodePlex:
Regarding MP3 Streams:
hi, have a read of my blog post here about streaming MP3: http://mark-dot-net.blogspot.co.uk/2011/05/how-to-play-back-streaming-mp3-using.html.
To calculate power, you'd examine the PCM sample values after decompressing, and perform your own calculations.
Regarding ShoutCAST Streams:
NAudio does not decode Shoutcast at the moment.
Even so, if someone does have a solution for ShoutCAST streams, I'd appreciate it if you post it here.

Related

Record system audio with Visual Basic.Net

I have been stuck on a issue about recording system audio in VB.Net for quite some time now. And I can't find any proper ways to do it. I have been able in the past to make it record the Stereo Mix channel. But as we all know: The quality is absolutely horrible.
I have looked into the Bass.net library, but find it incredibly hard to understand. And the licensing agreement does not fit my usage.
Is there a way to have it record the system audio (Audio played by the computer) properly with optimal audio quality where I can save the recorded audio as a .wav or .mp3?
naudio can do that and is disstributed under the Microsoft Public License (Ms-PL). Don't know if the licenses fits your needs but at least naudio will
This will help you accomplish what you need with no third party libraries required.
http://www.codeproject.com/Articles/770246/How-to-record-any-PC-sound-through-WASAPI-and-Audi

Create mp3 from mic audio input

I have a Mac app communicating with a web service that can only deal with mp3 files. I found out after hours of debugging that kAudioFormatMPEGLayer3 is decode only. So, I need to either take the resulting audio data and convert it straight to mp3 or convert it to AAC or some other supported format to mp3. Compatability with iOS is not a concern.
Also, please don't recommend LAME the license is not acceptable for this particular case. And any code demos would be greatly appreciated.
MP3 is a patented file format. You can't just write an MP3 encoder and stick it in your app unless you pay a licensing fee.
http://mp3licensing.com/royalty/
Your best bet is to stick with the built-in AAC encoding.

H264 frame viewer

Do you know any application that will display me all the headers/parameters of a single H264 frame? I don't need to decode it, I just want to see how it is built up.
Three ways come to my mind (if you are looking for something free, otherwise google "h264 analysis" for paid options):
Download the h.264 parser from (from this thread # doom9 forums)
Download the h.264 reference software
libh264bitstream provides h.264 bitstream reading/writing
This should get you started. By the way, the h.264 bitstream is described in Annex. B. in the ITU specs.
I've created a Web version - https://mradionov.github.io/h264-bitstream-viewer/
Based on h264bitstream and inspired by H264Naked. Done by compiling h264bitstream into WebAssembly and building a simple UI on top of it. Output information for NAL units is taken from H264Naked at the moment. Also supports files of any size, just will take some time initially to load the file, but navigation throughout the stream should be seamless.
I had the same question. I tried h264 analysis, but it only supports windows. So I made a similar tool with Qt to support different platforms.Download H264Naked. This tool is essentially a wrapper around libh264bitstream

Streaming encoded video in Adobe AIR Application

I am developing a desktop application in Adobe AIR that will be used to stream the user's camera video to a wowza media server. I want to encode the video on the fly, means transmit the H.264 encoded video instead of the default flash player encoded video for quality purpose. Is there any way around for this?
Waiting for the help from people around,
Rick
H.264 encoding is usually done in Native Code C or C++ because it is a cpu
intensive set of algorithms. The source code for x264 can give you an
idea of the code required but it is a tough read if you start from scratch.
Here is a book to get you started or you can read the original AVC standard
if you suffer from insomnia.

Is there a way to stream audio from MIC and play that stream in Silverlight

So I want to stream the audio from a mic using NAudio and then pass that stream to WCF which a Siverlight app can consume to broadcast the live audio sound. I want the latency to be as low as possible.
Any suggestions or if some one has already done it please point the source. Thanks in advance
what you are asking is certainly possible, but will be a fair amount of work to do.
NAudio can handle to capturing microphone audio.
At the Silverlight end you can play custom audio formats (in this case PCM) using a custom media element streaming source. See this one: http://code.msdn.microsoft.com/wavmss
I suspect latency would not be very good. You can reduce it by keeping the buffer sizes small. Also bear in mind that WAV is not a very efficient format to be sending over the network.
To have low latency as possible, you should use the netTcpBinding and stream your audio in binary format. I would use MemoryStream for this and try to play with the buffersize to figure out what the best performance is. Also, try checking audio formats for best performance. This also depends of the audio quality you expect.