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 - Pikablu

Pages: [1]
1
DotNet / Re: Streaming music from web
« on: June 17, 2014, 11:33:33 pm »
Thanks! It would be really helpful for me. I'm aware that I can just download the entire file into memory first, but I'm working with fairly large files (200+ mb), so having users wait for the entire file to download before playing would be a pain.

2
DotNet / Re: Streaming music from web
« on: June 17, 2014, 10:24:26 pm »
CanSeek seems to be read-only for the stream.

Here's a stack trace of the exception:
   at System.Net.ConnectStream.get_Length()
   at SFML.Window.StreamAdaptor.GetSize(IntPtr userData)
   at SFML.Audio.Music.sfMusic_createFromStream(IntPtr stream)
   at SFML.Audio.Music..ctor(Stream stream)

It fails when getting the length of the stream. Taking a look at the ConnectStream class in .NET (which is what GetResponseStream() returns), it seems to always throw that exception.

3
DotNet / Streaming music from web
« on: June 17, 2014, 09:53:44 pm »
Are there any examples for streaming music from the web? I've been trying to just pass an HttpResponseStream into the standard Music class, but I end up with a NotSupportedException saying the stream doesn't support seek operations. I'm using a normal ogg file (http://upload.wikimedia.org/wikipedia/en/4/45/ACDC_-_Back_In_Black-sample.ogg).

Am I supposed to do it in some other way, or is it just not supported?

Thanks

Here's my code:

        static void Main(string[] args) {
            RenderWindow window = new RenderWindow(new VideoMode(800, 600), "SFML_App", Styles.Titlebar);

            HttpWebRequest request;

            request = (HttpWebRequest)WebRequest.Create("http://upload.wikimedia.org/wikipedia/en/4/45/ACDC_-_Back_In_Black-sample.ogg");
            Stream stream = request.GetResponse().GetResponseStream();

            SFML.Audio.Music music = new SFML.Audio.Music(stream);
            music.Play();

            while (window.IsOpen()) {
                window.DispatchEvents();
            }
        }

4
DotNet / Re: Problem with mouse + keyboard input
« on: December 07, 2013, 06:58:12 am »
Strange, I tried this on a few computers and it was the same on each one...

This is what I do:

1) Click on the screen. It registers the click properly
2) Start typing random letters non-stop
3) Left click on the screen while still typing... it doesn't register the click
4) Right click on the screen while still typing, everything works fine
5) Stop typing, then I need to double click with the left mouse button before it displays the message again

5
DotNet / Problem with mouse + keyboard input
« on: December 07, 2013, 12:24:07 am »
Hey everyone,

I've been playing around with the .net binding for a while now, and I've come into a small problem with handling keyboard and mouse input at the same time. In what I've tried, whenever I type something and click on the window at the same time with the left mouse button, the click is ignored until I stop typing. However, typing and clicking with any other button will handle the clicks properly.

Here's an example which has the same effect (using sfml 2.1):

 
        static void Main(string[] args) {
            RenderWindow window = new RenderWindow(new VideoMode(800, 600), "SFML_App", Styles.Titlebar);

            window.MouseButtonPressed += window_MouseButtonPressed;

            while (window.IsOpen()) {
                window.DispatchEvents();
            }
        }

        static void window_MouseButtonPressed(object sender, MouseButtonEventArgs e) {
            Console.WriteLine("Clicked: " + System.Environment.TickCount);
        }
 

Any ideas?

Pages: [1]