CN101131816B - Audio file generation method, device and digital player - Google Patents

Audio file generation method, device and digital player Download PDF

Info

Publication number
CN101131816B
CN101131816B CN2007101810415A CN200710181041A CN101131816B CN 101131816 B CN101131816 B CN 101131816B CN 2007101810415 A CN2007101810415 A CN 2007101810415A CN 200710181041 A CN200710181041 A CN 200710181041A CN 101131816 B CN101131816 B CN 101131816B
Authority
CN
China
Prior art keywords
voice data
original singer
piece
audio
sound accompaniment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN2007101810415A
Other languages
Chinese (zh)
Other versions
CN101131816A (en
Inventor
李匡匡
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Actions Semiconductor Co Ltd
Original Assignee
Actions Semiconductor Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Actions Semiconductor Co Ltd filed Critical Actions Semiconductor Co Ltd
Priority to CN2007101810415A priority Critical patent/CN101131816B/en
Publication of CN101131816A publication Critical patent/CN101131816A/en
Application granted granted Critical
Publication of CN101131816B publication Critical patent/CN101131816B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

This invention is applicable for information technology field, it provides a kind of audio frequency producing method, device and number player, this method includes the following steps: read the preset former sound audio frequency data which is in the same size of the former sound audio frequency block from the former sound audio frequency data, and read it in the audio frequency file; read the preset accompanying sound audio frequency data which is in the same size of the accompanying sound audio frequency block from the accompanying sound audio frequency data, and read it in the audio frequency file, the play time of the former sound block audio frequency data and the accompanying sound audio frequency data is the same; cycle executes the steps mentioned above, until both the former sound block audio frequency data and the accompanying sound audio frequency data are read in the audio frequency file which containing data from two tracks. In the implement case of this invention, to realize the image and void accompany function of the number player by producing a kind of audio frequency file storied the former sound block audio frequency data and the accompanying sound audio frequency data alternately, so it has good image and void accompany effect.

Description

A kind of audio file generation method, device and digital code player
Technical field
The invention belongs to areas of information technology, relate in particular to a kind of audio file the generation method, install and have the digital code player of audio-visual vocal accompaniment function.
Background technology
At present, audio-visual vocal accompaniment (Karaoke) has become one of key activities of consumer entertainment leisure, various audio-visual accompanying videos occurred and with the household electrical appliance of audio-visual vocal accompaniment function.Audio-visual vocal accompaniment electroacoustic techniques and product be comparative maturity all, but designs for satisfying fixing use in family or public place of entertainment mostly, and volume ratio is huger; And price is more expensive relatively; Therefore the digital code player of audio-visual vocal accompaniment function occurred realizing, its advantages of small volume is easy to carry.
Prior art is through eliminating the voice data in original singer's voice data, and the voice data of the voice data of having eliminated voice data and user's input is carried out aliasing, the audio-visual vocal accompaniment function of realization digital code player.When adopting this mode to realize audio-visual vocal accompaniment,, can't voice data thoroughly be eliminated, thereby influence the effect of accompanying owing to when eliminating the voice data in original singer's voice data, limit by technology.
Prior art also through with original singer's voice data and sound accompaniment voice data respectively as different sound channels, promptly download separable audio data sources, in the time of need carrying out audio-visual vocal accompaniment, shield original singer's voice data broadcast sound channel, can realize audio-visual vocal accompaniment effect.Its weak point is, can only export monophony, plays when having stereosonic original singer's voice data, and effect is relatively poor.
Summary of the invention
The purpose of the embodiment of the invention is to provide a kind of method that on digital code player, realizes audio-visual vocal accompaniment; Be intended to solve prior art when realizing the audio-visual vocal accompaniment of digital code player; When perhaps shielding through the sound in original singer's voice data is eliminated; The effect that sound is eliminated or shielded is relatively poor, and the relatively poor problem of audio-visual vocal accompaniment effect of the digital code player that causes.
The embodiment of the invention is achieved in that a kind of generation method of audio file, and said method comprises the steps:
From original singer's voice data, read original singer's piece voice data of preset original singer's audio block size, and said original singer's piece voice data is write audio file;
From the sound accompaniment voice data, read the sound accompaniment piece voice data of preset sound accompaniment audio block size, and said sound accompaniment piece voice data is write audio file, the reproduction time of said original singer's piece voice data is identical with the reproduction time of said sound accompaniment piece voice data;
Above-mentioned steps is carried out in circulation, all writes said audio file until said original singer's voice data and said sound accompaniment voice data, and said audio file comprises the data of two sound channels.
Another purpose of the embodiment of the invention is to provide a kind of generating apparatus of audio file, and said device comprises:
Original singer's voice data read module is used for reading the big or small original singer's piece voice data of preset original singer's audio block from original singer's voice data;
Original singer's voice data writing module is used for said original singer's piece voice data is write audio file;
Sound accompaniment voice data read module is used for reading the big or small sound accompaniment piece voice data of preset sound accompaniment audio block from the sound accompaniment voice data, and the reproduction time of said original singer's piece voice data is identical with the reproduction time of said sound accompaniment piece voice data;
Sound accompaniment voice data writing module is used for said sound accompaniment piece voice data is write audio file;
Voice data reads and writes control module; Be used to control said original singer's voice data read module, original singer's voice data writing module, sound accompaniment voice data read module and sound accompaniment voice data writing module; Periodic duty; Make the original singer's piece voice data and the alternately storage of sound accompaniment piece voice data that write in the said audio file, said audio file comprises the data of two sound channels.
Another purpose of embodiment is to provide a kind of method that on digital code player, realizes audio-visual vocal accompaniment, and said method comprises the steps:
With original singer's voice data and the synthetic original singer's piece voice data of alternately storage and the audio file of sound accompaniment piece voice data of comprising of sound accompaniment voice data, said audio file comprises the data of two sound channels;
Receive the vocal accompaniment playing request, read the sound accompaniment piece voice data in the said audio file;
Gather the voice data of user's input;
With said sound accompaniment piece voice data and said voice data Composite tone data;
Play said voice data after synthetic.
Another purpose of embodiment is to provide a kind of digital code player, and said digital code player comprises:
The audio files storage device; Be used to store the original singer's piece voice data that comprises alternately storage and the audio file of sound accompaniment piece voice data; The reproduction time of said original singer's piece voice data is identical with the reproduction time of said sound accompaniment piece voice data, and said audio file comprises the data of two sound channels;
Microcontroller is used to receive the play mode switching command, detects current play mode, and according to the current play mode output original singer's steering order or the steering order of accompanying;
Sound collection unit is used to gather the voice data of user's input;
Audio treatment unit; Be used for reading said audio file from said audio files storage device according to said original singer's steering order; And export the original singer's piece voice data in the said audio file; Perhaps from said audio files storage device, read said audio file, and the synthetic vocal accompaniment of the voice data voice data of sound accompaniment piece voice data in the said audio file and the collection of said sound collection unit is also exported according to said vocal accompaniment steering order;
The voice data broadcast unit is used for playing audio data.
In embodiments of the present invention; Through original singer's voice data and synthetic one of sound accompaniment voice data are comprised the original singer's piece voice data of alternately storage and the audio file of sound accompaniment piece voice data; When digital code player was in original singer's play mode, the original singer's piece voice data that reads in the audio file was play, when digital code player is in the vocal accompaniment play mode; Read the sound accompaniment piece voice data in the audio file; With it with voice data of gathering synthetic vocal accompaniment voice data and play, thereby realize the audio-visual vocal accompaniment function of preferable digital code player, realize the former switching at any time of joining in the chorus between the vocal accompaniment of digital code player simultaneously.
Description of drawings
Fig. 1 is the realization flow figure that the embodiment of the invention provides the generation method of audio file;
Fig. 2 is the process flow diagram of the method that on digital code player, realizes vocal accompaniment that provides of the embodiment of the invention;
Fig. 3 is the realization flow figure of the format conversion of the original singer's voice data that provides of the embodiment of the invention and sound accompaniment voice data;
Fig. 4 is the realization flow figure of the former switching between the vocal accompaniment of joining in the chorus of the digital code player that provides of the embodiment of the invention;
Fig. 5 is the structural representation that the embodiment of the invention provides the generating apparatus of audio file;
Fig. 6 is the structural drawing of the digital code player that has audio-visual vocal accompaniment function that provides of the embodiment of the invention.
Embodiment
In order to make the object of the invention, technical scheme and advantage clearer,, the present invention is further elaborated below in conjunction with accompanying drawing and embodiment.Should be appreciated that specific embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
In embodiments of the present invention, through the synthetic data that comprise of original singer's voice data and sound accompaniment voice data decoding back are replaced the original singer's piece voice data of storage and the audio file of sound accompaniment piece audio frequency; When receiving the request of vocal accompaniment play mode; According to original singer's piece voice data of current broadcast, read the sound accompaniment piece voice data corresponding with this original singer's piece voice data, and with itself and the synthetic vocal accompaniment of the voice data of gathering voice data; And playing, thereby the audio-visual vocal accompaniment function of realization digital code player.
In embodiments of the present invention; In order to realize the synchronous of original singer's voice data and sound accompaniment voice data; Promptly when switching to vocal accompaniment from the original singer; The play position of the sound accompaniment voice data after guaranteeing to switch is corresponding with the play position of switching preceding original singer's voice data; With original singer's voice data and sound accompaniment voice data are synthetic when comprising the audio file that original singer's piece voice data and sound accompaniment piece voice data replace, must guarantee that the decoded reproduction time of each original singer's piece voice data equals its corresponding decoded reproduction time of sound accompaniment piece voice data.In embodiments of the present invention, will comprise the original singer's piece voice data of alternately storage and the audio file of sound accompaniment piece voice data and be called the AKS file.Therefore in embodiments of the present invention; Before synthetic AKS file; Preestablish the reproduction time of each original singer's piece voice data of AKS file, preset the reproduction time of each original singer's piece voice data, then this reproduction time equals the reproduction time of the sound accompaniment piece voice data corresponding with each original singer's piece voice data; In embodiments of the present invention, the reproduction time of original singer's piece voice data and the reproduction time of sound accompaniment piece voice data are referred to as the piece reproduction time.The reproduction time that can set each audio data block is identical, also can be different.The reproduction time of general audio data block is set to 0.2~0.3 second, has preferable synchronous playing effect.In embodiments of the present invention, with the reproduction time of setting each audio data block be 0.2 second be example.
Before generating the AKS file; The file header of AKS at first is set; The file header of AKS comprises but is not limited to file header synchronization character, file size, version number, coded format, voice playing T.T., file synchronization word, file total length, audio attribute synchronization character, audio attribute length and audio attribute; Wherein audio attribute includes but not limited to variable fields such as audio sample rate, channel number, quantizing bit number, original singer's audio bit rate, original singer's audio frequency frame length, original singer's audio frame samples number, original singer's audio block size, sound accompaniment audio bit rate, sound accompaniment audio frequency frame length, sound accompaniment audio frame samples number, sound accompaniment audio block size; The field that comprises in this AKS file header simultaneously can be according to the actual play needs, increase and decrease voluntarily.The explanation of each field is as shown in the table:
Variable name Take bit number Value
The file header synchronization character 32 “AKS”
File size 32
Version number 16 0x0001
The document No. form 16 0x0001
Voice playing T.T. 32
The file synchronization word 32 “AKSD”
The file total length 32
Audio sample rate 32
Channel number 16
Quantizing bit number 16
Original singer's audio bit rate 32
Original singer's audio frequency frame length 32
Original singer's audio frame samples number 32
Original singer's audio block size 32
The sound accompaniment audio bit rate 32
Sound accompaniment audio frequency frame length 32
Sound accompaniment audio frame samples number 32
Sound accompaniment audio block size 32
Wherein, The file header synchronization character is positioned at the reference position of AKS file, in order to reach the preferable original singer's audio frequency and the synchronous effect of sound accompaniment audio frequency, in embodiments of the present invention; Be provided with original singer's audio bit rate and sound accompaniment audio bit rate be fixed bit rate (Constants Bit Rate, CBR).
Fig. 1 shows the product process of the audio file of original singer's piece voice data that comprises alternately storage that the embodiment of the invention provides and sound accompaniment piece voice data; For the audio file that comprises original singer's piece voice data and sound accompaniment piece voice data that guarantees to generate; When playing; Reach the synchronous of original singer's voice data and sound accompaniment voice data, it is identical at first to set the decoded reproduction time of each original singer's piece voice data decoded reproduction time voice data of corresponding sound accompaniment piece with it, simultaneously; Before generating this audio file, set the decoded reproduction time of each original singer's piece voice data.When setting the decoded reproduction time of each original singer's piece voice data, the decoded reproduction time of each original singer's piece voice data can be identical, also can be inequality.Details are as follows:
In step S101, decoding original singer voice data, and from original singer's voice data, read original singer's voice data of preset original singer's block size.
When the bit rate of original singer's voice data is fixed bit rate, original singer's block size=this piece reproduction time * original singer's audio bit rate.This piece reproduction time is the decoded reproduction time of predefined each original singer's piece voice data.For the original singer's voice data that guarantees this original singer's block size comprises an integer frame, get the integer of this result of calculation, i.e. original singer block size=INT (this piece reproduction time * original singer's audio bit rate).As as audio sample rate fs=44.1khz, during original singer's audio bit rate bitrate_ original singer=128kbps, original singer block size=INT (128kbps * 0.2/8)=3k.
In order to guarantee that each original singer's piece voice data comprises an integer frame, also can adopt following original singer's block size computing formula: original singer's block size=original singer's audio frequency frame length * (audio sample rate * this piece reproduction time/original singer's audio frame samples number).Wherein original singer's audio frequency frame length, audio sample rate and original singer's audio frame samples number are to preestablish in the corresponding field of AKS file header, and its value is the value of original singer's audio frequency frame length, audio sample rate and original singer's audio frame samples number of original singer's audio data stream of reading.
When the bit rate of original singer's voice data is variable bit rate (VBR); Because bit rate changes, thereby the frame length of original singer's audio frequency also changes, at this moment; Through being original singer's piece voice data and the identical reproduction time of sound accompaniment piece voice data setting; Thereby obtaining original singer's audio block size and sound accompaniment audio block size, reach the synchronous of original singer's piece voice data and sound accompaniment piece voice data, obviously is inappropriate.At this moment, can be through setting identical reproduction time for original singer's piece voice data and sound accompaniment piece voice data, obtain the frame number that frame number that original singer's audio block comprises and sound accompaniment audio block comprise, thereby reach the synchronous of original singer's piece voice data and sound accompaniment piece voice data.Wherein original singer's piece comprises frame number=INT (an original singer's piece voice data reproduction time/frame original singer voice playing time); Frame original singer voice playing time=original singer's audio frame samples number/audio sample rate wherein, thus original singer's piece comprises frame number=INT (original singer's piece voice data reproduction time * audio sample rate/original singer's audio frame samples number).Promptly when the bit rate of original singer's voice data is VBR, in step S101, from original singer's voice data, read original singer's voice data that original singer's piece comprises frame number.
The original singer's block size that calculates is write original singer's audio block size field of AKS file header.When the reproduction time of each preset original singer's piece not simultaneously; The original singer's block size that then calculates according to the computing formula of original singer's block size is also different; At this moment, in the AKS file header, can adopt forms such as tabulation that each the original singer's block size that calculates is preserved respectively.From original singer's audio data stream, reading in the AKS file header original singer's block size that calculates according to this piece reproduction time and original singer's audio bit rate reads.
In step S102, the original singer's piece voice data that reads is write the AKS file.
In step S103, decoding sound accompaniment voice data, and from the sound accompaniment voice data, read the sound accompaniment voice data of preset sound accompaniment block size.
When the bit rate of original singer's voice data is fixed bit rate, sound accompaniment block size=this piece reproduction time * sound accompaniment audio bit rate.This piece reproduction time is the decoded reproduction time of predefined each original singer's piece voice data.For the original singer's voice data that guarantees this original singer's block size comprises an integer frame, get the integer of this result of calculation, i.e. original singer block size=INT (this piece reproduction time * original singer's audio bit rate).As as audio sample rate fs=44.1khz, during sound accompaniment audio bit rate bitrate_ sound accompaniment=64kbps, sound accompaniment block size=INT (64kbps * 0.2/8)=1.5k.
In order to guarantee that each sound accompaniment piece voice data comprises an integer frame, also can adopt following sound accompaniment block size computing formula: sound accompaniment block size=sound accompaniment audio frequency frame length * (audio sample rate * this piece reproduction time/sound accompaniment audio frame samples number).Wherein sound accompaniment audio frequency frame length, audio sample rate and sound accompaniment audio frame samples number are to preestablish in the corresponding field of AKS file header, and its value is the value of sound accompaniment audio frequency frame length, audio sample rate and the sound accompaniment audio frame samples number of the sound accompaniment audio data stream that reads.
When being VBR, can obtain the frame number that the sound accompaniment audio block comprises through the reproduction time of the sound accompaniment piece voice data set with bit rate that should sound accompaniment piece voice data, thus reach original singer's piece voice data and its corresponding sound accompaniment piece voice data synchronously.Wherein the sound accompaniment piece comprises frame number=INT (sound accompaniment piece voice data reproduction time * audio sample rate/sound accompaniment audio frame samples number).Promptly when the bit rate of sound accompaniment voice data is VBR, in step S101, from the sound accompaniment voice data, read the sound accompaniment voice data that the sound accompaniment piece comprises frame number.
The sound accompaniment block size that calculates is write the sound accompaniment audio block size field of AKS file header; When the reproduction time of each preset original singer's piece not simultaneously; The original singer's block size that then calculates according to the computing formula of original singer's block size is also different; At this moment, in the AKS file header, can adopt forms such as tabulation that each the sound accompaniment block size that calculates is preserved respectively.From original singer's audio data stream, reading in the AKS file header original singer's block size that calculates according to this piece reproduction time and original singer's audio bit rate reads.
In step S104, the sound accompaniment piece voice data that reads is write the AKS file.
In step S105, judge whether original singer's voice data reads to finish, if, execution in step S106 then, otherwise, execution in step S101.
In step S106, judge whether the sound accompaniment voice data reads to finish, if, execution in step S107 then, otherwise, execution in step S103.
In step S107, alternately write the AKS file through above-mentioned original singer's piece voice data and sound accompaniment piece voice data after, upgrade the value of respective field in the AKS file header.Like field values such as file size, voice playing T.T., audio frequency total lengths.
After adopting above-mentioned steps with the synthetic AKS file that comprises the original singer's piece voice data alternately stored and sound accompaniment piece voice data of original singer's voice data and sound accompaniment voice data; The form of alternately storing of original singer's piece voice data and sound accompaniment piece voice data can be following: Data{ original singer block_1, sound accompaniment block_1, original singer block_2; Sound accompaniment block_2; ..., original singer block_n, sound accompaniment block_n}.The data that in this AKS file, comprise two sound channels.
In embodiments of the present invention, read the sound accompaniment piece voice data in the sound accompaniment voice data and write the AKS file with read original singer's piece voice data of original singer's voice data and write the order of AKS file unrestricted, can be any.
Fig. 2 shows the flow process of the method for audio-visual vocal accompaniment that on digital code player, realizes that the embodiment of the invention provides, and details are as follows:
In step S201, with the AKS file of the voice data of synthetic original singer's piece voice data that comprises alternately storage of original singer's voice data and sound accompaniment voice data and sound accompaniment piece.
Owing to when original singer's voice data and sound accompaniment voice data are synthesized the AKS file, when this original singer's voice data and sound accompaniment voice data are fixed bit rate, can reach preferable result of broadcast.Therefore, before synthetic AKS file, be the form that meets AKS with the format conversion of original singer's voice data and sound accompaniment voice data with original singer's voice data and sound accompaniment voice data.
Before synthetic AKS file, adopt audio decoder that original singer's voice data and sound accompaniment voice data are decoded, before decoding, need carry out initialization to audio decoder.Wherein original singer's voice data can be downloaded or be stored to the digital code player through other modes from network with the vocal accompaniment voice data through PC.Original singer's voice data can be MP3 format (Moving Picture Experts Group Audio Layer III), audio frequency media (Windows Media Audio with the form of vocal accompaniment voice data; WMA) form, OGG form or Advanced Audio Coding (Advanced Audio Coding, AAC) any audio format such as form.
The process of synthetic AKS file is as shown in Figure 1, repeats no more at this.Can realize the former preferably synchronous playing effect of joining in the chorus and accompanying in order to make the AKS file after synthesizing; Before synthetic AKS file; Field value in the file header of preset AKS file; Wherein the field in the AKS file header comprises file header synchronization character, file size, version number, document No. form, voice playing T.T., file synchronization word, file total length, audio attribute synchronization character, audio attribute length and audio attribute, and wherein audio attribute includes but not limited to variable fields such as audio sample rate, channel number, quantizing bit number, original singer's audio bit rate, original singer's audio frequency frame length, original singer's audio frame samples number, original singer's audio block size, sound accompaniment audio bit rate, sound accompaniment audio frequency frame length, sound accompaniment audio frame samples number, sound accompaniment audio block size.According to the broadcast needs, in the above-mentioned field one or more can be set.
In step S202, receive user's audio-visual vocal accompaniment request, with the voice data Composite tone data and the broadcast of sound accompaniment piece voice data in this AKS file and digital code player collection.
In embodiments of the present invention, switch at any time between the vocal accompaniment in order to be implemented in former joining in the chorus, the shell of digital code player is provided with the play mode selector button, and the user can be switched between the vocal accompaniment former joining in the chorus through this play mode selector button.
When detecting current digital code player, the microcontroller of digital code player is in original singer's play mode; Be that microcontroller is when receiving original singer's playing request of user; Audio decoder calculates the play position of original singer's piece voice data corresponding with this time point in the AKS file according to current point in time; Begin to read the voice data the AKS file from this position, during voice data in reading the AKS file, skip sound accompaniment piece voice data in the AKS file; And the voice data of original singer's piece of reading decoded, play by player;
When detecting current digital code player, the microcontroller of digital code player is in the vocal accompaniment play mode; Be that microcontroller is when receiving user's audio-visual vocal accompaniment request; Audio decoder begins to read the audio data stream the AKS file according to the play position of sound accompaniment piece voice data corresponding with this time point in the current point in time calculating AKS file from this position.During voice data in reading the AKS file, skip original singer's piece voice data in the AKS file, and the voice data that reads is decoded,, play by player with the voice data Composite tone data that decoded voice data and digital code player are gathered.Wherein voice data can be gathered through microphone or other voice collection device.
The mode of the voice data Composite tone data of the voice data of sound accompaniment piece and digital code player collection can be adopted any synthetic technology of prior art; Also can be through mode to sound accompaniment data and voice data employing bidirectional weighting, its detailed process is following:
Suppose that sound accompaniment is B, the sound of user input is U, the final O that is output as, and the weighted value of suppose sound accompaniment is w (w<1), the weighted value of the sound imported of user is 1-w so, has guaranteed that like this two can not overflow in weighting summation, then
O=w*B+(1-w)*U
During actual the use, provide 11 class selective, promptly the span of w is the value at interval 0.1 between [0,1].
When the user imports the play mode switching command through external play mode selector button, imported the information of two aspects: the one, whether need switch to sound accompaniment; The 2nd, switch to sound accompaniment after, select the effects of adjustment according to above-mentioned 11 class that provide.
In embodiments of the present invention; When the bit rate of original singer's voice data and sound accompaniment voice data is fixed bit rate; Channel number, sampling rate and the quantizing bit number homogeneous phase while of perhaps working as original singer's voice data and sound accompaniment voice data; Then can make original singer's piece voice data and sound accompaniment piece voice data in the AKS file of generation reach better synchronous effect; Therefore, in embodiments of the present invention, original singer's voice data and sound accompaniment voice data are generated comprise the AKS file of alternately having stored original singer's piece voice data and sound accompaniment piece voice data before; Original singer's voice data and sound accompaniment voice data to not meeting above-mentioned requirements are changed, and make original singer's voice data and sound accompaniment voice data meet above-mentioned requirements.
Fig. 3 shows the realization flow of the conversion of original singer's voice data that the embodiment of the invention provides and sound accompaniment voice data, and details are as follows:
In step S301, audio decoder is decoded to original singer's voice data, and decoded original singer's voice data becomes pulse code modulation (PCM) (Pulse Code Modulation, the PCM) data without compression;
In step S302, judge whether this original singer's voice data meets above-mentioned requirements, if do not meet; Execution in step S303; Otherwise execution in step S304 in embodiments of the present invention, judges whether original singer's voice data meets above-mentioned requirements; Mainly judge whether the bit rate of this original singer's voice data is fixed bit rate, judge perhaps whether the channel number of this original singer's voice data is the two-channel number;
In step S303, this original singer's voice data is converted to the original singer's voice data that meets above-mentioned requirements.The bit rate that is about to this original singer's voice data is made as fixed bit rate, and channel number is made as two-channel etc.;
In step S304, audio decoder is decoded to the sound accompaniment voice data;
In step S305, judge whether this sound accompaniment voice data meets above-mentioned requirements, if do not meet, execution in step S306, otherwise finish.When judging whether this sound accompaniment voice data meets above-mentioned requirements, judge whether the bit rate of this sound accompaniment voice data is fixed bit rate, and whether the sampling rate of this sound accompaniment voice data, channel number and quantization bit rate be consistent with original singer's voice data.In embodiments of the present invention, also can earlier the sound accompaniment voice data be decoded and judge;
In step S306; This sound accompaniment voice data is converted to the sound accompaniment voice data that meets above-mentioned requirements; The bit rate that is about to this sound accompaniment voice data is adjusted into fixed bit rate, and the sampling rate of this sound accompaniment voice data, channel number and quantization bit rate are adjusted into consistent with sampling rate, channel number and the quantization bit rate of original singer's voice data.
Fig. 4 shows the flow process of the former switching between the vocal accompaniment of joining in the chorus of realization digital code player that the embodiment of the invention provides, and is that original singer's play mode is an example with the original play mode of digital code player, and details are as follows:
In step S401, read the file header information of AKS file, and audio decoder is carried out initialization, the play mode that digital code player is set simultaneously is original singer's play mode;
In step S402, receive user's play mode switching command, judge whether the current play mode of digital code player is original singer's play mode, if, execution in step S403, otherwise, execution in step S404;
In step S403, after reading the voice data of the original singer's piece in the AKS file and it being decoded, execution in step S406;
In step S404, read the voice data of the sound accompaniment piece in the AKS file and it is decoded;
In step S405, gather the voice data of user through the user of microphone or the input of other sound collection devices, in embodiments of the present invention, step S404 and step S405 can carry out simultaneously, also can carry out in order, and its order can be any;
In step S406, with the voice data of gathering and the voice data Composite tone data of decoded sound accompaniment piece;
In step S407, the voice data after broadcast is synthetic or the voice data of original singer's piece.
Fig. 5 shows the structure of the audio file generating apparatus that the embodiment of the invention provides, and for better explanation the present invention, only shows the part relevant with the embodiment of the invention.
At first this audio file generating apparatus is carried out initialization, initialization operation comprises the field that comprises in the AKS file header is set, and the value of each field.In order to reach the preferable former sound accompaniment synchronous effect of joining in the chorus; Be provided with and comprise following field in the AKS file header; File header synchronization character, file size, version number, coded format, voice playing T.T., file synchronization word, file total length, audio attribute synchronization character, audio attribute length and audio attribute, wherein audio attribute includes but not limited to that audio sample rate, channel number, quantizing bit number, original singer's audio bit rate, original singer's audio frequency frame length, original singer's audio frame samples number, original singer's audio block size or original singer's piece comprise frame number, sound accompaniment audio bit rate, sound accompaniment audio frequency frame length, sound accompaniment audio frame samples number, sound accompaniment audio block size or sound accompaniment piece and comprise variable fields such as frame number.The field that comprises in the AKS file header can be with above-mentioned field combination in any according to playing needs.
For the audio file that comprises original singer's piece voice data and sound accompaniment piece voice data that guarantees to generate; When playing; Reach the synchronous of original singer's voice data and sound accompaniment voice data, it is identical at first to set the decoded reproduction time of each original singer's piece voice data decoded reproduction time voice data of corresponding sound accompaniment piece with it, simultaneously; Before generating this audio file, set the decoded reproduction time of each original singer's piece voice data.When setting the decoded reproduction time of each original singer's piece voice data, the decoded reproduction time of each original singer's piece voice data can be identical, also can be inequality.
When the bit rate of original singer's voice data and sound accompaniment voice data is fixed bit rate; Original singer's audio block size is to calculate according to preset original singer's piece voice data reproduction time and original singer's audio bit rate; Sound accompaniment audio block size is to calculate according to preset sound accompaniment piece voice data reproduction time and sound accompaniment audio bit rate, the big or small computing formula difference of original singer's piece audio block size and sound accompaniment piece audio frequency as follows:
Original singer's audio block size=original singer's piece voice playing time * original singer's audio bit rate;
Sound accompaniment audio block size=sound accompaniment piece voice playing time * sound accompaniment audio bit rate.
In order to guarantee that each original singer's piece voice data and sound accompaniment piece voice data comprise an integer frame, get the integer of result of calculation, promptly this moment, original singer's audio block size and the big or small computing formula of sound accompaniment audio block were respectively:
Original singer's audio block size=INT (original singer's piece voice playing time * original singer's audio bit rate);
Sound accompaniment audio block size=INT (sound accompaniment piece voice playing time * sound accompaniment audio bit rate).
In order to make each original singer's piece and sound accompaniment piece comprise an integer frame, also can adopt the computing formula of following original singer's audio block size and sound accompaniment piece audio frequency size:
Original singer's block size=original singer's audio frequency frame length * (audio sample rate * this piece reproduction time/original singer's audio frame samples number);
Sound accompaniment block size=sound accompaniment audio frequency frame length * (audio sample rate * this piece reproduction time/sound accompaniment audio frame samples number).
When be the preset reproduction time of each original singer's piece voice data not simultaneously, each is also different with the reproduction time of the corresponding sound accompaniment piece voice data of original singer's piece voice data.At this moment, can calculate under the different preset piece reproduction time size of each original singer's piece and corresponding sound accompaniment piece one by one according to the aforementioned calculation formula.
Thereby when carrying out initialization, original singer's block size that calculates and sound accompaniment block size are write in the corresponding field of AKS file header.When each original singer's block size is inequality; Each sound accompaniment block size is also inequality; In embodiments of the present invention, in the AKS file header, original singer's piece audio frequency size field all adopts the form of tabulation that each different original singer's block sizes and sound accompaniment block size are stored with sound accompaniment piece audio frequency size.
After initialization is accomplished; Voice data reads and writes control module 51 to original singer's voice data read module 52 transmission original singer piece voice data reading command, and original singer's piece voice data that original singer's voice data read module 52 reads is delivered to original singer's voice data writing module 54.Then voice data reads and writes control module 51 to sound accompaniment voice data read module 53 transmission sound accompaniment piece voice data reading command, and the sound accompaniment piece voice data that sound accompaniment voice data read module 53 reads is delivered to sound accompaniment voice data writing module 55.Voice data reads and writes control module 51 and also can be earlier send the voice data reading command to sound accompaniment voice data read module 53, is sending original singer's piece voice data reading command to original singer's voice data read module 52.Voice data reads and writes control module 51 through to the interactive operation between original singer's voice data read module 52, original singer's voice data writing module 54, sound accompaniment voice data read module 53 and the sound accompaniment voice data writing module 55, thereby makes the original singer's piece voice data that writes in the AKS file realize alternately storing with sound accompaniment piece voice data.
After original singer's voice data read module 52 receives the voice data reading command; According to original singer's piece audio frequency size in the AKS file header; From original singer's voice data, read original singer's piece voice data of original singer's piece audio frequency size, and the original singer's piece voice data that reads is delivered to voice data read and write control module 51.
Original singer's voice data writing module 54 reads the original singer's piece voice data that writes control module 51 transmission with voice data and writes in the AKS file.
After sound accompaniment voice data read module 52 receives the voice data reading command; According to sound accompaniment piece audio frequency size in the AKS file header; From the sound accompaniment voice data, read the sound accompaniment piece voice data of sound accompaniment piece audio frequency size, and the sound accompaniment piece voice data that reads is delivered to voice data read and write control module 51.
Sound accompaniment voice data writing module 54 reads the sound accompaniment piece voice data that writes control module 51 transmission with voice data and writes in the AKS file.
Voice data read write control module 51 detect original singer's voice data and sound accompaniment voice data all read finish after; Send update instruction to audio file new module on first watch 56, audio file new module on first watch 56 is upgraded the value of each field in the AKS file header according to this update instruction.The field that wherein need upgrade is in the process that generates the AKS file, and the field that changes is like file size, audio sync word, audio frequency total length etc.
Fig. 6 shows the structure of the digital code player that has audio-visual vocal accompaniment function that the embodiment of the invention provides, and for better explanation the present invention, only shows the part relevant with the embodiment of the invention.
Store the AKS file that generates according to above-mentioned AKS document generating method in the audio files storage device 61.
Microcontroller 62 receives the play mode switching command that the user sends, and detects the current play mode of digital code player, and sends the original singer's steering order or the steering order of accompanying according to the current play mode of digital code player to audio treatment unit 63.For digital code player can only be switched, the play mode switching key is set in digital code player between original singer's play mode and vocal accompaniment play mode.
When the user sent the play mode switching command through the play mode switching key, microcontroller 62 detected the current play mode of digital code player.When the current play mode of digital code player was original singer's play mode, microcontroller 62 sent original singer's steering order to audio treatment unit 63; When the current play mode of digital code player was the vocal accompaniment play mode, microcontroller 62 sent the vocal accompaniment steering orders to audio treatment unit 63.
After audio treatment unit 63 receives original singer's steering order; The play position of sound accompaniment piece voice data is calculated the play position of original singer's piece voice data corresponding with the play position of this sound accompaniment piece voice data in the AKS file in the AKS file when switching; Read the AKS file behind this position; The AKS file that 631 pairs of audio decoding units read is decoded; From decoded voice data, extract original singer's piece voice data, and filter out sound accompaniment piece voice data, export the original singer's piece voice data that extracts to voice data broadcast unit 65.
After audio treatment unit 63 receives the vocal accompaniment steering order; The play position of original singer's piece voice data is calculated the play position of sound accompaniment piece voice data corresponding with the play position of this original singer's piece voice data in the AKS file in the AKS file when switching; Read the AKS file behind this position; The AKS file that 631 pairs of audio decoding units read is decoded; From decoded voice data, extract sound accompaniment piece voice data, and filter out original singer's piece voice data, export the sound accompaniment piece voice data that extracts to voice data synthesis unit 632.
Simultaneously sound collection unit 64 is gathered the voice data of users through the input of acoustic input dephonoprojectoscopes such as microphone, and this voice data is carried out exporting voice data synthesis unit 632 to after analog to digital conversion etc. handles.
Voice data synthesis unit 632 superposes the sound accompaniment piece voice data of the reception of audio decoding unit 631 outputs and the voice data of sound collection unit output; With synthetic vocal accompaniment voice data, export the vocal accompaniment voice data after synthetic to voice data broadcast unit 65.Voice data synthesis unit 632 can adopt any synthetic technology of prior art when synthesizing, like mode of bidirectional weighting etc.
Voice data broadcast unit 65 is play the vocal accompaniment voice data after the original singer's piece voice data that receives perhaps synthesizes.
In embodiments of the present invention; Through with the synthetic original singer's piece voice data of alternately storage and the audio file of sound accompaniment piece voice data of comprising of original singer's voice data and sound accompaniment voice data; When receiving user's vocal accompaniment playing request; Read sound accompaniment piece voice data in the audio file after synthesizing, and the synthetic vocal accompaniment of the voice data of will accompany piece voice data and collection voice data, and play.Owing in the vocal accompaniment process, need not carry out like the perhaps processing such as shielding of eliminating the noise, thereby not influence the voice data play quality, have audio-visual preferably vocal accompaniment effect to original singer's voice data.Simultaneously owing to comprise original singer's piece voice data and sound accompaniment piece voice data in the audio file after synthetic, thereby can realize original singer's play mode and the switching between the play mode of accompanying.
The above is merely preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of within spirit of the present invention and principle, being done, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.

Claims (11)

1. the generation method of an audio file is characterized in that, said method comprises the steps:
From original singer's voice data, read original singer's piece voice data of preset original singer's audio block size, and said original singer's piece voice data is write audio file;
From the sound accompaniment voice data, read the sound accompaniment piece voice data of preset sound accompaniment audio block size, and said sound accompaniment piece voice data is write audio file, the reproduction time of said original singer's piece voice data is identical with the reproduction time of said sound accompaniment piece voice data;
Above-mentioned steps is carried out in circulation, all alternately writes said audio file until said original singer's voice data and said sound accompaniment voice data, and said audio file comprises the data of two sound channels.
2. the generation method of audio file as claimed in claim 1 is characterized in that, the bit rate of the bit rate of said original singer's voice data and said sound accompaniment voice data is fixed bit rate.
3. the generation method of audio file as claimed in claim 1 is characterized in that, said method also comprises the steps:
When said original singer's voice data and said sound accompaniment voice data all read and write when finishing, upgrade the file header of said audio file.
4. the generating apparatus of an audio file is characterized in that, said device comprises:
Original singer's voice data read module is used for reading the big or small original singer's piece voice data of preset original singer's audio block from original singer's voice data;
Original singer's voice data writing module is used for said original singer's piece voice data is write audio file;
Sound accompaniment voice data read module is used for reading the big or small sound accompaniment piece voice data of preset sound accompaniment audio block from the sound accompaniment voice data, and the reproduction time of said original singer's piece voice data is identical with the reproduction time of said sound accompaniment piece voice data;
Sound accompaniment voice data writing module is used for said sound accompaniment piece voice data is write audio file;
Voice data reads and writes control module; Be used to control said original singer's voice data read module, original singer's voice data writing module, sound accompaniment voice data read module and sound accompaniment voice data writing module; Periodic duty; Make the original singer's piece voice data and the alternately storage of sound accompaniment piece voice data that write in the said audio file, said audio file comprises the data of two sound channels.
5. the generating apparatus of audio file as claimed in claim 4 is characterized in that, the bit rate of the bit rate of said original singer's voice data and said sound accompaniment voice data is fixed bit rate.
6. the generating apparatus of audio file as claimed in claim 4 is characterized in that, said device also comprises:
Audio file new module on first watch is used to upgrade the file header of said audio file.
7. a method that on digital code player, realizes audio-visual vocal accompaniment is characterized in that said method comprises the steps:
With original singer's voice data and the synthetic original singer's piece voice data of alternately storage and the audio file of sound accompaniment piece voice data of comprising of sound accompaniment voice data, said audio file comprises the data of two sound channels;
Receive the vocal accompaniment playing request, read the sound accompaniment piece voice data in the said audio file;
Gather the voice data of user's input;
With said sound accompaniment piece voice data and said voice data Composite tone data;
Play said voice data after synthetic.
8. method as claimed in claim 7 is characterized in that, said reception vocal accompaniment playing request, and the step that reads the sound accompaniment piece voice data in the said audio file is specially:
Receive the play mode switching command, detect current play mode;
If current play mode is original singer's play mode, from said audio file with receive the corresponding position of said play mode switching command and begin, read original singer's piece audio data stream, and play;
If current play mode is the vocal accompaniment play mode, from said audio file with receive the corresponding position of said play mode switching command and begin, read sound accompaniment piece audio data stream, and export.
9. like claim 7 or 8 described methods, it is characterized in that the bit rate of said original singer's voice data and sound accompaniment voice data is fixed bit rate.
10. a digital code player is characterized in that, said digital code player comprises:
The audio files storage device; Be used to store the original singer's piece voice data that comprises alternately storage and the audio file of sound accompaniment piece voice data; The reproduction time of said original singer's piece voice data is identical with the reproduction time of said sound accompaniment piece voice data, and said audio file comprises the data of two sound channels;
Microcontroller is used to receive the play mode switching command, detects current play mode, and according to the current play mode output original singer's steering order or the steering order of accompanying;
Sound collection unit is used to gather the voice data of user's input;
Audio treatment unit; Be used for reading said audio file from said audio files storage device according to said original singer's steering order; And export the original singer's piece voice data in the said audio file; Perhaps from said audio files storage device, read said audio file, and the synthetic vocal accompaniment of the voice data voice data of sound accompaniment piece voice data in the said audio file and the collection of said sound collection unit is also exported according to said vocal accompaniment steering order;
The voice data broadcast unit is used to play voice data or the voice data of original singer's piece after synthetic.
11. digital code player as claimed in claim 10 is characterized in that, said audio treatment unit comprises:
Audio decoding unit; Be used for the audio file that reads from said audio files storage device is decoded; And export the original singer's piece voice data in the said audio file according to said original singer's steering order, perhaps export the sound accompaniment piece voice data in the said audio file according to said vocal accompaniment steering order;
The voice data synthesis unit is used for the sound accompaniment piece voice data of said audio decoding unit output and the voice data synthetic vocal accompaniment voice data and the output of said sound collection unit output.
CN2007101810415A 2007-09-30 2007-09-30 Audio file generation method, device and digital player Expired - Fee Related CN101131816B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2007101810415A CN101131816B (en) 2007-09-30 2007-09-30 Audio file generation method, device and digital player

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2007101810415A CN101131816B (en) 2007-09-30 2007-09-30 Audio file generation method, device and digital player

Publications (2)

Publication Number Publication Date
CN101131816A CN101131816A (en) 2008-02-27
CN101131816B true CN101131816B (en) 2012-01-04

Family

ID=39129066

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2007101810415A Expired - Fee Related CN101131816B (en) 2007-09-30 2007-09-30 Audio file generation method, device and digital player

Country Status (1)

Country Link
CN (1) CN101131816B (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103428527A (en) * 2013-08-08 2013-12-04 北京宽客网络技术有限公司 Real-time data source media stream transformation method and breakpoint switching play method
CN104683853B (en) * 2015-02-04 2018-09-04 广州酷狗计算机科技有限公司 The acquisition device and terminal of multimedia file
EP3306606A4 (en) 2015-05-27 2019-01-16 Guangzhou Kugou Computer Technology Co., Ltd. Audio processing method, apparatus and system
CN105006234B (en) * 2015-05-27 2018-06-29 广州酷狗计算机科技有限公司 A kind of K sings processing method and processing device
CN106887244B (en) * 2015-12-15 2019-08-30 广州酷狗计算机科技有限公司 Audio switching method and device
CN108461086B (en) * 2016-12-13 2020-05-15 北京唱吧科技股份有限公司 Real-time audio switching method and device
CN106875967B (en) * 2016-12-29 2020-01-21 珠海市杰理科技股份有限公司 Method and system for playing multiple audio in superposition manner
CN107346981A (en) * 2017-05-16 2017-11-14 北京数科技有限公司 Data transmission method for uplink, method of reseptance and data sending device, reception device
CN108010503B (en) * 2017-12-27 2021-12-03 北京酷我科技有限公司 K song recording method
CN109375892B (en) * 2018-10-12 2021-12-07 北京微播视界科技有限公司 Method and apparatus for playing audio
CN113220264B (en) * 2021-05-26 2022-09-20 东风电子科技股份有限公司 System, method, device, processor and storage medium for realizing automobile instrument audio synthesis and real-time play control

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5233438A (en) * 1990-03-02 1993-08-03 Brother Kogyo Kabushiki Kaisha Entertainment apparatus for producing orchestral music accompaniment and a selected background video
US5410097A (en) * 1992-10-09 1995-04-25 Yamaha Corporation Karaoke apparatus with skip and repeat operation of orchestra accompaniment
EP0987707A2 (en) * 1995-08-21 2000-03-22 Matsushita Electric Industrial Co., Ltd. Optical disc reproduction device and reproduction method which can achieve a dynamic switching of the reproduced content
CN1617572A (en) * 2003-10-06 2005-05-18 Lg电子株式会社 Image display device with built-in karaoke and method for controlling the same

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5233438A (en) * 1990-03-02 1993-08-03 Brother Kogyo Kabushiki Kaisha Entertainment apparatus for producing orchestral music accompaniment and a selected background video
US5410097A (en) * 1992-10-09 1995-04-25 Yamaha Corporation Karaoke apparatus with skip and repeat operation of orchestra accompaniment
EP0987707A2 (en) * 1995-08-21 2000-03-22 Matsushita Electric Industrial Co., Ltd. Optical disc reproduction device and reproduction method which can achieve a dynamic switching of the reproduced content
CN1617572A (en) * 2003-10-06 2005-05-18 Lg电子株式会社 Image display device with built-in karaoke and method for controlling the same

Also Published As

Publication number Publication date
CN101131816A (en) 2008-02-27

Similar Documents

Publication Publication Date Title
CN101131816B (en) Audio file generation method, device and digital player
CN100571450C (en) The system and method for interactive audio frequency is provided in the multichannel audio environment
CN101189661B (en) Device and method for generating a data stream and for generating a multi-channel representation
CN101479785B (en) Method for encoding and decoding object-based audio signal and apparatus thereof
CN101652810B (en) Apparatus for processing mix signal and method thereof
CN100334810C (en) Sound-image localization device and method for audio-visual equipment
CN101609667B (en) Method for realizing karaoke function in PMP player
US9779736B2 (en) Systems and methods for implementing efficient cross-fading between compressed audio streams
JP2006317972A (en) Audio data editing method, recording medium employing same, and digital audio player
CN102610267B (en) Method for improving audio playing quality of playing system
CN108235052A (en) Multi-audio-frequency channel hardware audio mixing, acquisition and the method for broadcasting may be selected based on IOS
CN103915086A (en) Information processing method, device and system
CN105323702A (en) Audio mixing method and system
CN102760437B (en) Audio decoding device of control conversion of real-time audio track
CN102067210B (en) Apparatus and method for encoding and decoding audio signals
WO2007139911A2 (en) Digital audio encoding
CN105989824A (en) Karaoke system of mobile device and mobile device
WO2011087460A1 (en) A method and a device for generating at least one audio file, and a method and a device for playing at least one audio file
KR20180012397A (en) Management system and method for digital sound source, device and method of playing digital sound source
CN108461086B (en) Real-time audio switching method and device
KR20000067175A (en) Digital data player capable of voice hearing
JP4403319B2 (en) Terminal device
Herre Audio coding-an all-round entertainment technology
WO2007088490A1 (en) Device for and method of processing audio data
US20220328051A1 (en) Systems and methods for implementing efficient cross-fading between compressed audio streams

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20120104

Termination date: 20130930