Heya people, Does anyone know if cross-fading has been successfully implemented in Vorbis? I need to implement it in a project I'm working on and if it's already been done, a finger pointing in the right direction would be awesome. Thanks, Ian <p><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-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.
On Fri, 2003-11-28 at 12:25, Ian Rutherford wrote:> Does anyone know if cross-fading has been successfully implemented in > Vorbis? I need to implement it in a project I¢m working on and if it¢s > already been done, a finger pointing in the right direction would be > awesome.A vaguely related feature is provided by ov_crosslap(). Quoting from the docs: "ov_crosslap overlaps and blends the boundary at a transition between two seperate streams represented by seperate [1]OggVorbis_File structures. For lapping transitions due to seeking within a single stream represented by a single [2]OggVorbis_File structure, consider using the lapping versions of the [3]vorbisfile seeking functions instead." (Until I pasted that into my email program, I never noticed that "seperate" was misspelled...) Anyway, crosslap does not do the sort of volume fading that a crossfade implementation would do, but I thought I'd point out the feature in case you find it related to your needs. --- Stan Seibert <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-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.
On Sat, Nov 29, 2003 at 04:25:32AM +1000, Ian Rutherford wrote:> Does anyone know if cross-fading has been successfully implemented in > Vorbis? I need to implement it in a project I'm working on and if it's > already been done, a finger pointing in the right direction would be > awesome.You don't really do cross-fading with a codec stream, you do it with the decoded audio... One good crossfade formula (amplitude multiplier) is: Aa(t) = (1+cos(t*pi))/2 Ab(t) = 1-Aa(t) = (1+cos((1-t)*pi))/2 where t goes from 0 to 1 through the fade, and pi is the ratio of the circumference of a circle to its diameter. Aa is the value to multiply the outgoing audio with, and Ab is the value to multiply the incoming audio with. Useful properties of this formula: * At all points, Aa(t)+Ab(t) = 1 * The two fade curves are mirror images of one another. * The curves asymptotically approach and depart from 0 and 1. Linear fades can sound unnatural. If you want a quicker fade up: Ab(t) = (1+cos((1-x)*(1-x)*pi))/2 Aa(t) = 1 - Ab(t) -- Paul Martin <pm@zetnet.net> (work) <pm@nowster.zetnet.co.uk> (home) --- >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-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.