Hi Folks, FWIW I figured out the /etc/magic file entries for both native and Ogg wrappered Speex, Vorbis and FLAC (attached). YMMV because the fields aren't necessarily in fixed positions in the files, but it works fine for me. Feel free to include it in the Xiph archives or forward it to the /etc/magic file maintainer once you're satisfied with it. John -------------- next part -------------- #------------------------------------------------------------------------------ # xiph: file(1) magic for Xiph multi-media files # # # Ogg wrappered formats: Speex, Vorbis and FLAC. # 0 string OggS Xiph Ogg>28 string Speex\020\020\020 \bSpeex audio >>68 lelong =0 \b, narrowband >>68 lelong =1 \b, wideband >>68 lelong =2 \b, ultra-wideband >>76 lelong >0 \b, %d channel(s) >>64 lelong >0 %d Hz >28 string \001vorbis \bVorbis audio >>39 byte =1 \b, mono >>39 byte =2 \b, stereo >>39 byte =3 \b, 3 channels >>39 byte =4 \b, quad >>39 byte >4 \b, %d channels >>40 lelong >0 %d Hz >28 string fLaC \bFLAC audio >>92 belong&0x0001f000 =12288 \b, 4 bit >>92 belong&0x0001f000 =28672 \b, 8 bit >>92 belong&0x0001f000 =61440 \b, 16 bit >>92 beshort&0x000e =0 \b, mono >>92 beshort&0x000e =2 \b, stereo >>92 beshort&0x000e =4 \b, 3 channels >>92 beshort&0x000e =6 \b, quad >>92 beshort&0x000e =8 \b, 5 channels >>92 beshort&0x000e =10 \b, 6 channels >>92 beshort&0x000e =12 \b, 7 channels >>92 beshort&0x000e =14 \b, 8 channels >>90 belong&0x00fffff0 =705600 44100 Hz >>90 belong&0x00fffff0 =512000 32000 Hz >>90 belong&0x00fffff0 =328000 22050 Hz >>90 belong&0x00fffff0 =256000 16000 Hz >>90 belong&0x00fffff0 =128000 8000 Hz# # Speex native format. # 0 string Speex\020\020\020 Native Speex audio>40 lelong =0 \b, narrowband >40 lelong =1 \b, wideband >40 lelong =2 \b, ultra-wideband >48 lelong >0 \b, %d channel(s) >36 lelong >0 %d Hz# # Vorbis native format. # 0 string \001vorbis Native Vorbis audio>11 byte =1 \b, mono >11 byte =2 \b, stereo >11 byte =3 \b, 3 channels >11 byte =4 \b, quad >11 byte >4 \b, %d channels >12 lelong >0 %d Hz# # FLAC native format. # 0 string fLaC Native FLAC audio>18 belong&0x000001f0 =48 \b, 4 bit >18 belong&0x000001f0 =112 \b, 8 bit >18 belong&0x000001f0 =240 \b, 16 bit >18 belong&0x00000e00 =0 \b, mono >18 belong&0x00000e00 =512 \b, stereo >18 belong&0x00000e00 =1024 \b, 3 channels >18 belong&0x00000e00 =1536 \b, quad >18 belong&0x00000e00 =2048 \b, 5 channels >18 belong&0x00000e00 =2560 \b, 6 channels >18 belong&0x00000e00 =3072 \b, 7 channels >18 belong&0x00000e00 =3584 \b, 8 channels >18 belong&0xfffff000 =180633600 44100 Hz >18 belong&0xfffff000 =131072000 32000 Hz >18 belong&0xfffff000 =90316800 22050 Hz >18 belong&0xfffff000 =65536000 16000 Hz >18 belong&0xfffff000 =32768000 8000 Hz
J C Fitzgerald wrote on 2003-07-16:> Hi Folks, > > FWIW I figured out the /etc/magic file entries for both native and Ogg > wrappered Speex, Vorbis and FLAC (attached). YMMV because the fields > aren't necessarily in fixed positions in the files, but it works fine > for me. Feel free to include it in the Xiph archives or forward it to > the /etc/magic file maintainer once you're satisfied with it. >There is already a detailed Vorbis entry, distributed with the latest file(1) versions. There are no Flac and Speex entries, thanks for the effort. I just wonder what is "Native Vorbis" and "Native Speex"? It seems that you are detecting standalone Vorbis/Speex packets with no wrapper whatsoever. The problem is that such a thing is undecodable - you need some way to mark the packet boundaries. So no such beasts exist. Flac does exist outside of Ogg but it uses its own framing then. -- Beni Cherniavsky <cben@tx.technion.ac.il> If I don't hack on it, who will? And if I don't GPL it, what am I? And if it itches, why not now? [With apologies to Hilel ;] --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
>I just wonder what is "Native Vorbis" and "Native Speex"? >It seems that you are detecting standalone Vorbis/Speex packets with >no wrapper whatsoever. The problem is that such a thing is >undecodable - you need some way to mark the packet boundaries. So no >such beasts exist. Flac does exist outside of Ogg but it uses its own >framing then.That is not correct. A "raw/native" FLAC file has no additional framing information. Simply removing the Ogg page headers from an Ogg/FLAC file would certainly produce a decodeable FLAC file. I'm not sure about Speex, but at least for Vorbis, it would certainly be possible to decode such a file. Seeking would be a little bit difficult, but still very much possible. Tor <p><p><p>==================================================================EASY and FREE access to your email anywhere: http://Mailreader.com/ ================================================================== <p>--- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
>Then FLAC has duplicate framing information when encapsulated in Ogg. >You can determine where a packet ends from the packet itself.Yes, the decoder knows when a packet is finished and the next packet will begin on the next boundary. Except from that, there are no additional framing informatioon in a raw FLAC file.>I'm not >sure about Speex but I'm pretty sure that Vorbis packets are not >self-sized. If not, how come simply trimming (non-header) Vorbis >packets is supposed to produce a legal Vorbis file? Quoting the spec: >"Vorbis provides none of its own framing, synchronization or >protection against errors".In theory, it is possible to decode an incomplete Vorbis packet and still render some sort of audio output. In a Vorbis packet, the order of information is sorted according to importance, so if the last part of a Vorbis packet is missing, the decoder could be (according to the spec probably should be) able to produce audio output with minial distortion. In the normal case (and I am quite sure, that the common players would fail playing a properly Ogg-framed Vorbis stream with incomplete packets), the packets are complete and the decoder is able to determine the end of a packet without relying on the Ogg framing. Tor <p><p><p>==================================================================EASY and FREE access to your email anywhere: http://Mailreader.com/ ================================================================== <p>--- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Fredag, 18 juli 2003, skrev du:>PS. During the course of my experiments I came up with the following >one-liner for stripping the Ogg layer (and I can confirm that it >produces valid FLAC files from ogg-flacs): > >perl -0777lpe'BEGIN{$/="OggS"}s/.{22}(.)//s,s/.{@{[ord$1]}}//s'And this will only work as long as each Ogg page only contains one FLAC packet (this is how flacend currently operates, but it does not necessarily have to be so). Tor <p><p><p><p>==================================================================EASY and FREE access to your email anywhere: http://Mailreader.com/ ================================================================== <p>--- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.