HydrogenAudio

Lossy Audio Compression => Ogg Vorbis => Ogg Vorbis - Tech => Topic started by: leggendario on 2006-10-29 15:35:58

Title: HELP! Edit an ogg header
Post by: leggendario on 2006-10-29 15:35:58
Hi! I need your help... i should change the length of an ogg file: for example, i have a 3:30 ogg file, but it should be only 2:20 for winamp or windows media player... what i should exactly change in the hex editor?

I can only use an hex editor... i hope you'll help me 
Title: HELP! Edit an ogg header
Post by: leggendario on 2006-11-05 11:54:30
Help me, i need some info about it...
Title: HELP! Edit an ogg header
Post by: Gambit on 2006-11-05 14:03:33
You can read the Vorbis docs, for complete header parsing info.

If you want to do it the easy way: The length value is stored in Samples, so you can convert that to hex and search for the value. It should be just a few bytes behind the "OggS" string.
Title: HELP! Edit an ogg header
Post by: leggendario on 2006-11-05 17:59:56
You can read the Vorbis docs, for complete header parsing info.

If you want to do it the easy way: The length value is stored in Samples, so you can convert that to hex and search for the value. It should be just a few bytes behind the "OggS" string.


I need a method without using .dlls, but only using files .ogg and an hex editor...

Which bytes exactly? I'm really noob about it...
Title: HELP! Edit an ogg header
Post by: kjoonlee on 2006-11-05 18:09:20
Why do you need to do it?

I don't know enough about the fileformat to offer real advice, but I'd be worried about changing values in Ogg files.

If you want, you can just truncate the file somewhere in the middle (as if "the download had been canceled," if you get what I mean) to shorten the playtime. I'm sure there are hex editors that can do that.
Title: HELP! Edit an ogg header
Post by: Gambit on 2006-11-05 18:16:34

You can read the Vorbis docs, for complete header parsing info.

If you want to do it the easy way: The length value is stored in Samples, so you can convert that to hex and search for the value. It should be just a few bytes behind the "OggS" string.


I need a method without using .dlls, but only using files .ogg and an hex editor...

Which bytes exactly? I'm really noob about it...

What DLL, genius?

You take the samples length (foobar -> Properties, for example 3:30 would be 9261000 samples) convert the decimal value to hex(8D4FC8), reverse byte order (C84F8D), search for the value, edit, save. That's it.

I don't know what you hope to achieve by that, but if you don't know what you're doing, you better leave it like it is.