1

I need to calculate the power of an online audio-stream, sourced in some URL (in dB or some other volume-level units). Could this be accomplished using native VB (i.e. VB6) or the .NET framework?

I could easily listen to this audio-stream using the WMP (Windows Media Player) control. Could this control be used to accomplish that?

Alternatively, If audio-stream could be converted to PCM samples in real-time, please let me know how, as I could use the PCM samples to calculate audio-signal's power (over the last X seconds) myself.

Looking for a solution supporting ShoutCAST streams, as well as MP3.

{ I'm writing a Winforms application over VB.Net, for Windows 7/8. }

Thanks much.

Bliss
  • 426
  • 2
  • 5
  • 19
  • Just a quick question on this. The dB value refers to the power as you've said. But the power will be defined by the player (eg volume level) not the webpage or server. So what is it you actually want? – FraserOfSmeg Nov 11 '13 at 20:44
  • Converting streaming audio formats to PCM in real time is certainly possible. If your computer can play it in real time, it can convert it in real time. How you do it depends a lot on the source format. See http://stackoverflow.com/q/5959537/56778 for some possibilities. – Jim Mischel Nov 11 '13 at 22:56
  • @FraserOfSmeg: Thanks for your comment. Volume-level supplied by the player could be sufficient as well, as stated in my question: "e.g. in dB", which means `dB` was given just as an example for a possible unit of measurement. Even so, I re-phrased this expression, to emphasize it more. :-) – Bliss Nov 12 '13 at 06:48
  • @JimMischel: Thanks for your input. The solutions suggested on the thread you pointed seem to refer to conversion of an audio file (located on your PC). I'm actually looking for real-time conversion, of an online stream. Would appreciate it if you direct me to a solution for that. – Bliss Nov 12 '13 at 06:55
  • @Bliss: Those solutions read from files, yes. My point was that the code reads the files sequentially byte-by-byte. For all intents and purposes, they do what you're asking. You just have to refactor the code a bit so that it takes from a stream rather than reading a memory buffer. – Jim Mischel Nov 12 '13 at 13:11
  • @JimMischel: Thanks, but I don't know how to accomplish that - get an online stream's samples in real-time (using VB.Net). – Bliss Nov 12 '13 at 13:27
  • To get started streaming, see http://stackoverflow.com/q/184683/56778. You'll probably want to get NAudio and learn to use it. – Jim Mischel Nov 12 '13 at 14:44
  • @JimMischel, It seems NAudio does not support ShoutCAST streams. I have already tested this option. – Bliss Nov 12 '13 at 15:55
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/41032/discussion-between-bliss-and-jim-mischel) – Bliss Nov 12 '13 at 16:04
  • You didn't mention ShoutCAST before. I suggest you use your favorite search engine. Searching for "stream shoutcast C#" gives lots of interesting information. – Jim Mischel Nov 12 '13 at 16:04

0 Answers0