Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2015-03

Internet audio streaming ?

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

fredvs

Hello.

I have some problem with audio internet streaming. I would like to do it with mpg123 + portaudio libraries but...

Here is the procedure used by mpg123 =>
mpg123_open_fd = function( mh:Tmpg123_handle; fd: Integer).

I have sent to mpg123-forum that question =>

Show quoted text 7 lines
Hello and congratulation for your superb library. In your doc you say that, for use of internet streaming, it is better to use mpg123_open_fd = function( mh: Tmpg123_handle; fd: Integer). OK but i do not understand what is fd parameter. Is it the ip address ? Because it is type of integer. ??? Many thanks

Here their answer =>

The parameter is a file descriptor you obtained from opening the HTTP connection yourself. There is no HTTP code in libmpg123 itself.

Hum, how can i obtain such of file descriptor ?
And how to open a HTTP connection ?
There is a new feature in fpc 3.x.x => a http client. Could it do the job ?

PS: I have the fpc headers for mpg123 and portaudio libraries. There are working perfectly with fpc => can play "local" *.mp3 without problem.

Thanks.

Fre;D

-----
Many thanks ;-)

View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Internet-audio-streaming-tp5721358.html Sent from the Free Pascal - General mailing list .
fredvs
to fredvs

Hello everybody and thanks for so much answers.

By the way, Andrew Haines explained how to do.

1) - Use fpPipe in BaseUnix/Unix to create a fifo.
2) - Create a THandleStream using the returned input value of fpPipe.
3) - Use mpg123_open_fd from the output value from fpPipe
4) - Use an instance of TfpHttpClient.Get(YourURL, AHandleStream) to retrieve the stream.

And... it works ;-)

Many, many thanks to Andrew.

PS:Andrew has done a excellent work with his PulseAudio wrapper => https://github.com/andrewd207/fpc-pulseaudio

Fre;D.

-----
Many thanks ;-)

View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Internet-audio-streaming-tp5721358p5721415.html Sent from the Free Pascal - General mailing list .
fredvs
to Andrew Haines

Hello Andrew.

I am very interested by your PulseAudio bindings.

Hum, how many dependencies has PulseAudio ?
Could it be possible (like for PortAudio) to only dynamically load pulseaudio.so library ?
Or does PulseAudio need to be installed because of too many dependencies ?

Is PulseAudio usable for other systems than Linux ?

Many thanks.

Fre;D

-----
Many thanks ;-)

View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Internet-audio-streaming-tp5721358p5721418.html Sent from the Free Pascal - General mailing list .