Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (416)
games submitted by our members
Games in WIP (307)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  how many bytes I have to skip to be at the music payload in vorbis ogg files?  (Read 357 times)
0 Members and 1 Guest are viewing this topic.
Offline CyanPrime
« Posted 2013-03-13 20:30:27 »

I'm trying to generate levels in a game using the OGG music payload (as file bytes, not decoded) but I can't figure out how to calculate how many bytes I'd have to skip in a OGG file to get the music payload. also it'd be nice to get the length of the music payload in bytes as well.

Please forgive my terminology if it's incorrect.
Offline ra4king

JGO Kernel


Medals: 292
Projects: 2


I'm the King!


« Reply #1 - Posted 2013-03-13 21:18:18 »

The music is encoded, it's not raw audio data. You have to read the OGG spec.

Offline CyanPrime
« Reply #2 - Posted 2013-03-13 23:04:29 »

Right, but I'm not trying to decode the audio. I just want the array of encoded bytes.
Games published by our own members! Check 'em out!
Try the Free Demo of Revenge of the Titans
Offline sproingie
« Reply #3 - Posted 2013-03-14 00:32:03 »

I'm trying to generate levels in a game using the OGG music payload

Why on God's Green Earth would you store level data in an ogg container?
Offline Geemili

Senior Member


Medals: 3
Projects: 1


No Games Finished


« Reply #4 - Posted 2013-03-14 00:34:11 »

I would guess not to store the levels, but to let the player choose a piece of music that they want to generate a level with. Is that it?
Offline sproingie
« Reply #5 - Posted 2013-03-14 00:36:50 »

I can't imagine anything you could get out of audio data encoded in any format that would be appropriate for a level generator.  Maybe with some DSP work like beat detection or something, but certainly not raw bytes.  You may as well just use random seeds based on a hash of any file's contents in that case.
Offline ctomni231

JGO Knight


Medals: 28
Projects: 1


Not a glitch. Just have a lil' pixelexia...


« Reply #6 - Posted 2013-03-14 01:33:18 »

I can't imagine anything you could get out of audio data encoded in any format that would be appropriate for a level generator.  Maybe with some DSP work like beat detection or something, but certainly not raw bytes.  You may as well just use random seeds based on a hash of any file's contents in that case.

Yeah, I have to agree with this.

In this case you wouldn't even need to read it as an ogg file, but you would just read in the bytes until you get and EOF and generate the level from there. I don't see any real need to go into any extra work to read in the stream perfectly.
Offline delt0r

JGO Coder


Medals: 19


Computers can do that?


« Reply #7 - Posted 2013-03-14 10:53:10 »

And to top it all off. Ogg headers and Vorbis headers are not fixed length. So there is no such constant anyway.

I have no special talents. I am only passionately curious.--Albert Einstein
Pages: [1]
  ignore  |  Print  
 
 

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Get high quality music tracks for your game!

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
mrbenebob (16 views)
2013-06-19 14:55:23

BrassApparatus (25 views)
2013-06-19 08:52:37

NegativeZero (28 views)
2013-06-19 03:31:52

NegativeZero (31 views)
2013-06-19 03:24:09

Jesse_Attard (34 views)
2013-06-18 22:03:02

HeroesGraveDev (71 views)
2013-06-15 23:35:23

Vermeer (71 views)
2013-06-14 20:08:06

davedes (72 views)
2013-06-14 16:03:55

alaslipknot (64 views)
2013-06-13 07:56:31

Roquen (88 views)
2013-06-12 04:12:32
Smoothing Algorithm Question
by UprightPath
2013-05-28 02:58:26

Smoothing Algorithm Question
by UprightPath
2013-05-28 02:57:33

Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!