Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (121)
games submitted by our members
Games in WIP (577)
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 682 times)
0 Members and 1 Guest are viewing this topic.
Offline CyanPrime
« Posted 2013-03-13 19: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: 352
Projects: 3
Exp: 5 years


I'm the King!


« Reply #1 - Posted 2013-03-13 20: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 22: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!
Legends of Yore - The Casual Retro Roguelike
Offline sproingie

JGO Kernel


Medals: 202



« Reply #3 - Posted 2013-03-13 23: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 Duke


Medals: 9
Projects: 1
Exp: 2 years


No Games Finished


« Reply #4 - Posted 2013-03-13 23: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

JGO Kernel


Medals: 202



« Reply #5 - Posted 2013-03-13 23: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 Wizard


Medals: 99
Projects: 1
Exp: 7 years


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


« Reply #6 - Posted 2013-03-14 00: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 Knight


Medals: 27
Exp: 18 years


Computers can do that?


« Reply #7 - Posted 2013-03-14 09: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  
 
 
You cannot reply to this message, because it is very, very old.

 

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

The first screenshot will be displayed as a thumbnail.

theagentd (20 views)
2014-10-25 15:46:29

Longarmx (52 views)
2014-10-17 03:59:02

Norakomi (46 views)
2014-10-16 15:22:06

Norakomi (34 views)
2014-10-16 15:20:20

lcass (39 views)
2014-10-15 16:18:58

TehJavaDev (68 views)
2014-10-14 00:39:48

TehJavaDev (69 views)
2014-10-14 00:35:47

TehJavaDev (60 views)
2014-10-14 00:32:37

BurntPizza (74 views)
2014-10-11 23:24:42

BurntPizza (45 views)
2014-10-11 23:10:45
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
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!