Hello everybody, I'm developing the www.polyxmass.org (GNU polyxmass) program that is a polymer sequence editor (a polymer is a thread made of concatenated monomers). I would like to code a "self-speak-out" feature for that sequence editor: the user would select a sequence region and ask that the program would "dictate" the sequence. For example, the following could be a DNA sequence: "ATGCTTCTGGGCTTGCG". The user can define that: - for monomer letter 'A', the ogg sound file "adenine.ogg" should be used to vocalize it; - for monomer 'G', the sound file "guanine.ogg" should be used, and so on... Now, this is how the program could vocalize the sequence "ATGCTTCTGGGCTTGCG": 0. Let the user define an output file (ogg file) where all the sounds are sent to (say "gene.ogg"); 1. Prepare all the sounds: for each __different__ monomer in the polymer ('A', 'T', 'G', 'C'), read its corresponding ogg file (adenine.ogg for 'A'... see above) and put the contents of that ogg file into an allocated char * string in memory; 2. Now that all the monomers in the sequence have their corresponding sound data in allocated gchar * strings, we can parse the sequence and for each parsed monomer fwrite () the contents of the corresponding ogg sound gchar * string to the gene.ogg file (see 0). 3. At the end of the parsing of the sequence, we'll have a "gene.ogg" file that is acutally a concatenation of the contents of the sound files corresponding to the sequence "ATGCTTCTGGGCTTGCG". Note that, to ease the "self-speak" hearing, the user might configure the system to intercalate "silent sound" ("silent sound" file created using the Audacity utility) between the contents of monomer sounds. Basically this should work because I've read in a number of places that ogg files are "concatenable"... However, I have noticed this using ogginfo on the gene.ogg file: New logical stream (#4, serial: 2553ab11): type vorbis Vorbis headers parsed for stream 4, information follows... Version: 0 Vendor: Xiph.Org libVorbis I 20030909 (1.0.1) Channels: 1 Rate: 44100 Nominal bitrate: 96.001000 kb/s Upper bitrate not set Lower bitrate not set Vorbis stream 4: Total data length: 10644 bytes Playback length: 0m:01.011s Average bitrate: 84.206821 kbps Logical stream 4 ended ~~~~~~~~~~~ piece of interest below ~~~~~~~~~~~~~~~ Warning: illegally placed page(s) for logical stream 3 This indicates a corrupt ogg file: Page found for stream after EOS flag. Warning: sequence number gap in stream 3. Got page 1 when expecting page 6. Indicates missing data. New logical stream (#5, serial: 70c4bd08): type vorbis Vorbis headers parsed for stream 5, information follows... ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ It seems that the concatenation of by-themselves-correct files does not always succeed. Can somebody point me to some example of such concatenation of many in-memory gchar * ogg data into a single ogg file ? Sorry for this long message, Thank you for your kind help, Filippo -- -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://lists.xiph.org/pipermail/vorbis/attachments/20041001/70557067/attachment.pgp
> It seems that the concatenation of by-themselves-correct files does > not always succeed.Indeed. You probably have repeating letters in your sequence, which will result in the same file being appended twice. That's not good. Each logical ogg stream has a (usually randomly generated) serial number that identifies it. For a chain of logical streams inside a physical stream, the serial number must differ between the links of the chain. This requirement is violated when you tack on the same file twice in a row. The correct way to do this is to rewrite the serial numbers on the fly to give each link a unique serial number. (Don't ask me how to do that, though :) -Carsten
to work around the same serial number in chained ogg stream you could do something like this: http://svn.xiph.org/trunk/py-ogg2/examples/reserializer.py but since you repeat the same 4 ogg sequences all the time, would it not be better to just create a playlist(m3u)? j On Fri, 2004-10-01 at 22:37 +0200, Filippo Rusconi wrote:> Hello everybody, > > > I'm developing the www.polyxmass.org (GNU polyxmass) program that is a > polymer sequence editor (a polymer is a thread made of concatenated > monomers). > > I would like to code a "self-speak-out" feature for that sequence > editor: the user would select a sequence region and ask that the > program would "dictate" the sequence. > > For example, the following could be a DNA sequence: > > "ATGCTTCTGGGCTTGCG". > > The user can define that: > > - for monomer letter 'A', the ogg sound file "adenine.ogg" should be > used to vocalize it; > > - for monomer 'G', the sound file "guanine.ogg" should be used, and so > on... > > Now, this is how the program could vocalize the sequence > "ATGCTTCTGGGCTTGCG": > > 0. Let the user define an output file (ogg file) where all the sounds > are sent to (say "gene.ogg"); > > 1. Prepare all the sounds: for each __different__ monomer in the > polymer ('A', 'T', 'G', 'C'), read its corresponding ogg file > (adenine.ogg for 'A'... see above) and put the contents of that ogg > file into an allocated char * string in memory; > > 2. Now that all the monomers in the sequence have their corresponding > sound data in allocated gchar * strings, we can parse the sequence > and for each parsed monomer fwrite () the contents of the > corresponding ogg sound gchar * string to the gene.ogg file (see > 0). > > 3. At the end of the parsing of the sequence, we'll have a "gene.ogg" > file that is acutally a concatenation of the contents of the sound > files corresponding to the sequence "ATGCTTCTGGGCTTGCG". > > Note that, to ease the "self-speak" hearing, the user might configure > the system to intercalate "silent sound" ("silent sound" file created > using the Audacity utility) between the contents of monomer sounds. > > Basically this should work because I've read in a number of places > that ogg files are "concatenable"... > > > However, I have noticed this using ogginfo on the gene.ogg file: > > New logical stream (#4, serial: 2553ab11): type vorbis > Vorbis headers parsed for stream 4, information follows... > Version: 0 > Vendor: Xiph.Org libVorbis I 20030909 (1.0.1) > Channels: 1 > Rate: 44100 > > Nominal bitrate: 96.001000 kb/s > Upper bitrate not set > Lower bitrate not set > Vorbis stream 4: > Total data length: 10644 bytes > Playback length: 0m:01.011s > Average bitrate: 84.206821 kbps > Logical stream 4 ended > > ~~~~~~~~~~~ piece of interest below ~~~~~~~~~~~~~~~ > > Warning: illegally placed page(s) for logical stream 3 > This indicates a corrupt ogg file: Page found for stream after EOS flag. > Warning: sequence number gap in stream 3. Got page 1 when expecting > page 6. > Indicates missing data. > New logical stream (#5, serial: 70c4bd08): type vorbis > Vorbis headers parsed for stream 5, information follows... > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > It seems that the concatenation of by-themselves-correct files does > not always succeed. > > Can somebody point me to some example of such concatenation of many > in-memory gchar * ogg data into a single ogg file ? > > Sorry for this long message, > > Thank you for your kind help, > > Filippo > > > _______________________________________________ > Vorbis mailing list > Vorbis@xiph.org > http://lists.xiph.org/mailman/listinfo/vorbis
Maybe Matching Threads
- Search list of elements for a specific pattern
- Compiling R-1.3.0-patched on OSF1
- Help with glmer {lme4) function: how to return F or t statistics instead of z statistics.
- Delivery Report (failure) for polymer@taiwan.com
- Help with glmer {lme4} function: how to return F or t statistics instead of z statistics?