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

Author Topic: stream from dlna server  (Read 2551 times)

0 Members and 1 Guest are viewing this topic.

nesc

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
stream from dlna server
« on: May 22, 2014, 08:20:04 pm »
Hi All,

Is it possible to play music files from http server like dlna server withou downloading the file to our side, example:

...
<res duration="0:03:21.000" size="5112074" protocolInfo="http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;...>http://192.168.1.7:3001/dlna/some.mp3</res>
...

we got the url and the total size of the file, how can we read this, we need to use the sf::Music::openFromStream right, but what about the input stream object how to do this? is there any class that already does this or we have to implement it from the sf::InputStream? if we have to implement it can you suggest on how to do it or point me to some example code.

Note i do not want to download the file into the file system of the client, if possible i want to read it without saving it in the system file. Is this possible?

Thanks

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: stream from dlna server
« Reply #1 on: May 22, 2014, 08:47:20 pm »
You'll have to imlement it yourself. However I don't know if you'll be able to use the sf::Http class, it's probably too limited for this use case.
Laurent Gomila - SFML developer

nesc

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: stream from dlna server
« Reply #2 on: May 23, 2014, 10:51:15 am »
do you have any idea on how to do it?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: stream from dlna server
« Reply #3 on: May 23, 2014, 10:56:51 am »
Challenge a) is to get the stream. I doubt it will work with sf::Http, but you could use sockets - shouldn't be too hard, just read the content bit by bit and provide stream interface, i.e. implement the sf::InputStream interface.
Challenge b) will be decoding the MP3, because SFML doesn't support MP3 because of licensing issues.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything