How to do audio output selection for MediaPlayer control?

Post

Posted
Rating:
#1 (In Topic #478)
Avatar
Regular
Cedron is in the usergroup ‘Regular’
 I'm working on improving my music player some.  

Issue #1:

There seems to be a little bit of strange behavior while working on a Raspberry Pi 4.  Every third or fourth play or so the playback halts.  The event handler reports an event type 1.  I was able to code a work around (will be included when I post it in the project showcase) that stops the player, resets the URL, then starts the player again when this event occurs.  The only consequence is the song gets listed twice in the history.  Rather than fixing that, I let it be so I could track occurrences.


Issue #2:

The media player does not honor the default audio out system setting.  Strangely it works opposite on the Pi4 than my Mint laptop.  When I plug in an external usb sound device it takes precedence on the laptop while on the Pi4 the HDMI output takes precedence.

So, I looked at the wiki at the media player stuff and am a bit puzzled at how to put it all together.  I was hoping somebody has already done this and knows the proper way to do it.

I'd like to add a settings tab to the player that lets the output channel be selected on the fly.  This requires being able to read the available outputs and then being able to select one.

Does anyone know how to do this?

.... and carry a big stick!
Online now: No Back to the top

Post

Posted
Rating:
#2
Regular
vuott is in the usergroup ‘Regular’
I don't know if I understand correctly
However, in general if you want to identify the audio device, to which to direct the audio, in my opinion you have to use the ".Audio.Output" Property of the "MediaPlayer" Class, assigning it the GStreamer plugin - for example - "alsasink" through the "MediaControl" Class and specifying the audio-device.

I show a practical example:

Code (gambas)

  1. Public Sub Main()
  2.  
  3.   Dim mp As MediaPlayer
  4.  
  5.   With mp = New MediaPlayer
  6.     .URL = Media.URL("/path/of/audio/file")
  7.     .Audio.Output = New MediaControl(mp, "alsasink")
  8.  ' It specifies audio-device (in my sistem is "hw:1,0,0"):
  9.     .Audio.Output["device"] = "hw:1"   ' or more in detail "1,0,0".  But it could also be '"plughw:1,0,0"
  10.     .Play
  11.  
  12.   Repeat       ' It allows "MediaPlayer" to return the duration value of the audio file
  13.     Wait 0.01
  14.   Until mp.Duration > 0.0
  15.  
  16.   Wait mp.Duration
  17.  
  18.   mp.Close
  19.  

Europaeus sum !

<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Online now: No Back to the top

Post

Posted
Rating:
#3
Avatar
Regular
Cedron is in the usergroup ‘Regular’
Thanks vuott.  I got your example to work, but I can't get it to direct to either output by switching the value from "hw:0" or "hw:1"

hw:0 plays through the laptops internal speaker, not the HDMI.


This code snippet:
 

Code (gambas)

  1.  
  2.         myPlayer.Play()
  3.  
  4.         myInput = myPlayer.Input
  5.         myOutput = myPlayer.Audio.Output
  6.        
  7.         Print myInput.Name, myInput.Type
  8.         Print myOutput.Name, myOutput.Type
  9.  

Generates this output:

Code

source  filesrc
audiosink       autoaudiosink

I've been doing some searching on ALSA, and found the following:

Code

~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: MID [HDA Intel MID], device 0: ALC269VB Analog [ALC269VB Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: MID [HDA Intel MID], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: MID [HDA Intel MID], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: MiniLink [MiniLink], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0


~ $ cat /proc/asound/modules
 0 snd_hda_intel
 1 snd_usb_audio


~ $ cat /proc/asound/cards
 0 [MID            ]: HDA-Intel - HDA Intel MID
                      HDA Intel MID at 0xd4620000 irq 45
 1 [MiniLink       ]: USB-Audio - MiniLink
                      XITEL MiniLink at usb-0000:00:1d.0-1.3.6, full speed

So, now I'm trying to tie it all together.  Still unsuccessful, but better off than I was before.

.... and carry a big stick!
Online now: No Back to the top

Post

Posted
Rating:
#4
Regular
vuott is in the usergroup ‘Regular’

Cedron said

Code

source  filesrc
audiosink       autoaudiosink
…I used "alsasink" plugin, not autoaudiosink.


Cedron said

Code

~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: MID [HDA Intel MID], device 0: ALC269VB Analog [ALC269VB Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: MID [HDA Intel MID], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: MID [HDA Intel MID], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: MiniLink [MiniLink], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
  
 

Did you try with: <COLOR color="#800000">"hw:0,3,0"</COLOR>  or <COLOR color="#800000">"hw:0,7,0"</COLOR> ?

Europaeus sum !

<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Online now: No Back to the top

Post

Posted
Rating:
#5
Avatar
Regular
Cedron is in the usergroup ‘Regular’
 Yes.  I've tried all sorts of combinations, with two parameters, commas or periods, with or without the "hw".  All give me a "Can't set Status" error when the .play is hit.

From looking at /etc/share/alsa/alsa.conf, I've also tried using "subdevice" on another line and get "Unknown property".

On my mint box, I can switch outputs while the player is playing through the sound preferences.  This is adequate for my needs, but it doesn't work that way on the Pi4.

Strange.

.... and carry a big stick!
Online now: No Back to the top

Post

Posted
Rating:
#6
Regular
vuott is in the usergroup ‘Regular’

Cedron said

All give me a "Can't set Status" error when the .play is hit.
My laptop also has the HDMI device, and it is identified with card 0, device 3 and subdevice 0.
So, I tried that code of mine with these instructions:

Code (gambas)

  1. With mp = New MediaPlayer
  2.   .URL = Media.URL("/path/of/audio/file")
  3.   .Audio.Output = New MediaControl(mp, "alsasink")  ' ...ALSASINK !
  4.   .Audio.Output["device"] = "hw:0,3,0"
  5.   .Play
Well, I don't hear any sound, as my laptop is now not connected to an external device via HDMI, but the data processing goes on …by using after .Play() this lines:

Code (gambas)

  1.   Write "\r" & Date(0, 0, 0, 0, 0, 0, mp.Position * 1000)
  2.   Wait 0.001
  3. Until mp.Position >= mp.Duration
  4.  
and I do not get that error, that you reported.


Cedron said

I've also tried using "subdevice" on another line and get "Unknown property".
About GStreamer plugins - used in 2nd argument of MediaControl object -  and their properties, you can have a look here:
Plugins

Europaeus sum !

<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Online now: No Back to the top

Post

Posted
Rating:
#7
Avatar
Regular
Cedron is in the usergroup ‘Regular’
It is working now, on both the laptop and Pi4.  Not sure what I did wrong while flailing.  Thank you very much.

That is a helpful link.  The default created by ".play" is obviously "autoalsosink" which allows the system preferences to switch output during playback on my laptop, but not the Pi4.  When a media control is explicitly create, per your code, then the playback is immune to the system setting.   This is what I wanted.

Now I have to incorporate it into my music player.  Do you know of any "pure Gambas" way via the Media* controls of getting the equivalent of the "aplay -l" output?

I do know how to shell, capture, and parse.

Thanks again.

In case anybody hasn't seen it, my music player is available here:

Gambas One - Gambas ONE

"It's the best ever, nobody has ever seen anything like it."

.... and carry a big stick!
Online now: No Back to the top

Post

Posted
Rating:
#8
Regular
vuott is in the usergroup ‘Regular’

Cedron said

Do you know of any "pure Gambas" way via the Media* controls of getting the equivalent of the "aplay -l" output?
Well, I can show you this page, that I wrote, of the WIKI of the Gambas Italian programmers forum.
There you can try two codes, which however use the external functions of ALSA via "Extern ":

   Conoscere con le funzioni esterne di ALSA i dispositivi audio presenti nel sistema - Gambas-it.org - Wikipedia

…but if you don't want to use the external ALSA functions, you can easily get those string data from the files in the subfolders of "/proc/asound/ " path.

And more, If you still prefer to use the resources of the gb.media Component, you need to search through the appropriate properties of GStreamer plugins, and use them with the MediaControl Object.

Europaeus sum !

<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Online now: No Back to the top

Post

Posted
Rating:
#9
Avatar
Regular
Cedron is in the usergroup ‘Regular’
 Several years ago I wrote the predecessor to this program in pure C++ using the ALSA library.  I was kind of worried I was going to have to port that code to my own C shared library and replace the MediaPlayer.

Thanks to your help, I don't have to do that.  The /proc/asound/pcm file, loaded with a single File.Load statement does the trick.  I've added a "Settings" tab to the music player and put a list box there with the lines from that file.  On a click, I can consruct the proper hw: argument and good to go.  The only thing is that it needs to be done before the player is started.  That's not a problem for me, but something I need to fix before I post the upgrade.  That is going to have to wait for another day.

It still concerns me that the MediaPlayer doesn't honor the system setting on the Pi4.  I'm not sure whether it is worth reporting as a bug (It is 3.12.2 after all).  Perhaps somebody else who has a Pi4 can verify the same problem.

Many thanks again.

.... and carry a big stick!
Online now: No Back to the top

Post

Posted
Rating:
#10
Regular
GrantXTV is in the usergroup ‘Regular’
 Hi all,

I have run into an issue whereby I am trying to get audio samples from the Media Viewer or a sound device input.

Option 1  
Is to find away to do this from the Media Viewer and to convert it to a lower PCM format of 22.05 kHz, stereo at 8bit sizes, to send to a Byte or an Integer to work with.

Option 2
If this can not be done, to read in the samples from a sound device at 22.05 kHz, stereo at 8bits to send to a Byte or an Integer to work with.

The last step would be to send this processed audio back out to sound device, any ideas on how this could done within Gambas?
I have been trying to do something like this for a few weeks now.
Online now: No Back to the top

Post

Posted
Rating:
#11
Regular
vuott is in the usergroup ‘Regular’

GrantXTV said

Option 2
If this can not be done, to read in the samples from a sound device at 22.05 kHz, stereo at 8bits to send to a Byte or an Integer to work with.
In general with gb.media Component, to change audio characteristics of a file, during its conversion, the MediaPipeline and MediaFilter Classes should be used.
Below is a practical example, in which we convert an MP3 file to a WAV file having sample rate = 22050 hertz and resolution = 8 bit:

Code (gambas)

  1.  
  2.  
  3. Public Sub Main()
  4.  
  5.  Dim pl As MediaPipeline
  6.  Dim src, dcb, con, res, flt, wav, snk As MediaControl
  7.  Dim temporary, audiofile As String
  8.  
  9.  temporaneo = Temp
  10.  audiofile = "/path/of/audio/file/we/want/covert"
  11.  
  12.  pl = New MediaPipeline As "PLine"
  13.  
  14.  src = New MediaControl(pl, "filesrc")
  15.  src["location"] = audiofile
  16.  dcb = New MediaControl(pl, "decodebin")
  17.  con = New MediaControl(pl, "audioconvert")
  18.  res = New MediaControl(pl, "audioresample")  ' Allows to change the characteristics of the audio file
  19.  
  20.  flt = New MediaFilter(pl, "audio/x-raw,rate=22050,format=U8")  ' Set the characteristics of the audio file
  21.  wav = New MediaFilter(pl, "wavenc")
  22.  snk = New MediaControl(pl, "filesink")
  23.  snk["location"] = temporary
  24.  
  25.  src.LinkTo(dcb)
  26.  dcb.LinkLaterTo(con)
  27.  con.LinkTo(res)
  28.  res.LinkTo(flt)
  29.  flt.LinkTo(wav)
  30.  wav.LinkTo(snk)
  31.  
  32.  pl.play
  33.  
  34.  While pl.Duration < 1
  35.    Wait 0.01
  36.  Print "Duration of file: "; Time(0, 0, 0, pl.Duration * 1000)
  37.  Write "\r\e[0mElapsed time:     \e[31m" & Time(0, 0, 0, pl.Position * 1000)
  38.    Wait 0.01
  39.  Until bo
  40.  
  41.  Copy temporary To "/tmp" &/ File.BaseName(audiofile) & ".wav"
  42.  
  43.  pl.Close
  44.  
  45.  Print "\n\e[0mEnd conversion !"
  46.  
  47.  
  48.  
  49. Public Sub PLine_End()
  50.  
  51.  bo = True
  52.  
If we want send audio data to sound card directly:

Code (gambas)

  1.  
  2.  
  3. Public Sub Main()
  4.  
  5.  Dim pl As MediaPipeline
  6.  Dim src, dcb, con, res, flt, snk As MediaControl
  7.  
  8.  pl = New MediaPipeline As "PLine"
  9.  
  10.  src = New MediaControl(pl, "filesrc")
  11.  src["location"] = "/path/of/audio/file/we/want/covert"
  12.  dcb = New MediaControl(pl, "decodebin")
  13.  con = New MediaControl(pl, "audioconvert")
  14.  res = New MediaControl(pl, "audioresample")
  15.  flt = New MediaFilter(pl, "audio/x-raw,rate=11025,format=U8")
  16.  snk = New MediaControl(pl, "autoaudiosink")
  17.  
  18.  src.LinkTo(dcb)
  19.  dcb.LinkLaterTo(con)
  20.  con.LinkTo(res)
  21.  res.LinkTo(flt)
  22.  flt.LinkTo(snk)
  23.  
  24.  pl.play
  25.  
  26.  While pl.Duration < 1
  27.    Wait 0.01
  28.  Print "Duration of file: "; Time(0, 0, 0, pl.Duration * 1000)
  29.  Write "\r\e[0mElapsed time:     \e[31m" & Time(0, 0, 0, pl.Position * 1000)
  30.    Wait 0.01
  31.  Until bo
  32.  
  33.  pl.Close
  34.  
  35.  
  36.  
  37. Public Sub PLine_End()
  38.  
  39.  bo = True
  40.  

Europaeus sum !

<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Online now: No Back to the top

Post

Posted
Rating:
#12
Regular
GrantXTV is in the usergroup ‘Regular’
 Thanks for your reply, this is where I at the moment, finding a way to stream out, but not been able to get it to work so far.

Tested on gstreamer
gst-launch-1.0 alsasrc ! audioconvert ! audio/x-raw,rate=48000,depth=8,channels=2,width=16 ! rtpL24pay ! udpsink host=192.168.3.15 port=5001

Public bo As Boolean
Public Sub Form_Open()
 bo = True
End

Public Sub send_Click()
 Dim pl As MediaPipeline
 Dim src, aco, wen, snk, rtp, udp As MediaControl
 Dim flt As MediaFilter
 pl = New MediaPipeline
 src = New MediaControl(pl, "alsasrc")   
 aco = New MediaControl(pl, "audioconvert")
 flt = New MediaFilter(pl, "audio/x-raw,rate=44100,depth=16,channels=2,width=16,signed=true")
 rtp = New MediaControl(pl, "rtpL24pay")
 udp = New MediaControl(pl, "udpsink host=192.168.3.15 port=5001")
 src.LinkTo(aco)
 aco.LinkTo(flt)
 flt.LinkTo(rtp)
 rtp.LinkTo(udp)
 pl.Play()
 While bo
   TextBox1.Text = Str(Time(0, 0, 0, pl.Position * 1000))
   Wait 0.01
 Wend
 pl.Stop()
 pl.Close()
 Quit
End

Public Sub stop_Click()
  bo = False
End

Public Sub Form_Close()
  bo = False
End
Online now: No Back to the top

Post

Posted
Rating:
#13
Regular
vuott is in the usergroup ‘Regular’

GrantXTV said

 udp = New MediaControl(pl, "udpsink host=192.168.3.15 port=5001")
"HOST" and "PORT" are properties of the "udpsink " GStreamer Plugin.
Therefore they should be highlighted and separated.
……
udp = New MediaControl(pl, "udpsink")
udp["host"] = "192.168.3.15"
udp["port"] = 5001
……


GrantXTV said

This is what I tested on gstreamer and it works:
'gst-launch-1.0 alsasrc ! audioconvert ! audio/x-raw,rate=48000,depth=8,channels=2,width=16 ! rtpL24pay ! udpsink host=192.168.3.15 port=5001

What is best way to do this using mediaview, as I have not found a way to get this to work?
If you want to use "gst-launch-1.0 ", you will have to use its corresponding external function "gst_parse_launch()", since it has not been implemented in the Gambas gb.media Component.

Exemplum:
https://www.gambas-it.org/wiki/index.php/Eseguire_un_file_audio_usando_una_linea_di_pipeline_con_la_funzione_%27gst_parse_launch()%27

Europaeus sum !

<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Online now: No Back to the top

Post

Posted
Rating:
#14
Regular
GrantXTV is in the usergroup ‘Regular’
 Thanks Vuott,

I have tested this code out and it works, but there is an issues with the audio cutting in and out, I may need to add some type of audio buffer.
Any ideas on how I can go about this?

Other than this I can now look at doing the receiver part:
gst-launch-1.0 -v udpsrc port=5001 ! 'application/x-rtp,media=audio,payload=96,clock-rate=44100,channels=2,encoding-name=L24' ! rtpL24depay ! audioconvert ! autoaudiosink sync=false
Online now: No Back to the top

Post

Posted
Rating:
#15
Regular
GrantXTV is in the usergroup ‘Regular’
I found the issue, I had set the encoder to a sample rate of 44100 and the decoder was set to 48000, it helps to check these things.
Online now: No Back to the top

Post

Posted
Rating:
#16
Regular
vuott is in the usergroup ‘Regular’

GrantXTV said

Other than this I can now look at doing the receiver part:
gst-launch-1.0 -v udpsrc port=5001 ! 'application/x-rtp,media=audio,payload=96,clock-rate=44100,channels=2,encoding-name=L24' ! rtpL24depay ! audioconvert ! autoaudiosink sync=false
…this does not seem to be difficult.

Europaeus sum !

<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Online now: No Back to the top

Post

Posted
Rating:
#17
Regular
GrantXTV is in the usergroup ‘Regular’
 Hi Vuott,

Today's work on the receiver part, "this does not seem to be difficult", but it is not easy, as I have found that issues is with the flt.LinkTo(rtp) part, I am not sure what is going on here.

gst-launch-1.0 udpsrc port=5004 ! application/x-rtp,media=audio,payload=96,clock-rate=41000,depth=8,channels=2,signed=true,encoding-name=L24 ! rtpL24depay ! audioconvert ! autoaudiosink sync=false

This is where I started with testing this script, but translation it to media player as be low:   
 
Public bo As Boolean

Public Sub Form_Open()
 bo = True
End

Public Sub Play_Click()

 Dim pl As MediaPipeline
 Dim src, rtp, aco, als As MediaControl
 Dim flt As MediaFilter

 pl = New MediaPipeline
 src = New MediaControl(pl, "udpsrc")
 src["port"] = "5004"
 flt = New MediaFilter(pl, "application/x-rtp,media=audio,payload=96,clock-rate=41000,depth=8,channels=2,signed=true,encoding-name=L24")
 rtp = New MediaControl(pl, "rtpL24pay")
 aco = New MediaControl(pl, "audioconvert")
 als = New MediaControl(pl, "autoaudiosink")
 als["sync"] = "false"
 src.LinkTo(flt)
 flt.LinkTo(rtp)
 rtp.LinkTo(aco)
 aco.LinkTo(als)
 pl.Play()
 While bo
   'Write "\rTempo: " & Str(Time(0, 0, 0, pl.Position * 1000))
   TextBox1.Text = Str(Time(0, 0, 0, pl.Position * 1000))
   Wait 0.01
 Wend
 pl.Stop()
 pl.Close()
 Quit

End

Public Sub stop_Click()
  bo = False
End

Public Sub Form_Close()
  bo = False
End

Maybe I am missing something?
Online now: No Back to the top

Post

Posted
Rating:
#18
Regular
vuott is in the usergroup ‘Regular’
Try like this:

……
flt.<COLOR color="#800000">LinkLaterTo</COLOR>(rtp)
rtp.<COLOR color="#800000">LinkLaterTo</COLOR>(aco)
……

Europaeus sum !

<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Online now: No Back to the top

Post

Posted
Rating:
#19
Regular
GrantXTV is in the usergroup ‘Regular’
 Thanks, LinkLaterTo, has got me pass this point, but there is a new issue I get, that is:

** (URL_Player:719423): CRITICAL **: 10:20:16.200: gst_capsfilter_prepare_buf: assertion 'out_caps != NULL' failed

I have been looking around on the internet to see what this could be, but nothing so far, any ideas?
Online now: No Back to the top

Post

Posted
Rating:
#20
Regular
vuott is in the usergroup ‘Regular’
 Sorry, I don't know.
…but does the code work ?
Is it a simple warning or critical.. fatal error ?

Europaeus sum !

<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Online now: No Back to the top

Post

Posted
Rating:
#21
Regular
GrantXTV is in the usergroup ‘Regular’
 Hi Vuott,

I reworked the code for the UDP Receiver and that seemed to get it to work okay, there is one small issue with the UDP Transmitter, but it works well enough.

Here is the Transmitter:

Public bo As Boolean
Public pl As MediaPipeline

Public Sub Form_Open()
 bo = True
End

Public Sub send_Click()

 Dim src, aco, wen, snk, rtp, udp As MediaControl
 Dim flt As MediaFilter
 
 bo = True
 pl = New MediaPipeline
  
 src = New MediaControl(pl, "alsasrc")
 aco = New MediaControl(pl, "audioconvert")
 flt = New MediaFilter(pl, "audio/x-raw,rate=41000,depth=8,channels=2,signed=true")
 rtp = New MediaControl(pl, "rtpL24pay")
 udp = New MediaControl(pl, "udpsink")
 udp["host"] = "192.168.3.15"
 udp["port"] = "5004"
 
 src.LinkTo(aco)
 aco.LinkTo(flt)
 flt.LinkTo(rtp)
 rtp.LinkTo(udp)

 pl.Play()
 While bo
   TextBox1.Text = Str(Time(0, 0, 0, pl.Position * 1000))
   Wait 0.01
 Wend
End

Public Sub stop_Click()
 pl.Stop()
 bo = False
End

Public Sub Form_Close()
 pl.Stop()
 pl.Close()
 bo = False
End
 
Here is what works for the Receiver:

Public bo As Boolean
Public pl As MediaPipeline

Public Sub Form_Open()

 Dim src, rtp, aco, als As MediaControl
 Dim flt As MediaFilter

 pl = New MediaPipeline
 src = New MediaControl(pl, "udpsrc")
 src["port"] = "5004"
 flt = New MediaFilter(pl, "application/x-rtp,media=audio,payload=96,clock-rate=41000,depth=8,channels=2,signed=true,encoding-name=L24")
 rtp = New MediaControl(pl, "rtpL24depay")
 aco = New MediaControl(pl, "audioconvert")
 als = New MediaControl(pl, "autoaudiosink")
 als["sync"] = "false"

 src.LinkTo(flt)
 flt.LinkTo(rtp)
 rtp.LinkTo(aco)
 aco.LinkTo(als)
 pl.Pause
End

Public Sub Play_Click()
 pl.Play()
 bo = True
 While bo
   TextBox1.Text = Str(Time(0, 0, 0, pl.Position * 1000))
   Wait 0.01
 Wend
End

Public Sub stop_Click()
  pl.Pause()
  pl.Stop()
  bo = False
End

Public Sub Form_Close()
  pl.Stop()
  pl.Close()
  bo = False
End

With the UDP receiver I found that I needed to use a work around by using pause then stop, or the the software could crash.  

From this experimenting, I workout that the the MediaPlayer has four input / output states:
Hardware
File
IP / UDP
Jack Audio

The Jack Audio is something I may look at as well, at later date as could be useful, but the IP streaming is important one right now.
Online now: No Back to the top
1 guest and 0 members have just viewed this.