Results 1 to 5 of 5

Thread: Output from the audio card and broadcast it over a network

  1. #1

    Thread Starter
    Lively Member elmnas's Avatar
    Join Date
    Jul 2009
    Posts
    127

    Output from the audio card and broadcast it over a network

    Hello people,

    I have started to create a program where the goal is to use the primary soundcard as a radio station.

    I have done much research but it seems like no one have made this kind of solution before.

    Now is my issue how to make my app play the sounds from the soundcard that is in use.

    (example if I turn on spotify I want my to play the music or if I have any other program that makes sounds make them playback in my app)

    I want to take the output from the audio card and broadcast it over my network.

    here is my code so far.

    Code:
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            Dim SoundDevicelist As New List(Of String)
            Try
                Dim searcher As New ManagementObjectSearcher(
                    "root\CIMV2",
                    "SELECT * FROM Win32_SoundDevice")
     
                For Each queryObj As ManagementObject In searcher.Get()
                    ' Console.WriteLine("-----------------------------------")
                    'Console.WriteLine("Description: {0}", queryObj("Description"))
                    'Console.WriteLine("Manufacturer: {0}", queryObj("Manufacturer"))
                    ' Console.WriteLine("Caption: {0}", queryObj("Caption"))
                    ' Console.WriteLine("PNPDeviceID: {0}", queryObj("PNPDeviceID"))
                    ' Console.WriteLine("Availability: {0}", queryObj("Availability"))
                    SoundDevicelist.Add(queryObj("Caption").ToString())
                Next
            Catch err As ManagementException
                MessageBox.Show("An error occurred while querying for WMI data: " & err.Message)
            End Try
            For Each item In SoundDevicelist
                MsgBox(item)
            Next
    End sub


    my code so far just listening the available devices above.
    now is the more tricky part
    how do I use the device and put it to streaming source ?

    Could someone help me?

    Thank you in advance

  2. #2
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    6,598

    Re: Output from the audio card and broadcast it over a network

    Well, I'm not going to do the research, but I would assume if you look at implementing VOIP code, that type of code could be adapted to do what you want and should be easier to find examples of.

  3. #3

    Thread Starter
    Lively Member elmnas's Avatar
    Join Date
    Jul 2009
    Posts
    127

    Re: Output from the audio card and broadcast it over a network

    I have done pretty much research pretty hard to find any example tho.

    any hints?

    Thank you in advance..

  4. #4
    Frenzied Member
    Join Date
    May 2014
    Location
    Central Europe
    Posts
    1,388

    Re: Output from the audio card and broadcast it over a network

    i think you would need to "record" the playing audio via wavein. as far as i remember you can set things up so that you get the normal output coming in via wavein. then you need to compress this audio data, prop mp3, and then send the mp3 packets over the network.
    naudio/ seems to be a well known wrapper for audio stuff. i'd suggest you start to try recording the soundcard output into a file and when that works, you try streaming and mp3 conversion to a fila and once that is done you add the network stuff.

  5. #5

    Thread Starter
    Lively Member elmnas's Avatar
    Join Date
    Jul 2009
    Posts
    127

    Re: Output from the audio card and broadcast it over a network

    Quote Originally Posted by digitalShaman View Post
    i think you would need to "record" the playing audio via wavein. as far as i remember you can set things up so that you get the normal output coming in via wavein. then you need to compress this audio data, prop mp3, and then send the mp3 packets over the network.
    naudio/ seems to be a well known wrapper for audio stuff. i'd suggest you start to try recording the soundcard output into a file and when that works, you try streaming and mp3 conversion to a fila and once that is done you add the network stuff.
    Ah thank you very much I'll try this!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width