The invention will be better understood by reference to the following description taken in conjunction with the accompanying drawings.
Reference will now be made in detail to a preferred embodiment of the invention. An example of the preferred embodiment is illustrated in the accompanying drawings. While the invention will be described in conjunction with a preferred embodiment, it will be understood that it is not intended to limit the invention to one preferred embodiment. To the contrary, it is intended to cover alternatives, modifications, and equivalents as may be included within the spirit and scope of the invention as defined by the appended claims.
With the rapid advancement in the ability to store data, multimedia asset players can accommodate hundreds or even thousands of digital media files, such as audio files, providing a user the ability to create customized albums. With the availability of such a large number of multimedia files it has become very popular to create custom “albums” by placing selected digital audio files in a pre-selected order and performing what is referred to as a butt splice. A butt splice is the abrupt connection of one audio file to another audio file so that they become one continuous audio file (along the lines of concept albums such as “Dark Side of the Moon”), which can then, for example, be burned onto a playable storage medium such as a CD. Unfortunately, however, there are a number of scenarios where a butt splice of two files will in all likelihood result in an audible distortion (such as a click or a pop) due to a discontinuity at the transition point. Such discontinuities can have many sources, including butt splicing lossy compressed media files (such as MP3 files) having a number of non-audio files at the beginning and ending of the file, or butt splicing audio files from different origins that do not sonically match at the transition point, etc. Therefore, the invention provides for distortion free stitching of digital files of any format or origin.
In one embodiment, first (track A) and second (track B) digital audio tracks are retrieved and placed in a play order {A:B} by which it is meant that the last audio content of the track A will be expressed immediately followed in time by the first audio samples of the track B without any noticeable pause. As part of the inventive process, the direction of the track A and the track B is determined in a transition zone based upon a last audio sample of the track A and the first audio sample of the track B. The transition zone typically ranges from about 10 msec prior to the end of track A to about 10 ms from the beginning of track B. Once the directions of the tracks have been determined in the transition zone, a determination of a difference value (referred to as a delta (δ)) is made between the last audio sample of the track A and the first audio sample of the track B.
In the described embodiment, the delta (δ) is based upon a fractional change (where fractional change=absolute value((B−A)/A) where B is value of the first sample of track B and A is value of the last sample of track A) between the respective values of the track A last audio sample and the track B first audio sample. However, in certain cases such as when the direction of either of the tracks is flat (i.e., neither upward nor downward going), or either the last audio sample of the track A or the first audio sample of the track B has a zero value, the fractional approach would render a meaningless result. In these situations, the invention provides for determining an absolute value difference of the first and last respective audio samples. In any case, the invention provides for stitching the track A and the track B, or not, based upon a pre-determined relationship between the directions of track A and track B and the associated delta value. For example, if the direction of the track A and the direction of the track B are substantially the same and the associated delta value is approximately zero, then no stitching is performed. However, if the directions do not match (i.e., one is upward going and the other is downward going, or vice versa), and the associated delta value is greater than or equal to a first pre-determined value, then a stitching operation is performed. In a particularly useful embodiment, the stitching operation is a linear cross fade operation well known to those skilled in the art. In this way, the tracks A and B are stitched together resulting in an audibly smooth transition between the two tracks (i.e., without a noticeable audio distortion at the junction of the two tracks).
More specifically, if the directions of Track A and Track B are the same and (δ) is less than 0.5 then no stitching operation is performed. However, if the directions of Track A and Track B are different and if there and the endpoints are not zero and (δ) is less than 0.3 then there is also no stitching. However if there are zeros, and the absolute difference of (B−A) is less than or equal to 0.25 then no stitching is performed, otherwise stitching is performed. It should be noted that there is a special check for a “zeros” case where, if the direction of both Track A and Track B are flat and the values are approximately zero, no stitching is performed (it should be noted that “approximately zero” is defined as the absolute amplitude of the sample value<=2/32768. Since 16-bit audio has 65536 steps of precision this allows values within +/−2 steps to be treated as “0”).
Returning to
In some situations, other stitching operations can be performed in addition to the linear cross fade. For example, if the directions match and the associated delta value is greater than a pre-determined threshold value (see
While this invention has been described in terms of a preferred embodiment, there are alterations, permutations, and equivalents that fall within the scope of this invention. It should also be noted that there are many alternative ways of implementing both the process and apparatus of the present invention. It is therefore intended that the invention be interpreted as including all such alterations, permutations, and equivalents as fall within the true spirit and scope of the present invention.