Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - underplank

Pages: [1]
1
Network / Streaming Http
« on: December 20, 2010, 09:03:54 am »
The problem is not so much with how the audio streams work, its more to do with how sf::Http works. WHen you do a request ie

Page = Http.SendRequest(Request);

this blocks until it gets to the end of the Page, filling up the internal myBody string. I guess what I need to do is extend the http class to allow it to spit out a chunk of it at a time. Or just build on the sockets stuff..

2
Network / Streaming Http
« on: December 20, 2010, 08:51:15 am »
cheers for that.

The voip one seems to work at the sockets level. Is there one that works with sf::http? Its just that my radio station has all the http stuff in there, and while I could build on top of sockets to get to http, you guys have done such a great job it seems a shame not to use it..

Cheers

Mark

3
Network / Streaming Http
« on: December 20, 2010, 08:20:32 am »
Good point... I havent really asked a question have i? :(

What ive written:

Ive used the basic example in the sf::Http docs to connect to the streaming radio station url. This gets the data fine, but its blocking, which means I cant process the data to play.

So I think what I need to work out is how to use the sf:http class to connect to my streaming radio station and instead of just blocking and buffering the data, it needs to push it onto a vector or some such thing. This would mean in another thread I could pop the data of the other end of the vector and play the audio.

So My two questions are.

1. Does my theory about how to do this (I imagine im going to need locking as well) seem right?

2. How do I do this with the sf::Http class?

Cheers

Mark

4
Network / Streaming Http
« on: December 20, 2010, 06:05:04 am »
Hi All,

I've set up a streaming radio station using icecast. and I would like to use sfml to grab the stream and play it out. I know there is an intermediate problem here of the mp3 format but I think I can handle that with mpg123.

The thing that im having the problem with is how to connect to the URL and read the data from that url in chunks and append it to some kind of data structure so that I can read it in another thread.

At the moment when I use the Http class and do a Send.Request, if I try to get the body back then I get a massive string. I guess what I want to be able to do is read of a section of the string and push it onto another string, that can then be read by sf::SoundStream.OnGetData(). Im just having trouble working out how this all works.. its mentioned in the docs, but only in passing. and I havent been able to find some example code anywhere.

Could you help me out?

Pages: [1]
anything