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

Author Topic: Scrambled OGG  (Read 2627 times)

0 Members and 1 Guest are viewing this topic.

Sui

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
    • http://www.suisoft.co.uk/
Scrambled OGG
« on: April 02, 2012, 12:28:35 pm »
The license for the music I have in my game requires that I distribute the music in a scrambled form (i.e. not in standard OGG format).

Currently, in development, I am streaming OGG files for the music.

I need to use a scrambled file format to provide basic protection for the copyright of the music.

I can scramble and unscramble data no problem, as I have done this on prior (non SFML) projects. My question is, can I use the streaming functionality to play a non-standard file format, for example by unscrambling the data on the fly via a custom stream?

Alternatively, I can unscramble the OGG data into memory and play it from there. This would prevent streaming from disk - I would have to leave the Virtual Memory Manager to retrieve the data from disk pre-emptively if swapping occurs (not sure how well this would work in practice).

Hope this makes sense...

Thanks in advance.
Gary Marples, Developer of games and other stuff.
www.suisoft.co.uk/games/BlogTwitter

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Scrambled OGG
« Reply #1 on: April 02, 2012, 01:27:09 pm »
Quote
My question is, can I use the streaming functionality to play a non-standard file format, for example by unscrambling the data on the fly via a custom stream?
It should work, yes. If your custom sf::InputStream provides data as an unscrambled OGG file (rather than decoded audio samples) you should even be able to use it with a sf::Music, ie. no need to write your own sf::AudioStream.
Laurent Gomila - SFML developer

Sui

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
    • http://www.suisoft.co.uk/
Re: Scrambled OGG
« Reply #2 on: April 02, 2012, 03:32:42 pm »
Thanks Laurent.
I'll have a play with the streams.
Gary Marples, Developer of games and other stuff.
www.suisoft.co.uk/games/BlogTwitter