WO2015089733A1 - Method for playing audio file in multimedia terminal and multimedia terminal - Google Patents

Method for playing audio file in multimedia terminal and multimedia terminal Download PDF

Info

Publication number
WO2015089733A1
WO2015089733A1 PCT/CN2013/089678 CN2013089678W WO2015089733A1 WO 2015089733 A1 WO2015089733 A1 WO 2015089733A1 CN 2013089678 W CN2013089678 W CN 2013089678W WO 2015089733 A1 WO2015089733 A1 WO 2015089733A1
Authority
WO
WIPO (PCT)
Prior art keywords
channel signal
audio file
frames
signal
multimedia terminal
Prior art date
Application number
PCT/CN2013/089678
Other languages
French (fr)
Chinese (zh)
Inventor
易见
鲁波
Original Assignee
华为终端有限公司
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 华为终端有限公司 filed Critical 华为终端有限公司
Priority to PCT/CN2013/089678 priority Critical patent/WO2015089733A1/en
Publication of WO2015089733A1 publication Critical patent/WO2015089733A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04SSTEREOPHONIC SYSTEMS 
    • H04S1/00Two-channel systems
    • H04S1/007Two-channel systems in which the audio signals are in digital form

Definitions

  • the present invention relates to the field of audio and video technologies, and in particular, to a method for playing an audio file in a multimedia terminal and a multimedia terminal. Background technique
  • the embodiment of the invention provides a method for playing an audio file in a multimedia terminal and a multimedia terminal, which can realize the audio file with the left and right channel signals reversed without distortion in the multimedia terminal of the mono output mechanism, and is enhanced. user experience.
  • a first aspect of the embodiments of the present invention provides a method for playing an audio file, including: decoding, by a multimedia terminal, at least one frame of an audio file, and acquiring a left channel signal and a right channel signal of at least one frame of the audio file. ;
  • the multimedia terminal superimposes the left channel signal and the right channel signal of at least one frame of the audio file and acquires the superimposed superimposed signal;
  • the multimedia terminal determines whether the amplitude of the superimposed signal is within a preset range, and if the amplitude of the superimposed signal is within a preset range, determining a left channel signal and a right channel signal of all frames of the audio file Reverse
  • the multimedia terminal is Decoding all the frames of the audio file, and adjusting the left channel signal and the right channel signal of all frames of the audio file obtained after decoding to the same direction;
  • the multimedia terminal superimposes and plays the left channel signal and the right channel signal of all frames of the audio file adjusted in the same direction.
  • the multimedia terminal determines whether the amplitude of the superimposed signal is within a preset range, and if the amplitude of the superimposed signal is within a preset range, determining the The reverse of the left channel signal and the right channel signal of all frames of the audio file includes:
  • the multimedia terminal determines whether the amplitude of the superimposed signal is zero. If the amplitude of the superimposed signal is zero, it is determined that the left channel signal of all frames of the audio file is opposite to the right channel signal.
  • the multimedia terminal decodes at least one frame of the audio file, and obtains at least one frame of the audio file
  • the channel signal and the right channel signal also include:
  • the multimedia terminal acquires a play instruction for the audio file
  • the multimedia terminal sets a reverse identifier for the play instruction
  • the multimedia terminal decodes all frames of the audio file, and decodes all frames of the audio file obtained after decoding.
  • the adjustment of the left channel signal and the right channel signal to the same direction includes:
  • the multimedia terminal detects whether the reverse identifier is set for the play instruction; if the reverse identifier is detected, the multimedia terminal decodes all frames of the audio file, and the decoded audio is obtained.
  • the left channel signal and the right channel signal of all frames of the file are adjusted in the same direction.
  • the multimedia terminal decodes all frames of the audio file, and after decoding After the left channel signal and the right channel signal of all the frames of the obtained audio file are adjusted to be in the same direction, the method further includes: The multimedia terminal clears the reverse identity.
  • the multimedia terminal is adjusted to the left of all frames of the audio file in the same direction
  • the superposition and playback of the channel signal and the right channel signal include:
  • the multimedia terminal adjusts the left channel signal and the right channel signal of all the frames of the audio file in the same direction to reduce the amplitude by a preset ratio, and then superimposes and plays.
  • the multimedia terminal adjusts the left channel signal and the right channel signal of all frames of the audio file that are adjusted in the same direction. After the scale is reduced, the overlay and play are specifically included:
  • the multimedia terminal adjusts the left channel signal and the right channel signal of all the frames of the audio file in the same direction to reduce the amplitude by 50%, and superimposes and plays.
  • the adjusting the left channel signal and the right channel signal of all frames of the audio file obtained after decoding into the same direction includes:
  • the right channel signal of all frames of the audio file is kept unchanged, and the left channel signal of all frames of the audio file is inverted.
  • the at least one frame of the audio file includes:
  • the first frame of the audio file or the discrete at least two frames.
  • a second aspect of the embodiments of the present invention provides a multimedia terminal, including:
  • An audio decoding module configured to decode at least one frame of the audio file, and acquire a left channel signal and a right channel signal of at least one frame of the audio file;
  • a signal superimposing module configured to superimpose a left channel signal of at least one frame of the audio file and a right channel signal, and obtain a superimposed superimposed signal
  • a signal judging module configured to determine whether a magnitude of the superimposed signal is within a preset range, and if a magnitude of the superimposed signal is within a preset range, determining a left channel signal of all frames of the audio file The right channel signal is reversed;
  • a signal adjustment module for the left channel signal and the right channel signal of all frames of the audio file In the reverse direction, all the frames of the audio file are decoded, and the left channel signal and the right channel signal of all frames of the audio file obtained after decoding are adjusted to be in the same direction;
  • an audio playing module configured to superimpose and play the left channel signal and the right channel signal of all frames of the audio file adjusted to be in the same direction.
  • the signal determining module is configured to determine whether the amplitude of the superimposed signal is zero, and if the amplitude of the superimposed signal is zero, determine the audio file.
  • the left channel signal of all frames is inverted with the right channel signal.
  • the multimedia terminal further includes:
  • a play instruction acquisition module configured to acquire a play instruction for the audio file to trigger the audio decoding module
  • a reverse identifier setting module configured to: if it is determined that the left channel signal of the entire frame of the audio file is opposite to the right channel signal, set a reverse identifier for the play instruction;
  • the signal adjustment module includes:
  • a reverse identifier detecting unit configured to detect whether the reverse identifier is set for the play instruction before decoding the audio file
  • a signal adjustment unit configured to decode all frames of the audio file if the reverse identifier is detected, and decode the left channel signal and the right channel signal of all frames of the audio file obtained after decoding Adjust to the same direction.
  • the multimedia terminal further includes:
  • a reverse identifier clearing module configured to clear the reverse identifier after the audio playing module plays the new audio signal.
  • the audio playing module is configured to adjust all of the audio files in the same direction
  • the left channel signal and the right channel signal of the frame are scaled down by a preset ratio, and then superimposed and played.
  • the audio playback module is configured to adjust a left channel signal and a right channel of all frames of the audio file that are adjusted to be in the same direction The signal is scaled down by 50% and then superimposed and played.
  • the signal adjustment module is used to:
  • the left channel signal of all frames of the audio file is inverted with the right channel signal, decoding all frames of the audio file, and keeping the right channel signal of all frames of the audio file unchanged, The left channel signal of all frames of the audio file is inverted.
  • the at least one frame of the audio file includes:
  • the first frame of the audio file or the discrete at least two frames.
  • a third aspect of the embodiments of the present invention provides a multimedia terminal, where the multimedia terminal includes an audio output device, a memory, and a processor, wherein the memory stores a set of player programs, and the processor is configured to call a player program stored in the memory, Used to do the following:
  • the multimedia terminal decodes at least one frame of the audio file, and acquires a left channel signal and a right channel signal of at least one frame of the audio file;
  • the multimedia terminal superimposes the left channel signal and the right channel signal of at least one frame of the audio file and acquires the superimposed superimposed signal;
  • the multimedia terminal determines whether the amplitude of the superimposed signal is within a preset range, and if the amplitude of the superimposed signal is within a preset range, determining a left channel signal and a right channel signal of all frames of the audio file Reverse
  • the multimedia terminal decodes all the frames of the audio file, and the left frame of all the frames of the audio file obtained after decoding
  • the channel signal and the right channel signal are adjusted to be in the same direction
  • the multimedia terminal superimposes and plays the left channel signal and the right channel signal of all frames of the audio file adjusted in the same direction.
  • the embodiment of the present invention analyzes the pre-decoded left and right channel signals by pre-decoding a partial frame of the audio file, thereby identifying whether the left and right channel signals of the audio file are reversed, and to the left,
  • the audio file in the reverse direction of the right channel is processed, that is, the left and right channel signals are adjusted to be in the same direction and superimposed.
  • the audio file is played without distortion on the audio output device of the mono output mechanism, thereby improving the user experience.
  • FIG. 1 is a schematic flowchart of a method for playing an audio file in a multimedia terminal according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of another method for playing an audio file in a multimedia terminal according to an embodiment of the present invention
  • FIG. 3 is a schematic flowchart of another method for playing an audio file in a multimedia terminal according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of a multimedia terminal according to an embodiment of the present invention
  • FIG. 5 is a schematic structural diagram of a signal adjustment module according to an embodiment of the present invention
  • FIG. 6 is a schematic structural diagram of another multimedia terminal according to an embodiment of the present invention.
  • FIG. 7 is a signal diagram of a PCM decoded audio signal according to an embodiment of the present invention
  • FIG. 8 is a signal diagram of a partial audio signal PCM decoded according to an embodiment of the present invention.
  • FIG. 10 is a superimposed signal diagram provided by an embodiment of the present invention.
  • the audio file proposed in the embodiment of the present invention may include audio files in a common format such as MP3, WAV, WMA, and the like, and may also include audio sub-texts in multimedia files such as videos and movies. Piece or data.
  • the embodiments of the present invention are mainly implemented on a multimedia terminal using Android as an operating platform, but are not limited to the Android platform.
  • the equivalent implementation process on other operating platforms is still within the scope of the present invention.
  • FIG. 1 is a schematic flow chart of a method for playing an audio file in a multimedia terminal according to an embodiment of the present invention.
  • the flow of the method for playing an audio file in this embodiment as shown in the figure may include:
  • the multimedia terminal decodes at least one frame of the audio file, and acquires a left channel signal and a right channel signal of at least one frame of the audio file.
  • the audio file is mainly for a two-channel audio file, and each audio file may be split into a plurality of consecutive frames according to a certain unit.
  • the audio file needs to be decoded before being played, in the present invention.
  • the above decoding may be PCM (Pulse Code Modulation) decoding.
  • the multimedia terminal first decodes at least one frame of the audio file to obtain the left channel signal and the right channel signal after the frame decoding.
  • at least one frame of the audio file may be one or more frames randomly selected in the entire audio file, for example, a signal diagram of the PCM decoded audio signal shown in FIG. 7, the above decoded object If it is a frame, it can be the first A frame, or the middle G frame, or the last 0 frame. If the above decoded object is a multi-frame, it can be the first frame of A, B, and C. It can also be the middle 0, H, I three frames, or it can be discrete eight, E, H three frames.
  • At least one of the above frames is preferably a discrete multiframe, thereby reducing misjudgment of audio files in subsequent processes. Improve the accuracy of playing audio files.
  • the multimedia terminal superimposes the left channel signal and the right channel signal of at least one frame of the audio file and acquires the superimposed superimposed signal.
  • the superposition is to sum the two values. Specifically, the multimedia terminal sums the left channel signal and the right channel signal of at least one frame of the audio file, and the summed value is a superimposed signal, and the multimedia terminal acquires the superimposed signal.
  • the multimedia terminal determines whether the amplitude of the superimposed signal is within a preset range, and if the amplitude of the superimposed signal is within a preset range, determining a left channel signal and a right sound of all frames of the audio file
  • the channel signal is reversed.
  • the multimedia terminal determines whether the left channel signal and the right channel signal of all frames of the audio file are reversed according to whether the amplitude of the superimposed signal is within a preset range.
  • the foregoing determining method may specifically be:
  • a partial audio signal is decoded by a PCM signal.
  • the left and right channels of the audio signal are reversed, the left channel signals A1, Bl, and CI are respectively associated with the right channel signals A2 and B2.
  • the superimposed signals Al+A2, Bl+B2, C1+C2 are obtained. Since IA1I « IA2I, IB1I « IB2I, IC1 « IC2I, then Al+A2 « 0, Bl+B2 « 0, Cl+C2 « 0 .
  • another partial audio signal is decoded by the PCM signal.
  • the left and right channels of the audio signal are in the same direction, the left channel signals A1, Bl, and CI are respectively associated with the right channel signal A2.
  • the superimposed signals Al+A2, Bl+B2, and C1+C2 are obtained.
  • the foregoing preset method may directly: determine whether the amplitude of the superimposed signal is zero, and if the amplitude of the superimposed signal is zero, determine that the left channel signal of all frames of the audio file is opposite to the right channel signal.
  • the multimedia terminal decodes all frames of the audio file, and decodes all frames of the audio file obtained after decoding.
  • the left channel signal and the right channel signal are adjusted in the same direction.
  • the multimedia terminal learns that the left channel signal of all frames of the audio file is opposite to the right channel signal, all the frames of the audio file can be decoded and the decoded left and right channel signals are adjusted.
  • the whole signal is in the same direction.
  • the specific adjustment method may be: keeping the left channel signal of all frames of the audio file unchanged, inverting the right channel signal of all frames of the audio file, or maintaining the right channel signal of all frames of the audio file. The same, the left channel signal of all frames of the audio file is inverted.
  • the multimedia terminal superimposes and plays the left channel signal and the right channel signal of all frames of the audio file that are adjusted to be in the same direction.
  • the multimedia terminal in order to simultaneously retain the information of the left channel signal and the right channel signal, the multimedia terminal superimposes the left channel signal and the right channel signal of all the frames of the same audio file to obtain a new signal.
  • the new signal is played simultaneously on the left and right channels of the audio output device.
  • the left channel audio or headphones, right channel audio, or headphones simultaneously output the same music.
  • FIG. 10 a superimposed signal diagram, signals obtained by superimposing mono signals of the left and right channels (ie, signals superimposed by two channels in the figure) may appear.
  • the larger the amplitude, the louder the volume, and the excessive volume will reduce the user experience.
  • the amplitude of the signal exceeds the channel signal threshold, the signal will be cut off and distortion will occur.
  • the above-mentioned channel signal threshold value refers to the maximum value allowed by the channel signal, for example:
  • the general channel signal is a 16-bit binary code, wherein, after the symbol code is removed, the value ranges from -65535 to +65535, when double-voiced When the code value of the track superimposed signal is greater than +655535 or less than -65535, the signal will be truncated.
  • the multimedia terminal superimposes the left channel signal and the right channel signal of all the frames of the same audio file to be reduced by a preset ratio.
  • the preset ratio may be 50%. According to the mathematical derivation of the cartridge, the 50% preset ratio not only avoids signal truncation, but also does not significantly change the final volume.
  • the pre-decoded left and right channel signals are analyzed by pre-decoding a partial frame of the audio file, thereby identifying whether the left and right channel signals of the audio file are reversed, and the left and right channel signals are
  • the reverse audio file is processed, that is, the left and right channel signals are adjusted to be in the same direction and superimposed, and finally the audio file is played without distortion on the audio output device of the mono output mechanism according to the processed signal, thereby improving user experience.
  • 2 is a flow diagram of another method for playing an audio file in a multimedia terminal in an embodiment of the present invention; Schematic diagram. The flow of the method for playing an audio file in this embodiment as shown in the figure may include:
  • the multimedia terminal acquires a play instruction for the audio file.
  • the multimedia terminal acquires a play instruction for the audio file, and performs the following steps S202 to S210 under the play command.
  • the multimedia terminal decodes at least one frame of the audio file, and acquires a left channel signal and a right channel signal of at least one frame of the audio file.
  • the audio file is mainly for a two-channel audio file, and each audio file may be split into a plurality of consecutive frames according to a certain unit.
  • the audio file needs to be decoded before being played, in the present invention.
  • the above decoding may be PCM decoding.
  • the multimedia terminal first decodes at least one frame of the audio file to obtain the left channel signal and the right channel signal after the frame decoding.
  • at least one frame of the audio file may be one or more frames randomly selected in the entire audio file, for example, a signal diagram of the PCM decoded audio signal shown in FIG. 7, the above decoded object If it is a frame, it can be the first A frame, or the middle G frame, or the last 0 frame. If the above decoded object is a multi-frame, it can be the first frame of A, B, and C. It can also be the middle 0, H, I three frames, or it can be discrete eight, E, H three frames.
  • At least one of the above frames is preferably a discrete multiframe, thereby reducing misjudgment of audio files in subsequent processes. Improve the accuracy of playing audio files.
  • the multimedia terminal superimposes the left channel signal and the right channel signal of at least one frame of the audio file, and acquires the superimposed superimposed signal.
  • the superposition is to sum the two values. Specifically, the multimedia terminal sums the left channel signal and the right channel signal of at least one frame of the audio file, and the summed value is a superimposed signal, and the multimedia terminal acquires the superimposed signal.
  • the multimedia terminal determines whether the amplitude of the superposed signal is within a preset range.
  • a partial audio signal is decoded by a PCM signal.
  • the left and right channels of the audio signal are reversed, the left channel signals A1, Bl, and CI are respectively associated with the right channel signals A2 and B2.
  • the superimposed signals Al+A2, Bl+B2, C1+C2 are obtained. Since IA1I « IA2I, IB1I « IB2I, IC1 « IC2I, then Al+A2 « 0, Bl+B2 « 0, Cl+C2 « 0 .
  • another partial audio signal is decoded by the PCM signal.
  • the left and right channels of the audio signal are in the same direction, the left channel signals A1, Bl, and CI are respectively associated with the right channel signal A2.
  • the superimposed signals Al+A2, Bl+B2, and C1+C2 are obtained.
  • the multimedia terminal determines that the left channel signal of all frames of the audio file is opposite to the right channel signal.
  • two channels are the same direction signals
  • the other is that the two channels are reverse signals
  • the above-mentioned same direction signals are the same signals, for example, two positive signals.
  • the reverse signal is a signal with the opposite sign, for example, two positive and negative signals.
  • the multimedia terminal sets a reverse identifier for the play instruction.
  • the reverse identifier is set for later query. For example, when the multimedia terminal is idle, it is determined in advance whether the left and right channel signals of an audio file in the local media library are reversed, and if the reverse direction is set, the reverse identifier is set to immediately know the channel status when the audio file is executed. .
  • the play command is associated with a corresponding parameter variable
  • the multimedia terminal can set the value of the parameter variable.
  • the value of the parameter variable is set to 1, it can be expressed for playing.
  • the instruction setting has a reverse identifier. If it is set to 0, it can indicate that the reverse identifier is not set.
  • the multimedia terminal detects whether the reverse identifier is set for the play instruction. Specifically, before decoding all the frames of the audio file, the multimedia terminal detects whether a reverse identifier is set for the play instruction.
  • the multimedia terminal detects whether the value of the parameter variable in the play command is 1, such as If it is 1, the reverse flag is set for the playback command. If it is 0, it is not.
  • the multimedia terminal decodes all the frames of the audio file, and adjusts the left channel signal and the right channel signal of all frames of the audio file obtained after decoding to In the same direction.
  • the multimedia terminal decodes all the frames of the audio file and adjusts the decoded left and right channel signals to the same direction. signal of.
  • the specific adjustment method may be: keeping the left channel signal of all frames of the audio file unchanged, inverting the right channel signal of all frames of the audio file, or maintaining the right channel signal of all frames of the audio file. The same, the left channel signal of all frames of the audio file is inverted.
  • the multimedia terminal superimposes and plays the left channel signal and the right channel signal of all the frames of the audio file that are adjusted to be in the same direction by a preset ratio.
  • the multimedia terminal adjusts the left channel signal and the right channel signal of all frames of the same audio file to be reduced by a preset ratio and then superimposed. , get a new signal, and play the new signal simultaneously on the left and right channels of the audio output device.
  • the left channel audio or headphones, right channel audio, or headphones simultaneously output the same music.
  • the multimedia terminal reduces the left channel signal and the right channel signal of the audio file by a preset ratio and then superimposes is as follows: a superimposed signal diagram as shown in FIG. 10, left and right
  • the signal obtained by superimposing the mono signal of the channel may have an excessive amplitude.
  • the larger the amplitude, the louder the volume, and the excessive volume will reduce the user experience. .
  • the amplitude of the signal exceeds the channel signal threshold, the signal will be cut off and distortion will occur.
  • the above-mentioned channel signal threshold value refers to the maximum value allowed by the channel signal, for example:
  • the general channel signal is a 16-bit binary code, wherein, after the symbol code is removed, the value ranges from -65535 to +65535, when double-voiced When the code value of the track superimposed signal is greater than +655535 or less than -65535, the signal will be truncated.
  • the multimedia terminal clears the reverse identifier.
  • the multimedia terminal clears the reverse identifier set by the play instruction, so as to avoid causing mishandling to other subsequent audio files.
  • the embodiment of the present invention sets a play instruction for the audio file, and under the play command, the multimedia terminal analyzes the pre-decoded left and right channel signals, and recognizes the audio files with the left and right channel signals reversed, and plays in the play Set the reverse flag in the command.
  • FIG. 3 is a schematic flow chart of another method for playing an audio file in a multimedia terminal according to an embodiment of the present invention.
  • the flow of the method for playing an audio file in this embodiment as shown in the figure may include:
  • the multimedia terminal acquires a play instruction for the audio file.
  • the multimedia terminal acquires a play instruction for the audio file, and performs the following steps S302 to S310 under the play command.
  • the multimedia terminal decodes a first frame of the audio file, and acquires a left channel signal and a right channel signal of the first frame of the audio file.
  • the audio file is mainly for a two-channel audio file, and each audio file may be divided into several consecutive frames according to a certain unit.
  • the audio file needs to be PCM decoded before being played.
  • the above decoding may be PCM decoding.
  • the multimedia terminal first decodes a frame of the audio file to obtain a left channel signal and a right channel signal of the frame.
  • the first frame of the above audio file can refer to an A-frame starting from the audio signal PCM decoded signal pattern as shown in FIG.
  • the multimedia terminal superimposes the left channel signal and the right channel signal of the first frame of the audio file and acquires the superimposed superimposed signal.
  • the superposition is to sum the two values. Specifically, the multimedia terminal sums the left channel signal and the right channel signal of the first frame of the audio file, and the summed value is a superimposed signal, and the multimedia terminal acquires the superimposed signal.
  • the multimedia terminal determines whether the amplitude of the superposed signal is within a preset range.
  • the left channel signal A1 is superimposed with the right channel signal A2 to obtain a superimposed signal A1+A2. Since IA1I « IA2I, Al+A2 « 0.
  • a preset range near "0" such as ⁇ 3
  • the superimposed signal satisfies (Al+A2) c [-3,3]
  • the left and right sounds of the audio file can be determined.
  • the channel signal is reversed.
  • another partial audio signal is decoded by the PCM signal.
  • the left and right channels of the audio signal are in the same direction, the left channel signal A1 is superimposed with the right channel signal A2 to be superimposed.
  • Signal A1+A2 if a preset range around "0", such as ⁇ 3, is still set, then obviously the superimposed signal is not in this range, ie (Al+A2) [-3,3], and the audio can be determined
  • the left channel of the file is in the same direction as the right channel signal.
  • the multimedia terminal determines that the left channel signal of all frames of the audio file is opposite to the right channel signal.
  • the two channels are the same direction signals
  • the other is that the two channels are the reverse signals
  • the above-mentioned same direction signals are the same signals, for example, two positive signals.
  • the reverse signal is a signal with the opposite sign, for example, two positive and negative signals.
  • the multimedia terminal sets a reverse identifier for the play instruction.
  • the reverse identifier is set for later query. For example, when the multimedia terminal is idle, it is determined in advance whether the left and right channel signals of an audio file in the local media library are reversed, and if the reverse direction is set, the reverse identifier is set to immediately know the channel status when the audio file is executed. .
  • the play command is associated with a corresponding parameter variable
  • the multimedia terminal can set the value of the parameter variable.
  • the value of the parameter variable is set to 1, it can be expressed for playing.
  • the instruction setting has a reverse identifier. If it is set to 0, it can indicate that the reverse identifier is not set.
  • the multimedia terminal detects whether the reverse identifier is set for the play instruction. Specifically, before the multimedia file is formally decoded, the multimedia terminal detects whether a reverse identifier is set for the play instruction. In an optional implementation manner, the multimedia terminal detects whether the value of the parameter variable in the play command is 1, and if it is 1, the reverse flag is set for the play command, and if it is 0, it does not.
  • the multimedia terminal decodes all frames of the audio file, and keeps the left channel signal of all frames of the audio file unchanged, and all frames of the audio file are Right channel signal.
  • the multimedia terminal knows that the left channel signal of the audio file is reversed from the right channel signal by the reverse identifier, all the frames of the audio file are decoded and the left channel signal obtained by the decoding is kept unchanged, and the audio file is changed.
  • the right channel signal of all frames is inverted.
  • the multimedia terminal superimposes and plays the left channel signal and the right channel signal of all the frames of the audio file that are adjusted to be in the same direction by 50%.
  • the multimedia terminal adjusts the left channel signal and the right channel signal of all the frames of the same audio file to be reduced by 50%, and then superimposed. , get a new signal, and play the new signal simultaneously on the left and right channels of the audio output device.
  • the left channel audio or headphones, right channel audio, or headphones simultaneously output the same music.
  • the multimedia terminal reduces the left channel signal and the right channel signal of the audio file by 50% and then superimposes is as follows: a superimposed signal diagram as shown in FIG. 10, left and right
  • the signal obtained by superimposing the mono signal of the channel may have an excessive amplitude.
  • the larger the amplitude, the louder the volume, and the excessive volume will reduce the user experience. .
  • the amplitude of the signal exceeds the channel signal threshold, the signal will be cut off and distortion will occur.
  • the above-mentioned channel signal threshold value refers to the maximum value allowed by the channel signal, for example:
  • the general channel signal is a 16-bit binary code, wherein, after the symbol code is removed, the value ranges from -65535 to +65535, when double-voiced When the code value of the track superimposed signal is greater than +655535 or less than -65535, the signal will be truncated.
  • the 50% preset ratio not only avoids signal truncation, but also does not significantly change the final volume.
  • the multimedia terminal clears the reverse identifier.
  • the multimedia terminal clears the reverse identifier set for the playback instruction, so as to avoid erroneous processing on subsequent audio files.
  • the embodiment of the invention sets a play instruction for the audio file, and under the play instruction, the multimedia The terminal analyzes the pre-decoded left and right channel signals, recognizes the audio files whose left and right channel signals are reversed, and sets a reverse identifier in the play command. Before decoding the audio file, the multimedia terminal first detects whether there is a reverse identifier under the play command, and if so, keeps the left channel signal of the audio file unchanged, and inverts the right channel signal to implement left and right sounds. The signals are in the same direction, and the backward signals are scaled down by 50%, and finally the left and right channel signals are reversed without distortion on the audio output device of the mono output mechanism according to the processed signals. Audio files to enhance the user experience. FIG.
  • the multimedia terminal of the invention comprises smart terminals such as smart phones, PAD, MP3 and MP4.
  • the multimedia terminal in the embodiment of the present invention may include at least an audio decoding module 410, a signal superimposing module 420, a signal judging module 430, a signal adjusting module 440, and an audio playing module 450, where:
  • the audio decoding module 410 is configured to decode at least one frame of the audio file, and obtain a left channel signal and a right channel signal of at least one frame of the audio file.
  • the audio file is mainly for a two-channel audio file, and each audio file may be split into a plurality of consecutive frames according to a certain unit.
  • the audio file needs to be decoded before being played, in the present invention.
  • the above decoding may be PCM decoding.
  • the audio decoding module 410 decodes at least one frame of the audio file before performing PCM decoding on the audio file to obtain the left channel signal and the right channel signal after the frame decoding.
  • at least one frame of the audio file may be one or more frames randomly selected in the entire audio file, for example, a signal diagram of the PCM decoded audio signal shown in FIG. 7, the above decoded object If it is a frame, it may be the initial A frame, or the middle G frame, or the last 0 frame. If the above decoded object is a multi-frame, it may be the start A, B, C. The frame may also be the intermediate 0, H, and I frames, or may be discrete eight, E, and H frames.
  • At least one of the above frames is preferably a discrete multiframe, thereby reducing misjudgment of audio files in subsequent processes and improving the accuracy of playing audio files.
  • the signal superimposing module 420 is configured to superimpose the left channel signal and the right channel signal of at least one frame of the audio file and obtain the superimposed superimposed signal.
  • the superposition is to sum the two values.
  • the signal overlay module 420 will The left channel signal and the right channel signal of one frame are summed, and the summed value is a superimposed signal, and the multimedia terminal acquires the superimposed signal.
  • the signal determining module 430 is configured to determine whether the amplitude of the superimposed signal is within a preset range, and if the amplitude of the superimposed signal is within a preset range, determine a left channel signal of all frames of the audio file. Reversed to the right channel signal.
  • the signal determining module 430 determines whether the left channel signal and the right channel signal of all the frames of the audio file are reversed according to whether the amplitude of the superimposed signal is within a preset range.
  • the foregoing determining method may specifically be:
  • a partial audio signal is decoded by a PCM signal.
  • the left and right channels of the audio signal are reversed, the left channel signals A1, Bl, and CI are respectively associated with the right channel signals A2 and B2.
  • the superimposed signals Al+A2, Bl+B2, C1+C2 are obtained. Since IA1I « IA2I, IB1I « IB2I, IC1 « IC2I, then Al+A2 « 0, Bl+B2 « 0, Cl+C2 « 0 .
  • another partial audio signal is decoded by the PCM signal.
  • the left and right channels of the audio signal are in the same direction, the left channel signals A1, Bl, and CI are respectively associated with the right channel signal A2.
  • the superimposed signals Al+A2, Bl+B2, and C1+C2 are obtained.
  • the foregoing preset method may directly be: determining whether the amplitude of the superimposed signal is zero, and if the amplitude of the superimposed signal is zero, determining that the left channel signal of the audio file is opposite to the right channel signal.
  • the signal adjustment module 440 is configured to: if the left channel signal of the entire frame of the audio file is inverted with the right channel signal, decode all the frames of the audio file, and decode the obtained audio file. The left channel signal and the right channel signal of all the frames are adjusted in the same direction.
  • the signal adjusting module 440 can decode all the frames of the audio file and decode the left and right sounds.
  • the channel signal is adjusted to the same direction signal.
  • the specific adjustment method may be: keeping the left channel signal of the audio file unchanged, inverting the right channel signal of the audio file, or keeping the right channel signal of the audio file unchanged, and the left sound of the audio file The signal is inverted.
  • the audio playing module 450 is configured to superimpose and play the left channel signal and the right channel signal of all frames of the audio file adjusted to be in the same direction.
  • the audio playing module 450 in order to simultaneously retain the information of the left channel signal and the right channel signal, the audio playing module 450 superimposes the left channel signal and the right channel signal of all frames adjusted to the same audio file to obtain a new one. Signal and play the new signal simultaneously on the left and right channels of the audio output device. For example, the left channel audio or headphones, right channel audio, or headphones simultaneously output the same music.
  • FIG. 10 a superimposed signal diagram, signals obtained by superimposing mono signals of the left and right channels (ie, signals superimposed by two channels in the figure) may appear.
  • the larger the amplitude, the louder the volume, and the excessive volume will reduce the user experience.
  • the amplitude of the signal exceeds the channel signal threshold, the signal will be cut off and distortion will occur.
  • the above-mentioned channel signal threshold value refers to the maximum value allowed by the channel signal, for example:
  • the general channel signal is a 16-bit binary code, wherein, after the symbol code is removed, the value ranges from -65535 to +65535, when double-voiced When the code value of the track superimposed signal is greater than +655535 or less than -65535, the signal will be truncated.
  • the audio play module 450 superimposes the left channel signal and the right channel signal of all frames adjusted to the same audio file by a preset ratio and then superimposes the amplitude.
  • the preset ratio may be 50%. According to the mathematical derivation of the cartridge, the 50% preset ratio not only avoids signal truncation, but also does not significantly change the final volume.
  • the multimedia terminal may further include a play instruction, and the reverse identifier is set.
  • the module 470 and the reverse identity clearing module 480 wherein:
  • the play instruction acquisition module 460 is configured to acquire a play instruction for the audio file to trigger the audio pre-decoding module.
  • the play instruction acquisition module 460 obtains a play instruction for the audio file, and triggers the audio decoding module under the play command.
  • the reverse identifier setting module 470 is configured to set a reverse identifier for the play command if it is determined that the left channel signal of all frames of the audio file is opposite to the right channel signal.
  • the reverse identity setting module 470 sets the reverse identity for later query. If the multimedia terminal is idle, it is determined in advance whether the left and right channel signals of an audio file in the local media library are reversed. If the reverse direction, the reverse identifier setting module 470 sets the reverse identifier to enable the audio file to be executed. Immediately know the status of its channel.
  • the reverse identifier setting module 470 is provided with a corresponding parameter variable, and the multimedia terminal can set the value of the parameter variable.
  • the value of the parameter variable is set to 1
  • the reverse indication is set for the play instruction, and if it is set to 0, it can mean that the reverse identifier is not set.
  • the reverse identifier clearing module 480 is configured to clear the reverse identifier after the audio playing module plays the new audio signal.
  • the reverse identifier clearing module 480 clears the reverse identifier set for the play command to avoid misprocessing of subsequent audio files.
  • the signal adjustment module 440 may further include: a reverse identifier detection unit 441 and a signal adjustment unit 442, where:
  • the reverse identifier detecting unit 441 is configured to detect whether the reverse identifier is set for the play instruction before decoding the audio file.
  • the reverse identification detecting unit 441 detects whether a reverse identification is set for the playback instruction before the audio file is formally decoded.
  • the reverse identifier detecting unit 441 detects whether the value of the parameter variable in the play command is 1 or not. If it is 1, the reverse flag is set for the play command, and if it is 0, it is not.
  • a signal adjustment unit 442 configured to: if the reverse identifier is detected, the audio file All frames are decoded, and the left channel signal and the right channel signal of all frames of the audio file obtained after decoding are adjusted to be in the same direction.
  • the signal adjustment unit 442 knows that the left channel signal of the audio file is inverted with the right channel signal, the entire frame of the audio file is decoded and the decoded left and right channel signals are adjusted to The same direction signal.
  • FIG. 6 is a schematic structural diagram of another multimedia terminal according to an embodiment of the present invention.
  • the multimedia terminal may include: at least one processor 601, such as a CPU (Central Processing Unit), and a memory 602.
  • the communication bus 603 is used to implement connection communication between these components.
  • the audio output device 604 is used to convert the channel signal of the audio file into sound.
  • the memory 602 can be a high speed RAM memory or a non-volatile memory such as at least one disk memory. Memory 602 can also be at least one storage device located remotely from processor 602. A set of program codes is stored in the memory 602, and the processor is configured to call program code stored in the memory for performing the following operations:
  • the left channel signal and the right channel signal of all frames of the audio file adjusted to be in the same direction are overlapped and played.
  • the processor 601 determines whether the amplitude of the superposed signal is within a preset range. Yes:
  • the processor 601 determines that the left channel signal of all frames of the audio file is opposite to the right channel signal.
  • the specific operations performed by the processor 601 may further include:
  • the multimedia terminal sets a reverse flag for the play command.
  • the processor 601 can detect whether the left channel signal and the right channel signal of all frames of the audio file are reversed by detecting whether the reverse identifier is set for the play instruction.
  • the processor 601 detects the reverse identifier, the entire frame of the audio file is decoded and the left channel signal and the right channel signal are adjusted to be in the same direction.
  • the reverse identifier is cleared.
  • the processor 601 decodes all frames of the audio file and adjusts the left channel signal and the right channel signal to perform the same operation in the same direction:
  • the right channel signal of all frames of the audio file is kept unchanged, and the left channel signal of all frames of the audio file is inverted.
  • the processor 601 superimposes the left channel signal and the right channel signal of all frames of the audio file that are adjusted to be in the same direction.
  • the specific operation may be:
  • the left channel signal and the right channel signal of all the frames of the audio file adjusted to be in the same direction are superimposed by a preset ratio reduction amplitude.
  • the preset ratio can be 50%.
  • the embodiment of the present invention further provides a computer storage medium, where the computer storage medium stores a program, and the program execution includes an audio file played in a multimedia terminal according to an embodiment of the present invention in combination with FIG. 1 to FIG. Methods.
  • the invention analyzes the pre-decoded left and right channel signals by pre-decoding a partial frame of the audio file, thereby identifying whether the left and right channel signals of the audio file are reversed, and reversing the left and right channel signals. of The audio file is processed, that is, the left and right channel signals are adjusted to be in the same direction and superimposed, and finally the audio file is played without distortion on the audio output device of the mono output mechanism according to the processed signal.
  • the present invention further provides a play instruction for the above process, in which the recognized audio files of the left and right channel signals are reversely identified, which facilitates the multimedia terminal to execute according to the reverse identifier. Processing of audio files. Further, the present invention adjusts the left and right channel signals to the same direction, and then reduces the amplitude by 50% and then superimposes to avoid signal truncation without significantly changing the volume of the volume, thereby improving the user experience.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Physics & Mathematics (AREA)
  • Acoustics & Sound (AREA)
  • Signal Processing (AREA)
  • Stereophonic System (AREA)

Abstract

Disclosed is an audio file playing method, comprising: pre-decoding at least one frame of an audio file; judging whether left sound-channel signals and right sound-channel signals of all the frames of the audio file are in reverse directions according to a left sound-channel signal and a right sound-channel signal of the at least one frame which is obtained after pre-decoding; if the left sound-channel signals and the right sound-channel signals of all the frames of the audio file are in reverse directions, decoding all the frames of the audio file, and adjusting the left sound-channel signals and the right sound-channel signals of all the frames of the audio file to be in the same direction; and superposing the left sound-channel signals and the right sound-channel signals of all the frames of the audio file that are adjusted to be in the same direction and playing same. Accordingly, also provided is a multimedia terminal. By means of the present invention, an audio file with left and right sound-channel signals being in reverse directions can be un-distortedly played on a multimedia terminal with a single-sound-channel output mechanism, thereby improving user experience.

Description

一种在多媒体终端中播放音频文件的方法及多媒体终端 技术领域  Method for playing audio file in multimedia terminal and multimedia terminal
本发明涉及音视频技术领域,尤其涉及一种在多媒体终端中播放音频文件 的方法及多媒体终端。 背景技术  The present invention relates to the field of audio and video technologies, and in particular, to a method for playing an audio file in a multimedia terminal and a multimedia terminal. Background technique
随着电子技术的不断发展, 各式各样的多媒体终端应运而生, 其中以能够 播放例如 MP3、 WAV, WMA等格式音频文件的智能终端最受欢迎。 上述格 式音频文件的声道编码方式分为单声道编码和双声道编码,而大多智能终端上 的音频输出设备采用的是单声道输出机制,因此在播放双声道音频文件时需要 做混音技术处理。  With the continuous development of electronic technology, a variety of multimedia terminals have emerged, among which smart terminals capable of playing audio files in formats such as MP3, WAV, WMA and the like are most popular. The channel coding mode of the above format audio file is divided into mono coding and two-channel coding, and most of the audio output devices on the intelligent terminal adopt a mono output mechanism, so it is necessary to play the two-channel audio file. Mixing technology processing.
目前,基于 Android平台的智能终端使用单声道输出机制播放双声道音频 文件时,通常的混音方法是对双声道数据进行筒单叠加, 以达到保留双声道信 息的效果。 但是, 对于部分特殊的双声道音频文件, 例如左、 右声道信号反向 时, 进行筒单叠加会使信号失真, 导致异常的播放结果。 发明内容  At present, when a smart terminal based on the Android platform uses a mono output mechanism to play a two-channel audio file, the usual mixing method is to superimpose the two-channel data to achieve the effect of retaining the two-channel information. However, for some special two-channel audio files, such as the left and right channel signals are reversed, the single-stack overlay will distort the signal, resulting in abnormal playback results. Summary of the invention
本发明实施例提供了一种在多媒体终端中播放音频文件的方法及多媒体 终端, 可以实现在单声道输出机制的多媒体终端上无失真地播放左、右声道信 号反向的音频文件, 增强用户体验。  The embodiment of the invention provides a method for playing an audio file in a multimedia terminal and a multimedia terminal, which can realize the audio file with the left and right channel signals reversed without distortion in the multimedia terminal of the mono output mechanism, and is enhanced. user experience.
本发明实施例第一方面提供了一种音频文件的播放方法, 包括: 多媒体终端对音频文件的至少一帧进行解码,获取所述音频文件的至少一 帧的左声道信号与右声道信号;  A first aspect of the embodiments of the present invention provides a method for playing an audio file, including: decoding, by a multimedia terminal, at least one frame of an audio file, and acquiring a left channel signal and a right channel signal of at least one frame of the audio file. ;
多媒体终端将所述音频文件的至少一帧的左声道信号与右声道信号进行 叠加并获取叠加后的叠加信号;  The multimedia terminal superimposes the left channel signal and the right channel signal of at least one frame of the audio file and acquires the superimposed superimposed signal;
多媒体终端判断所述叠加信号的幅值是否在预设范围内,若所述叠加信号 的幅值在预设范围内,则判定所述音频文件的全部帧的左声道信号与右声道信 号反向;  The multimedia terminal determines whether the amplitude of the superimposed signal is within a preset range, and if the amplitude of the superimposed signal is within a preset range, determining a left channel signal and a right channel signal of all frames of the audio file Reverse
若所述音频文件的全部帧的左声道信号与右声道信号反向,多媒体终端则 对所述音频文件的全部帧解码,并将解码后得到的所述音频文件的全部帧的左 声道信号与右声道信号调整为同向; If the left channel signal of all frames of the audio file is opposite to the right channel signal, the multimedia terminal is Decoding all the frames of the audio file, and adjusting the left channel signal and the right channel signal of all frames of the audio file obtained after decoding to the same direction;
多媒体终端将调整为同向的所述音频文件的全部帧的左声道信号与右声 道信号进行叠加并播放。  The multimedia terminal superimposes and plays the left channel signal and the right channel signal of all frames of the audio file adjusted in the same direction.
在第一方面的第一种可能实现方式中,所述多媒体终端判断所述叠加信号 的幅值是否在预设范围内, 若所述叠加信号的幅值在预设范围内, 则判定所述 音频文件的全部帧的左声道信号与右声道信号反向包括:  In a first possible implementation manner of the first aspect, the multimedia terminal determines whether the amplitude of the superimposed signal is within a preset range, and if the amplitude of the superimposed signal is within a preset range, determining the The reverse of the left channel signal and the right channel signal of all frames of the audio file includes:
多媒体终端判断所述叠加信号的幅值是否为零,若所述叠加信号的幅值为 零, 则判定所述音频文件的全部帧的左声道信号与右声道信号反向。  The multimedia terminal determines whether the amplitude of the superimposed signal is zero. If the amplitude of the superimposed signal is zero, it is determined that the left channel signal of all frames of the audio file is opposite to the right channel signal.
结合第一方面以及第一方面的第一种可能实现方式,在第二种可能实现方 式中, 所述多媒体终端对音频文件的至少一帧进行解码, 获取所述音频文件的 至少一帧的左声道信号与右声道信号之前还包括:  With reference to the first aspect, and the first possible implementation manner of the first aspect, in a second possible implementation, the multimedia terminal decodes at least one frame of the audio file, and obtains at least one frame of the audio file The channel signal and the right channel signal also include:
多媒体终端获取针对所述音频文件的播放指令;  The multimedia terminal acquires a play instruction for the audio file;
所述多媒体终端判断所述叠加信号的幅值是否在预设范围内,若所述叠加 信号的幅值在预设范围内,则判定所述音频文件的全部帧的左声道信号与右声 道信号反向之后还包括:  Determining, by the multimedia terminal, whether the amplitude of the superimposed signal is within a preset range, and if the amplitude of the superimposed signal is within a preset range, determining a left channel signal and a right sound of all frames of the audio file After the channel signal is reversed, it also includes:
若判定所述音频文件的全部帧的左声道信号与右声道信号反向,多媒体终 端则针对所述播放指令设置反向标识;  If it is determined that the left channel signal of all frames of the audio file is opposite to the right channel signal, the multimedia terminal sets a reverse identifier for the play instruction;
所述若所述音频文件的全部帧的左声道信号与右声道信号反向,多媒体终 端则对所述音频文件的全部帧解码,并将解码后得到的所述音频文件的全部帧 的左声道信号与右声道信号调整为同向包括:  If the left channel signal of all frames of the audio file is opposite to the right channel signal, the multimedia terminal decodes all frames of the audio file, and decodes all frames of the audio file obtained after decoding. The adjustment of the left channel signal and the right channel signal to the same direction includes:
多媒体终端检测是否针对所述播放指令是否设置有所述反向标识; 若检测到有所述反向标识, 多媒体终端则对所述音频文件的全部帧解码, 并将解码后得到的所述音频文件的全部帧的左声道信号与右声道信号调整为 同向。  The multimedia terminal detects whether the reverse identifier is set for the play instruction; if the reverse identifier is detected, the multimedia terminal decodes all frames of the audio file, and the decoded audio is obtained. The left channel signal and the right channel signal of all frames of the file are adjusted in the same direction.
结合第一方面的第二种可能实现方式,在第三种可能实现方式中, 所述若 检测到有所述反向标识, 多媒体终端则对所述音频文件的全部帧解码, 并将解 码后得到的所述音频文件的全部帧的左声道信号与右声道信号调整为同向之 后还包括: 多媒体终端清除所述反向标识。 With reference to the second possible implementation manner of the first aspect, in a third possible implementation manner, if the reverse identifier is detected, the multimedia terminal decodes all frames of the audio file, and after decoding After the left channel signal and the right channel signal of all the frames of the obtained audio file are adjusted to be in the same direction, the method further includes: The multimedia terminal clears the reverse identity.
结合第一方面以及第一方面的第一或第二或第三种可能实现方式,在第四 种可能实现方式中,所述多媒体终端将调整为同向的所述音频文件的全部帧的 左声道信号与右声道信号进行叠加并播放具体包括:  In combination with the first aspect and the first or second or third possible implementation manner of the first aspect, in a fourth possible implementation manner, the multimedia terminal is adjusted to the left of all frames of the audio file in the same direction The superposition and playback of the channel signal and the right channel signal include:
多媒体终端将调整为同向的所述音频文件的全部帧的左声道信号与右声 道信号按预设比例缩小幅值后进行叠加并播放。  The multimedia terminal adjusts the left channel signal and the right channel signal of all the frames of the audio file in the same direction to reduce the amplitude by a preset ratio, and then superimposes and plays.
结合第一方面的第四种可能实现方式,在第五种可能实现方式中, 所述多 媒体终端将调整为同向的所述音频文件的全部帧的左声道信号与右声道信号 按预设比例缩小幅值后进行叠加并播放具体包括:  In conjunction with the fourth possible implementation of the first aspect, in a fifth possible implementation, the multimedia terminal adjusts the left channel signal and the right channel signal of all frames of the audio file that are adjusted in the same direction. After the scale is reduced, the overlay and play are specifically included:
多媒体终端将调整为同向的所述音频文件的全部帧的左声道信号与右声 道信号按 50%比例缩小幅值后进行叠加并播放。  The multimedia terminal adjusts the left channel signal and the right channel signal of all the frames of the audio file in the same direction to reduce the amplitude by 50%, and superimposes and plays.
在第一方面的第六种可能实现方式中,所述将解码后得到的所述音频文件 的全部帧的左声道信号与右声道信号调整为同向包括:  In a sixth possible implementation manner of the first aspect, the adjusting the left channel signal and the right channel signal of all frames of the audio file obtained after decoding into the same direction includes:
保持所述音频文件的全部帧的左声道信号不变,将所述音频文件的全部帧 的右声道信号反转; 或  Keeping the left channel signal of all frames of the audio file unchanged, inverting the right channel signal of all frames of the audio file; or
保持所述音频文件的全部帧的右声道信号不变,将所述音频文件的全部帧 的左声道信号反转。  The right channel signal of all frames of the audio file is kept unchanged, and the left channel signal of all frames of the audio file is inverted.
结合第一方面以及第一方面的第一、第二或第三种可能实现方式,在第七 种可能的实现方式中, 所述音频文件的至少一帧包括:  With reference to the first aspect, and the first, second, or third possible implementation manner of the first aspect, in a seventh possible implementation, the at least one frame of the audio file includes:
所述音频文件的起始第一帧或离散的至少两帧。  The first frame of the audio file or the discrete at least two frames.
本发明实施例第二方面提供了一种多媒体终端, 包括:  A second aspect of the embodiments of the present invention provides a multimedia terminal, including:
音频解码模块, 用于对音频文件的至少一帧进行解码,获取所述音频文件 的至少一帧的左声道信号与右声道信号;  An audio decoding module, configured to decode at least one frame of the audio file, and acquire a left channel signal and a right channel signal of at least one frame of the audio file;
信号叠加模块,用于将所述音频文件的至少一帧的左声道信号与右声道信 号进行叠加并获取叠加后的叠加信号;  a signal superimposing module, configured to superimpose a left channel signal of at least one frame of the audio file and a right channel signal, and obtain a superimposed superimposed signal;
信号判断模块, 用于判断所述叠加信号的幅值是否在预设范围内, 若所述 叠加信号的幅值在预设范围内,则判定所述音频文件的全部帧的左声道信号与 右声道信号反向;  a signal judging module, configured to determine whether a magnitude of the superimposed signal is within a preset range, and if a magnitude of the superimposed signal is within a preset range, determining a left channel signal of all frames of the audio file The right channel signal is reversed;
信号调整模块,用于若所述音频文件的全部帧的左声道信号与右声道信号 反向, 则对所述音频文件的全部帧解码, 并将解码后得到的所述音频文件的全 部帧的左声道信号与右声道信号调整为同向; a signal adjustment module for the left channel signal and the right channel signal of all frames of the audio file In the reverse direction, all the frames of the audio file are decoded, and the left channel signal and the right channel signal of all frames of the audio file obtained after decoding are adjusted to be in the same direction;
音频播放模块,用于将调整为同向的所述音频文件的全部帧的左声道信号 与右声道信号进行叠加并播放。  And an audio playing module, configured to superimpose and play the left channel signal and the right channel signal of all frames of the audio file adjusted to be in the same direction.
在第二方面的第一种可能实现方式中,所述信号判断模块用于判断所述叠 加信号的幅值是否为零, 若所述叠加信号的幅值为零, 则判定所述音频文件的 全部帧的左声道信号与右声道信号反向。  In a first possible implementation manner of the second aspect, the signal determining module is configured to determine whether the amplitude of the superimposed signal is zero, and if the amplitude of the superimposed signal is zero, determine the audio file. The left channel signal of all frames is inverted with the right channel signal.
结合第二方面以及第二方面的第一种可能实现方式,在第二种可能实现方 式中, 所述多媒体终端还包括:  With reference to the second aspect, and the first possible implementation manner of the second aspect, in the second possible implementation, the multimedia terminal further includes:
播放指令获取模块,用于获取针对所述音频文件的播放指令以触发所述音 频解码模块;  a play instruction acquisition module, configured to acquire a play instruction for the audio file to trigger the audio decoding module;
反向标识设置模块,用于若判定所述音频文件的全部帧的左声道信号与右 声道信号反向, 则针对所述播放指令设置反向标识;  a reverse identifier setting module, configured to: if it is determined that the left channel signal of the entire frame of the audio file is opposite to the right channel signal, set a reverse identifier for the play instruction;
所述信号调整模块包括:  The signal adjustment module includes:
反向标识检测单元, 用于在对所述音频文件进行解码之前,检测是否针对 所述播放指令设置有所述反向标识;  a reverse identifier detecting unit, configured to detect whether the reverse identifier is set for the play instruction before decoding the audio file;
信号调整单元, 用于若检测到有所述反向标识, 则对所述音频文件的全部 帧解码,并将解码后得到的所述音频文件的全部帧的左声道信号与右声道信号 调整为同向。  a signal adjustment unit, configured to decode all frames of the audio file if the reverse identifier is detected, and decode the left channel signal and the right channel signal of all frames of the audio file obtained after decoding Adjust to the same direction.
结合第二方面的第二种可能实现方式,在第三种可能实现方式中, 所述多 媒体终端还包括:  With reference to the second possible implementation of the second aspect, in a third possible implementation, the multimedia terminal further includes:
反向标识清除模块,用于在所述音频播放模块播放完所述新音频信号后清 除所述反向标识。  And a reverse identifier clearing module, configured to clear the reverse identifier after the audio playing module plays the new audio signal.
结合第二方面以及第二方面的第一或第二或第三种可能实现方式,在第四 种可能实现方式中,所述音频播放模块用于将调整为同向的所述音频文件的全 部帧的左声道信号与右声道信号按预设比例缩小幅值后进行叠加并播放。  With reference to the second aspect and the first or second or third possible implementation manner of the second aspect, in a fourth possible implementation, the audio playing module is configured to adjust all of the audio files in the same direction The left channel signal and the right channel signal of the frame are scaled down by a preset ratio, and then superimposed and played.
结合第二方面的第四种可能实现方式,在第五种可能实现方式中, 所述音 频播放模块用于将调整为同向的所述音频文件的全部帧的左声道信号与右声 道信号按 50%比例缩小幅值后进行叠加并播放。 在第二方面的第六种可能实现方式中, In conjunction with the fourth possible implementation of the second aspect, in a fifth possible implementation, the audio playback module is configured to adjust a left channel signal and a right channel of all frames of the audio file that are adjusted to be in the same direction The signal is scaled down by 50% and then superimposed and played. In a sixth possible implementation of the second aspect,
所述信号调整模块用于:  The signal adjustment module is used to:
若所述音频文件的全部帧的左声道信号与右声道信号反向,则对所述音频 文件的全部帧解码, 并保持所述音频文件的全部帧的左声道信号不变,将所述 音频文件的全部帧的右声道信号反转; 或  If the left channel signal of all frames of the audio file is opposite to the right channel signal, decoding all frames of the audio file, and keeping the left channel signal of all frames of the audio file unchanged, The right channel signal of all frames of the audio file is inverted; or
若所述音频文件的全部帧的左声道信号与右声道信号反向,则对所述音频 文件的全部帧解码, 并保持所述音频文件的全部帧的右声道信号不变,将所述 音频文件的全部帧的左声道信号反转。  If the left channel signal of all frames of the audio file is inverted with the right channel signal, decoding all frames of the audio file, and keeping the right channel signal of all frames of the audio file unchanged, The left channel signal of all frames of the audio file is inverted.
结合第二方面以及第二方面的第一、第二或第三种可能实现方式,在第七 种可能的实现方式中, 所述音频文件的至少一帧包括:  With reference to the second aspect, and the first, second, or third possible implementation manner of the second aspect, in a seventh possible implementation, the at least one frame of the audio file includes:
所述音频文件的起始第一帧或离散的至少两帧。  The first frame of the audio file or the discrete at least two frames.
本发明实施例第三方面提供了多媒体终端,所述多媒体终端包括音频输出 设备、 存储器以及处理器, 其中, 存储器中存储一组播放器程序, 且处理器用 于调用存储器中存储的播放器程序, 用于执行以下操作:  A third aspect of the embodiments of the present invention provides a multimedia terminal, where the multimedia terminal includes an audio output device, a memory, and a processor, wherein the memory stores a set of player programs, and the processor is configured to call a player program stored in the memory, Used to do the following:
多媒体终端对音频文件的至少一帧进行解码,获取所述音频文件的至少一 帧的左声道信号与右声道信号;  The multimedia terminal decodes at least one frame of the audio file, and acquires a left channel signal and a right channel signal of at least one frame of the audio file;
多媒体终端将所述音频文件的至少一帧的左声道信号与右声道信号进行 叠加并获取叠加后的叠加信号;  The multimedia terminal superimposes the left channel signal and the right channel signal of at least one frame of the audio file and acquires the superimposed superimposed signal;
多媒体终端判断所述叠加信号的幅值是否在预设范围内,若所述叠加信号 的幅值在预设范围内,则判定所述音频文件的全部帧的左声道信号与右声道信 号反向;  The multimedia terminal determines whether the amplitude of the superimposed signal is within a preset range, and if the amplitude of the superimposed signal is within a preset range, determining a left channel signal and a right channel signal of all frames of the audio file Reverse
若所述音频文件的全部帧的左声道信号与右声道信号反向,多媒体终端则 对所述音频文件的全部帧解码,并将解码后得到的所述音频文件的全部帧的左 声道信号与右声道信号调整为同向;  If the left channel signal of all the frames of the audio file is opposite to the right channel signal, the multimedia terminal decodes all the frames of the audio file, and the left frame of all the frames of the audio file obtained after decoding The channel signal and the right channel signal are adjusted to be in the same direction;
多媒体终端将调整为同向的所述音频文件的全部帧的左声道信号与右声 道信号进行叠加并播放。  The multimedia terminal superimposes and plays the left channel signal and the right channel signal of all frames of the audio file adjusted in the same direction.
由上可见, 本发明实施例通过对音频文件的部分帧预解码, 分析预解码后 的左、右声道信号,从而识别出音频文件的左、右声道信号是否反向,并对左、 右声道反向的音频文件进行处理, 即将其左、 右声道信号调整为同向并叠加, 实现在单声道输出机制的音频输出设备上无失真地播放该音频文件,提高用户 体验。 附图说明 As can be seen from the above, the embodiment of the present invention analyzes the pre-decoded left and right channel signals by pre-decoding a partial frame of the audio file, thereby identifying whether the left and right channel signals of the audio file are reversed, and to the left, The audio file in the reverse direction of the right channel is processed, that is, the left and right channel signals are adjusted to be in the same direction and superimposed. The audio file is played without distortion on the audio output device of the mono output mechanism, thereby improving the user experience. DRAWINGS
为了更清楚地说明本发明实施例的技术方案,下面将对实施例中所需要使 用的附图作筒单地介绍,显而易见地, 下面描述中的附图仅仅是本发明的一些 实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还可 以根据这些附图获得其他的附图。  In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the embodiments will be briefly described below. Obviously, the drawings in the following description are only some embodiments of the present invention, Those skilled in the art can also obtain other drawings based on these drawings without paying any creative work.
图 1 是本发明实施例提供的一种在多媒体终端中播放音频文件的方法的 流程示意图;  1 is a schematic flowchart of a method for playing an audio file in a multimedia terminal according to an embodiment of the present invention;
图 2是本发明实施例提供的另一种在多媒体终端中播放音频文件的方法 的流程示意图;  2 is a schematic flowchart of another method for playing an audio file in a multimedia terminal according to an embodiment of the present invention;
图 3 是本发明实施例提供的另一种在多媒体终端中播放音频文件的方法 的流程示意图;  3 is a schematic flowchart of another method for playing an audio file in a multimedia terminal according to an embodiment of the present invention;
图 4是本发明实施例提供的一种多媒体终端的结构示意图;图 5是本发明 实施例提供的一种信号调整模块的结构示意图;  4 is a schematic structural diagram of a multimedia terminal according to an embodiment of the present invention; FIG. 5 is a schematic structural diagram of a signal adjustment module according to an embodiment of the present invention;
图 6是本发明实施例提供的另一种多媒体终端的结构示意图;  6 is a schematic structural diagram of another multimedia terminal according to an embodiment of the present invention;
图 7是本发明实施例提供的一种音频信号 PCM解码后的信号图; 图 8是本发明实施例提供的一种部分音频信号 PCM解码后的信号图; 图 9是本发明实施例提供的另一种部分音频信号 PCM解码后的信号图; 图 10是本发明实施例提供的一种叠加后的信号图。 具体实施方式  FIG. 7 is a signal diagram of a PCM decoded audio signal according to an embodiment of the present invention; FIG. 8 is a signal diagram of a partial audio signal PCM decoded according to an embodiment of the present invention; Another partial audio signal PCM decoded signal diagram; FIG. 10 is a superimposed signal diagram provided by an embodiment of the present invention. detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清 楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而不是 全部的实施例。基于本发明中的实施例, 本领域普通技术人员在没有作出创造 性劳动前提下所获得的所有其他实施例, 都属于本发明保护的范围。  BRIEF DESCRIPTION OF THE DRAWINGS The technical solutions in the embodiments of the present invention will be described in detail below with reference to the accompanying drawings. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative work are within the scope of the present invention.
本发明实施例中提出的音频文件, 可以包括 MP3、 WAV, WMA等常用 格式的音频文件, 同时, 也可以包括如视频、 电影等多媒体文件中的音频子文 件或数据。 The audio file proposed in the embodiment of the present invention may include audio files in a common format such as MP3, WAV, WMA, and the like, and may also include audio sub-texts in multimedia files such as videos and movies. Piece or data.
本发明实施例主要实现在以 Android为操作平台的多媒体终端上,但并不 局限于 Android平台,在其它操作平台上的等同实现过程仍在本发明保护范围 内。  The embodiments of the present invention are mainly implemented on a multimedia terminal using Android as an operating platform, but are not limited to the Android platform. The equivalent implementation process on other operating platforms is still within the scope of the present invention.
图 1 是本发明实施例中一种在多媒体终端中播放音频文件的方法的流程 示意图。 如图所示本实施例中的音频文件的播放方法的流程可以包括:  FIG. 1 is a schematic flow chart of a method for playing an audio file in a multimedia terminal according to an embodiment of the present invention. The flow of the method for playing an audio file in this embodiment as shown in the figure may include:
5101 , 多媒体终端对音频文件的至少一帧进行解码,获取所述音频文件的 至少一帧的左声道信号与右声道信号。  5101. The multimedia terminal decodes at least one frame of the audio file, and acquires a left channel signal and a right channel signal of at least one frame of the audio file.
所述音频文件在本发明实施例中, 主要是针对双声道音频文件,每个音频 文件可以按一定单位拆分为若干连续的帧, 另外, 音频文件需要进行解码后才 能播放, 在本发明实施例中, 上述解码可以是 PCM ( Pulse Code Modulation, 脉沖编码调制)解码。  In the embodiment of the present invention, the audio file is mainly for a two-channel audio file, and each audio file may be split into a plurality of consecutive frames according to a certain unit. In addition, the audio file needs to be decoded before being played, in the present invention. In an embodiment, the above decoding may be PCM (Pulse Code Modulation) decoding.
具体的, 多媒体终端在对一个的音频文件进行 PCM解码前, 先对该音频 文件的至少一帧进行解码,得到上述帧解码后的左声道信号与右声道信号。 需 要指出的是,上述音频文件的至少一帧可以是整个音频文件中随机选取的一帧 或多帧, 例如, 如图 7所示的一种音频信号 PCM解码后的信号图, 上述解码 的对象若为一帧, 则可以 ^始的 A帧, 也可以是中间的 G帧, 还可以是末 尾的 0帧; 上述解码的对象若为多帧, 则可以是起始 A、 B、 C三帧, 也可以 是中间的0、 H、 I三帧, 还可以是离散的八、 E、 H三帧。 另外, 为了避免解 码到类似 L帧, 或 M、 N三帧这样的全 "零幅值" 帧, 上述的至少一帧优 选离散的多帧,从而可以减少在后续过程中对音频文件的误判,提高播放音频 文件的准确性。  Specifically, before the PCM decoding of the audio file of the audio file, the multimedia terminal first decodes at least one frame of the audio file to obtain the left channel signal and the right channel signal after the frame decoding. It should be noted that at least one frame of the audio file may be one or more frames randomly selected in the entire audio file, for example, a signal diagram of the PCM decoded audio signal shown in FIG. 7, the above decoded object If it is a frame, it can be the first A frame, or the middle G frame, or the last 0 frame. If the above decoded object is a multi-frame, it can be the first frame of A, B, and C. It can also be the middle 0, H, I three frames, or it can be discrete eight, E, H three frames. In addition, in order to avoid decoding to a full "zero amplitude" frame such as an L frame, or M, N three frames, at least one of the above frames is preferably a discrete multiframe, thereby reducing misjudgment of audio files in subsequent processes. Improve the accuracy of playing audio files.
5102,多媒体终端将所述音频文件的至少一帧的左声道信号与右声道信号 进行叠加并获取叠加后的叠加信号。  5102. The multimedia terminal superimposes the left channel signal and the right channel signal of at least one frame of the audio file and acquires the superimposed superimposed signal.
所述叠加即将两个数值求和。具体的, 多媒体终端将音频文件的至少一帧 的左声道信号与右声道信号进行求和, 求和后的数值即叠加信号, 多媒体终端 获取该叠加信号。  The superposition is to sum the two values. Specifically, the multimedia terminal sums the left channel signal and the right channel signal of at least one frame of the audio file, and the summed value is a superimposed signal, and the multimedia terminal acquires the superimposed signal.
5103, 多媒体终端判断所述叠加信号的幅值是否在预设范围内,若所述叠 加信号的幅值在预设范围内,则判定所述音频文件的全部帧的左声道信号与右 声道信号反向。 双声道编码技术主要有两种, 一种是两个声道为同向信号, 另一种是两个 声道为反向信号, 上述同向信号即符号相同的信号, 例如两个正信号或两个负 信号, 上述反向信号即符号相反的信号, 例如一正一负的两个信号。 具体的, 多媒体终端根据叠加信号的幅值是否在预设范围内,判断音频文件的全部帧的 左声道信号与右声道信号是否反向。 5103, the multimedia terminal determines whether the amplitude of the superimposed signal is within a preset range, and if the amplitude of the superimposed signal is within a preset range, determining a left channel signal and a right sound of all frames of the audio file The channel signal is reversed. There are two main types of two-channel coding technology. One is that two channels are the same direction signals, the other is that the two channels are reverse signals, and the above-mentioned same direction signals are the same signals, for example, two positive signals. Or two negative signals, the reverse signal is a signal with the opposite sign, for example, two positive and negative signals. Specifically, the multimedia terminal determines whether the left channel signal and the right channel signal of all frames of the audio file are reversed according to whether the amplitude of the superimposed signal is within a preset range.
进一步的, 上述判断方法具体可以是:  Further, the foregoing determining method may specifically be:
判断叠加信号的幅值是否在预设范围内, 若叠加信号的幅值在预设范围 内, 则判定该音频文件的左声道信号与右声道信号反向。  It is judged whether the amplitude of the superimposed signal is within a preset range, and if the amplitude of the superimposed signal is within a preset range, it is determined that the left channel signal of the audio file is opposite to the right channel signal.
例如, 如图 8所示的一种部分音频信号 PCM解码后的信号图, 音频信号 的左、 右声道反向时, 左声道信号 Al、 Bl、 CI分别与右声道信号 A2、 B2、 C2叠加后得到叠加信号 Al+A2、 Bl+B2、 C1+C2, 由于 IA1I « IA2I, IB1I « IB2I, IC1 « IC2I, 则 Al+A2 « 0, Bl+B2 « 0, Cl+C2 « 0。 此时, 只要设置一个在 "0" 附近的预设范围,如 ± 3, 当叠加信号满足 (Al+A2) c [-3,3],(B1+B2) 匚 [-3,3], (C1+C2) [ [-3,3]时, 即可判定该音频文件的左声道与右声道信号反向。  For example, as shown in FIG. 8, a partial audio signal is decoded by a PCM signal. When the left and right channels of the audio signal are reversed, the left channel signals A1, Bl, and CI are respectively associated with the right channel signals A2 and B2. After superimposing C2, the superimposed signals Al+A2, Bl+B2, C1+C2 are obtained. Since IA1I « IA2I, IB1I « IB2I, IC1 « IC2I, then Al+A2 « 0, Bl+B2 « 0, Cl+C2 « 0 . In this case, just set a preset range around "0", such as ± 3, when the superimposed signal satisfies (Al+A2) c [-3,3], (B1+B2) 匚[-3,3], (C1+C2) [ [-3,3], it can be determined that the left and right channel signals of the audio file are reversed.
又例如, 如图 9所示的另一种部分音频信号 PCM解码后的信号图, 音频 信号的左、 右声道同向时, 左声道信号 Al、 Bl、 CI分别与右声道信号 A2、 B2、 C2叠加后得到叠加信号 Al+A2、 Bl+B2、 C1+C2, 若仍设置一个在 "0" 附近的预设范围, 如 ± 3 , 那么显然叠加信号不在这个范围内, 即 (Al+A2) c^ [-3,3] , (B1+B2) (^ [-3,3] , (Cl+C2) c [-3,3] , 进而可判定该音频文 件的左声道与右声道信号同向。  For another example, as shown in FIG. 9, another partial audio signal is decoded by the PCM signal. When the left and right channels of the audio signal are in the same direction, the left channel signals A1, Bl, and CI are respectively associated with the right channel signal A2. After superimposing B2 and C2, the superimposed signals Al+A2, Bl+B2, and C1+C2 are obtained. If a preset range near "0" is still set, such as ±3, then obviously the superimposed signal is not in this range, that is ( Al+A2) c^ [-3,3] , (B1+B2) (^ [-3,3] , (Cl+C2) c [-3,3] , which in turn determines the left channel of the audio file It is in the same direction as the right channel signal.
更进一步的, 由于一般情况下, 左、 右声道信号满足 IA1I=IA2I, IB1HB2I, IC1HC2I, 即 Al+A2=0, Bl+B2=0, Cl+C2=0。 因此上述预设方法可以直接为: 判断叠加信号的幅值是否为零, 若叠加信号的幅值为零, 则判定所述音频文件 的全部帧的左声道信号与右声道信号反向。此实现方法具有筒单、 实用以及准 确性高的优点。  Further, since the left and right channel signals generally satisfy IA1I=IA2I, IB1HB2I, IC1HC2I, that is, Al+A2=0, Bl+B2=0, Cl+C2=0. Therefore, the foregoing preset method may directly: determine whether the amplitude of the superimposed signal is zero, and if the amplitude of the superimposed signal is zero, determine that the left channel signal of all frames of the audio file is opposite to the right channel signal. This implementation has the advantages of being simple, practical and highly accurate.
S104,若所述音频文件的全部帧的左声道信号与右声道信号反向, 多媒体 终端则对所述音频文件的全部帧解码,并将解码后得到的所述音频文件的全部 帧的左声道信号与右声道信号调整为同向。  S104. If the left channel signal of all frames of the audio file is opposite to the right channel signal, the multimedia terminal decodes all frames of the audio file, and decodes all frames of the audio file obtained after decoding. The left channel signal and the right channel signal are adjusted in the same direction.
具体的,当多媒体终端获知音频文件的全部帧的左声道信号与右声道信号 反向时, 即可对音频文件的全部帧进行解码并把解码得到的左、右声道信号调 整为同向的信号。 Specifically, when the multimedia terminal learns that the left channel signal of all frames of the audio file is opposite to the right channel signal, all the frames of the audio file can be decoded and the decoded left and right channel signals are adjusted. The whole signal is in the same direction.
可选的,具体调整方法可以是:保持音频文件的全部帧的左声道信号不变, 将音频文件的全部帧的右声道信号反转,或保持音频文件的全部帧的右声道信 号不变, 将音频文件的全部帧的左声道信号反转。 此实现方法具有筒单、 实用 的优点。  Optionally, the specific adjustment method may be: keeping the left channel signal of all frames of the audio file unchanged, inverting the right channel signal of all frames of the audio file, or maintaining the right channel signal of all frames of the audio file. The same, the left channel signal of all frames of the audio file is inverted. This implementation has the advantages of a single, practical.
S105 ,多媒体终端将调整为同向的所述音频文件的全部帧的左声道信号与 右声道信号进行叠加并播放。  S105. The multimedia terminal superimposes and plays the left channel signal and the right channel signal of all frames of the audio file that are adjusted to be in the same direction.
具体的, 为了能够同时保留左声道信号与右声道信号的信息, 多媒体终端 将调整为同向的音频文件的全部帧的左声道信号与右声道信号进行叠加,得到 新的信号, 并在音频输出设备的左声道与右声道同时播放该新的信号。 例如, 左声道音响或耳机、 右声道音响或耳机同时输出相同的音乐。  Specifically, in order to simultaneously retain the information of the left channel signal and the right channel signal, the multimedia terminal superimposes the left channel signal and the right channel signal of all the frames of the same audio file to obtain a new signal. The new signal is played simultaneously on the left and right channels of the audio output device. For example, the left channel audio or headphones, right channel audio, or headphones simultaneously output the same music.
需要指出的是, 如图 10所示的一种叠加后的信号图, 左、 右声道的单声 道信号进行叠加后得到的信号(即图中双声道叠加的信号)可能会出现幅值过 大的情况, 幅值越大音量越大, 过大的音量会降低用户体验。 甚者, 若信号的 幅值超过了声道信号门限值, 将会导致信号被截断, 出现失真。 上述声道信号 门限值是指声道信号允许的最大值, 例如: 一般的声道信号为 16位二进制码, 其中, 除去符号码后, 取值范围为 -65535~+65535 , 当双声道叠加的信号的码 值大于 +655535或小于 -65535时, 将会导致信号截断。  It should be pointed out that, as shown in FIG. 10, a superimposed signal diagram, signals obtained by superimposing mono signals of the left and right channels (ie, signals superimposed by two channels in the figure) may appear. In the case of too large a value, the larger the amplitude, the louder the volume, and the excessive volume will reduce the user experience. In addition, if the amplitude of the signal exceeds the channel signal threshold, the signal will be cut off and distortion will occur. The above-mentioned channel signal threshold value refers to the maximum value allowed by the channel signal, for example: The general channel signal is a 16-bit binary code, wherein, after the symbol code is removed, the value ranges from -65535 to +65535, when double-voiced When the code value of the track superimposed signal is greater than +655535 or less than -65535, the signal will be truncated.
进一步的, 为了避免上述情况的出现, 多媒体终端将调整为同向的音频文 件的全部帧的左声道信号与右声道信号按预设比例缩小幅值后进行叠加。  Further, in order to avoid the above situation, the multimedia terminal superimposes the left channel signal and the right channel signal of all the frames of the same audio file to be reduced by a preset ratio.
进一步可选的,上述预设比例可以为 50%。根据筒单的数学推导可知, 50% 的预设比例不仅可以避免信号截断, 还不会明显改变最终的音量。  Further optionally, the preset ratio may be 50%. According to the mathematical derivation of the cartridge, the 50% preset ratio not only avoids signal truncation, but also does not significantly change the final volume.
本发明实施例通过对音频文件的部分帧预解码, 分析预解码后的左、右声 道信号, 从而识别出音频文件的左、 右声道信号是否反向, 并对左、 右声道信 号反向的音频文件进行处理, 即将其左、 右声道信号调整为同向并叠加, 最终 根据处理后的信号实现在单声道输出机制的音频输出设备上无失真地播放该 音频文件, 提高用户体验。 图 2是本发明实施例中另一种在多媒体终端中播放音频文件的方法的流 程示意图。 如图所示本实施例中的音频文件的播放方法的流程可以包括:In the embodiment of the present invention, the pre-decoded left and right channel signals are analyzed by pre-decoding a partial frame of the audio file, thereby identifying whether the left and right channel signals of the audio file are reversed, and the left and right channel signals are The reverse audio file is processed, that is, the left and right channel signals are adjusted to be in the same direction and superimposed, and finally the audio file is played without distortion on the audio output device of the mono output mechanism according to the processed signal, thereby improving user experience. 2 is a flow diagram of another method for playing an audio file in a multimedia terminal in an embodiment of the present invention; Schematic diagram. The flow of the method for playing an audio file in this embodiment as shown in the figure may include:
S201 , 多媒体终端获取针对所述音频文件的播放指令。 S201. The multimedia terminal acquires a play instruction for the audio file.
具体的, 多媒体终端在响应多媒体文件的操作前,会获取到针对音频文件 的播放指令, 并在该播放指令下执行如下 S202~S210的步骤。  Specifically, before the multimedia terminal responds to the operation of the multimedia file, the multimedia terminal acquires a play instruction for the audio file, and performs the following steps S202 to S210 under the play command.
S202, 多媒体终端对音频文件的至少一帧进行解码,获取所述音频文件的 至少一帧的左声道信号与右声道信号。  S202. The multimedia terminal decodes at least one frame of the audio file, and acquires a left channel signal and a right channel signal of at least one frame of the audio file.
所述音频文件在本发明实施例中, 主要是针对双声道音频文件,每个音频 文件可以按一定单位拆分为若干连续的帧, 另外, 音频文件需要进行解码后才 能播放, 在本发明实施例中, 上述解码可以是 PCM解码。  In the embodiment of the present invention, the audio file is mainly for a two-channel audio file, and each audio file may be split into a plurality of consecutive frames according to a certain unit. In addition, the audio file needs to be decoded before being played, in the present invention. In an embodiment, the above decoding may be PCM decoding.
具体的, 多媒体终端在对一个的音频文件进行 PCM解码前, 先对该音频 文件的至少一帧进行解码,得到上述帧解码后的左声道信号与右声道信号。 需 要指出的是,上述音频文件的至少一帧可以是整个音频文件中随机选取的一帧 或多帧, 例如, 如图 7所示的一种音频信号 PCM解码后的信号图, 上述解码 的对象若为一帧, 则可以 ^始的 A帧, 也可以是中间的 G帧, 还可以是末 尾的 0帧; 上述解码的对象若为多帧, 则可以是起始 A、 B、 C三帧, 也可以 是中间的0、 H、 I三帧, 还可以是离散的八、 E、 H三帧。 另外, 为了避免解 码到类似 L帧, 或 M、 N三帧这样的全 "零幅值" 帧, 上述的至少一帧优 选离散的多帧,从而可以减少在后续过程中对音频文件的误判,提高播放音频 文件的准确性。  Specifically, before the PCM decoding of the audio file of the audio file, the multimedia terminal first decodes at least one frame of the audio file to obtain the left channel signal and the right channel signal after the frame decoding. It should be noted that at least one frame of the audio file may be one or more frames randomly selected in the entire audio file, for example, a signal diagram of the PCM decoded audio signal shown in FIG. 7, the above decoded object If it is a frame, it can be the first A frame, or the middle G frame, or the last 0 frame. If the above decoded object is a multi-frame, it can be the first frame of A, B, and C. It can also be the middle 0, H, I three frames, or it can be discrete eight, E, H three frames. In addition, in order to avoid decoding to a full "zero amplitude" frame such as an L frame, or M, N three frames, at least one of the above frames is preferably a discrete multiframe, thereby reducing misjudgment of audio files in subsequent processes. Improve the accuracy of playing audio files.
S203,多媒体终端将所述音频文件的至少一帧的左声道信号与右声道信号 进行叠加并获取叠加后的叠加信号。  S203. The multimedia terminal superimposes the left channel signal and the right channel signal of at least one frame of the audio file, and acquires the superimposed superimposed signal.
所述叠加即将两个数值求和。具体的, 多媒体终端将音频文件的至少一帧 的左声道信号与右声道信号进行求和, 求和后的数值即叠加信号, 多媒体终端 获取该叠加信号。  The superposition is to sum the two values. Specifically, the multimedia terminal sums the left channel signal and the right channel signal of at least one frame of the audio file, and the summed value is a superimposed signal, and the multimedia terminal acquires the superimposed signal.
S204, 多媒体终端判断所述叠加信号的幅值是否在预设范围内。  S204. The multimedia terminal determines whether the amplitude of the superposed signal is within a preset range.
例如, 如图 8所示的一种部分音频信号 PCM解码后的信号图, 音频信号 的左、 右声道反向时, 左声道信号 Al、 Bl、 CI分别与右声道信号 A2、 B2、 C2叠加后得到叠加信号 Al+A2、 Bl+B2、 C1+C2, 由于 IA1I « IA2I, IB1I « IB2I, IC1 « IC2I, 则 Al+A2 « 0, Bl+B2 « 0, Cl+C2 « 0。 此时, 只要设置一个在 "0" 附近的预设范围,如 ± 3, 当叠加信号满足 (Al+A2) c [-3,3],(B1+B2) 匚 [-3,3], (C1+C2) d [-3,3]时, 即可判定该音频文件的左声道与右声道信号反向。 For example, as shown in FIG. 8, a partial audio signal is decoded by a PCM signal. When the left and right channels of the audio signal are reversed, the left channel signals A1, Bl, and CI are respectively associated with the right channel signals A2 and B2. After superimposing C2, the superimposed signals Al+A2, Bl+B2, C1+C2 are obtained. Since IA1I « IA2I, IB1I « IB2I, IC1 « IC2I, then Al+A2 « 0, Bl+B2 « 0, Cl+C2 « 0 . At this point, just set one at "0" The nearby preset range, such as ± 3, when the superimposed signal satisfies (Al+A2) c [-3,3], (B1+B2) 匚[-3,3], (C1+C2) d [-3, 3], it can be determined that the left channel and the right channel signal of the audio file are reversed.
又例如, 如图 9所示的另一种部分音频信号 PCM解码后的信号图, 音频 信号的左、 右声道同向时, 左声道信号 Al、 Bl、 CI分别与右声道信号 A2、 B2、 C2叠加后得到叠加信号 Al+A2、 Bl+B2、 C1+C2, 若仍设置一个在 "0" 附近的预设范围, 如 ± 3 , 那么显然叠加信号不在这个范围内, 即 (Al+A2) c^ [-3,3] , (B1+B2) (^ [-3,3] , (Cl+C2) c [-3,3] , 进而可判定该音频文 件的左声道与右声道信号同向。  For another example, as shown in FIG. 9, another partial audio signal is decoded by the PCM signal. When the left and right channels of the audio signal are in the same direction, the left channel signals A1, Bl, and CI are respectively associated with the right channel signal A2. After superimposing B2 and C2, the superimposed signals Al+A2, Bl+B2, and C1+C2 are obtained. If a preset range near "0" is still set, such as ±3, then obviously the superimposed signal is not in this range, that is ( Al+A2) c^ [-3,3] , (B1+B2) (^ [-3,3] , (Cl+C2) c [-3,3] , which in turn determines the left channel of the audio file It is in the same direction as the right channel signal.
5205,若所述叠加信号的幅值在预设范围内, 多媒体终端则判定所述音频 文件的全部帧的左声道信号与右声道信号反向。  5205. If the amplitude of the superimposed signal is within a preset range, the multimedia terminal determines that the left channel signal of all frames of the audio file is opposite to the right channel signal.
双声道编码技术主要有两种, 一种是两个声道为同向信号, 另一种是两个 声道为反向信号, 上述同向信号即符号相同的信号, 例如两个正信号或两个负 信号, 上述反向信号即符号相反的信号, 例如一正一负的两个信号。 具体的, 若多媒体终端获知叠加信号的幅值在预设范围内时,可判定所述音频文件的全 部帧的左声道信号与右声道信号反向, 则执行以下步骤, 反之不作任何处理。  There are two main types of two-channel coding technology. One is that two channels are the same direction signals, the other is that the two channels are reverse signals, and the above-mentioned same direction signals are the same signals, for example, two positive signals. Or two negative signals, the reverse signal is a signal with the opposite sign, for example, two positive and negative signals. Specifically, if the multimedia terminal determines that the amplitude of the superimposed signal is within a preset range, and determines that the left channel signal of the entire frame of the audio file is opposite to the right channel signal, perform the following steps, and vice versa. .
5206,若判定所述音频文件的全部帧的左声道信号与右声道信号反向, 多 媒体终端则针对所述播放指令设置反向标识。  5206. If it is determined that the left channel signal of all frames of the audio file is opposite to the right channel signal, the multimedia terminal sets a reverse identifier for the play instruction.
具体的,多媒体终端判定所述音频文件的全部帧的左声道信号与右声道信 号反向时, 设置反向标识以便后期查询。 如多媒体终端在空闲时, 预先判断本 地媒体库中的一个音频文件的左、右声道信号是否反向, 若反向则设置反向标 识以便执行该音频文件时能够立即得知其声道状况。  Specifically, when the multimedia terminal determines that the left channel signal of all frames of the audio file is opposite to the right channel signal, the reverse identifier is set for later query. For example, when the multimedia terminal is idle, it is determined in advance whether the left and right channel signals of an audio file in the local media library are reversed, and if the reverse direction is set, the reverse identifier is set to immediately know the channel status when the audio file is executed. .
可选的实现方式,上述播放指令附有一个对应的参数变量, 多媒体终端可 以对该参数变量的值进行设置,在本发明实施例中,若参数变量的值设置为 1 , 则可以表示针对播放指令设置有反向标识, 反之设置为 0, 则可以表示未设置 有反向标识。  In an optional implementation, the play command is associated with a corresponding parameter variable, and the multimedia terminal can set the value of the parameter variable. In the embodiment of the present invention, if the value of the parameter variable is set to 1, it can be expressed for playing. The instruction setting has a reverse identifier. If it is set to 0, it can indicate that the reverse identifier is not set.
5207, 多媒体终端检测是否针对所述播放指令是否设置有所述反向标识。 具体的, 多媒体终端在对音频文件的全部帧进行解码之前,检测是否针对 播放指令设置有反向标识。  S207. The multimedia terminal detects whether the reverse identifier is set for the play instruction. Specifically, before decoding all the frames of the audio file, the multimedia terminal detects whether a reverse identifier is set for the play instruction.
可选的实现方式, 多媒体终端检测播放指令中参数变量的值是否为 1 , 如 果为 1 , 则针对播放指令设置有反向标识, 如果为 0, 则没有。 In an optional implementation manner, the multimedia terminal detects whether the value of the parameter variable in the play command is 1, such as If it is 1, the reverse flag is set for the playback command. If it is 0, it is not.
5208,若检测到有所述反向标识, 多媒体终端则对所述音频文件的全部帧 解码,并将解码后得到的所述音频文件的全部帧的左声道信号与右声道信号调 整为同向。  5208. If the reverse identifier is detected, the multimedia terminal decodes all the frames of the audio file, and adjusts the left channel signal and the right channel signal of all frames of the audio file obtained after decoding to In the same direction.
具体的,多媒体终端通过反向标识得知音频文件的左声道信号与右声道信 号反向后,对音频文件的全部帧进行解码并把解码得到的左、右声道信号调整 为同向的信号。  Specifically, after the multimedia terminal knows that the left channel signal of the audio file is reversed from the right channel signal, the multimedia terminal decodes all the frames of the audio file and adjusts the decoded left and right channel signals to the same direction. signal of.
可选的,具体调整方法可以是:保持音频文件的全部帧的左声道信号不变, 将音频文件的全部帧的右声道信号反转,或保持音频文件的全部帧的右声道信 号不变, 将音频文件的全部帧的左声道信号反转。 此实现方法具有筒单、 实用 的优点。  Optionally, the specific adjustment method may be: keeping the left channel signal of all frames of the audio file unchanged, inverting the right channel signal of all frames of the audio file, or maintaining the right channel signal of all frames of the audio file. The same, the left channel signal of all frames of the audio file is inverted. This implementation has the advantages of a single, practical.
5209,多媒体终端将调整为同向的所述音频文件的全部帧的左声道信号与 右声道信号按预设比例缩小幅值后进行叠加并播放。  5209. The multimedia terminal superimposes and plays the left channel signal and the right channel signal of all the frames of the audio file that are adjusted to be in the same direction by a preset ratio.
具体的, 为了能够同时保留左声道信号与右声道信号的信息, 多媒体终端 将调整为同向的音频文件的全部帧的左声道信号与右声道信号按预设比例缩 小后进行叠加,得到新的信号, 并在音频输出设备的左声道与右声道同时播放 该新的信号。 例如, 左声道音响或耳机、 右声道音响或耳机同时输出相同的音 乐。  Specifically, in order to simultaneously retain the information of the left channel signal and the right channel signal, the multimedia terminal adjusts the left channel signal and the right channel signal of all frames of the same audio file to be reduced by a preset ratio and then superimposed. , get a new signal, and play the new signal simultaneously on the left and right channels of the audio output device. For example, the left channel audio or headphones, right channel audio, or headphones simultaneously output the same music.
需要指出的是,多媒体终端将音频文件的左声道信号与右声道信号按预设 比例缩小后再进行叠加的原因为: 如图 10所示的一种叠加后的信号图, 左、 右声道的单声道信号进行叠加后得到的信号(即图中双声道叠加的信号)可能 会出现幅值过大的情况, 幅值越大音量越大, 过大的音量会降低用户体验。 甚 者, 若信号的幅值超过了声道信号门限值, 将会导致信号被截断, 出现失真。 上述声道信号门限值是指声道信号允许的最大值, 例如: 一般的声道信号为 16位二进制码, 其中, 除去符号码后, 取值范围为 -65535~+65535 , 当双声道 叠加的信号的码值大于 +655535或小于 -65535时, 将会导致信号截断。  It should be noted that the reason why the multimedia terminal reduces the left channel signal and the right channel signal of the audio file by a preset ratio and then superimposes is as follows: a superimposed signal diagram as shown in FIG. 10, left and right The signal obtained by superimposing the mono signal of the channel (that is, the signal superimposed by two channels in the picture) may have an excessive amplitude. The larger the amplitude, the louder the volume, and the excessive volume will reduce the user experience. . In addition, if the amplitude of the signal exceeds the channel signal threshold, the signal will be cut off and distortion will occur. The above-mentioned channel signal threshold value refers to the maximum value allowed by the channel signal, for example: The general channel signal is a 16-bit binary code, wherein, after the symbol code is removed, the value ranges from -65535 to +65535, when double-voiced When the code value of the track superimposed signal is greater than +655535 or less than -65535, the signal will be truncated.
5210, 多媒体终端清除所述反向标识。  5210. The multimedia terminal clears the reverse identifier.
具体的, 多媒体终端将针对播放指令设置的反向标识清除, 以免对后续其 他音频文件造成误处理。 本发明实施例针对音频文件设置一个播放指令,在该播放指令下, 多媒体 终端分析预解码后的左、右声道信号,识别出左、右声道信号反向的音频文件, 并在该播放指令里设置反向标识。 多媒体终端在对音频文件解码前, 先检测该 播放指令下是否有反向标识, 若有, 则对左、 右声道信号反向的音频文件进行 处理, 即将其左、 右声道信号调整为同向并叠加, 最终才艮据处理后的信号实现 在单声道输出机制的音频输出设备上无失真地播放左、右声道信号反向的音频 文件, 提高用户体验。 图 3 是本发明实施例中另一种在多媒体终端中播放音频文件的方法的流 程示意图。 如图所示本实施例中的音频文件的播放方法的流程可以包括: Specifically, the multimedia terminal clears the reverse identifier set by the play instruction, so as to avoid causing mishandling to other subsequent audio files. The embodiment of the present invention sets a play instruction for the audio file, and under the play command, the multimedia terminal analyzes the pre-decoded left and right channel signals, and recognizes the audio files with the left and right channel signals reversed, and plays in the play Set the reverse flag in the command. Before decoding the audio file, the multimedia terminal first detects whether there is a reverse identifier under the play command, and if so, processes the audio file with the left and right channel signals reversed, that is, adjusts the left and right channel signals to In the same direction and superimposed, finally, according to the processed signal, the audio file reversed by the left and right channel signals is played without distortion on the audio output device of the mono output mechanism, thereby improving the user experience. FIG. 3 is a schematic flow chart of another method for playing an audio file in a multimedia terminal according to an embodiment of the present invention. The flow of the method for playing an audio file in this embodiment as shown in the figure may include:
5301 , 多媒体终端获取针对所述音频文件的播放指令。  5301. The multimedia terminal acquires a play instruction for the audio file.
具体的, 多媒体终端在响应多媒体文件的操作前,会获取到针对音频文件 的播放指令, 并在该播放指令下执行如下 S302~S310的步骤。  Specifically, before the multimedia terminal responds to the operation of the multimedia file, the multimedia terminal acquires a play instruction for the audio file, and performs the following steps S302 to S310 under the play command.
5302, 多媒体终端对音频文件的起始一帧进行解码,获取所述音频文件的 起始一帧的左声道信号与右声道信号。  5302. The multimedia terminal decodes a first frame of the audio file, and acquires a left channel signal and a right channel signal of the first frame of the audio file.
所述音频文件在本发明实施例中, 主要是针对双声道音频文件,每个音频 文件可以按一定单位拆分为若干连续的帧, 另外, 音频文件需要进行 PCM解 码后才能播放, 在本发明实施例中, 上述解码可以是 PCM解码。  In the embodiment of the present invention, the audio file is mainly for a two-channel audio file, and each audio file may be divided into several consecutive frames according to a certain unit. In addition, the audio file needs to be PCM decoded before being played. In an embodiment of the invention, the above decoding may be PCM decoding.
具体的, 多媒体终端在对一个的音频文件进行 PCM解码前, 先对该音频 文件起始一帧进行解码, 得到该帧的左声道信号与右声道信号。  Specifically, before the PCM decoding of an audio file, the multimedia terminal first decodes a frame of the audio file to obtain a left channel signal and a right channel signal of the frame.
需要指出的是,上述音频文件的起始一帧可以参阅如图 7所示的一种音频 信号 PCM解码后的信号图中起始的 A帧。  It should be noted that the first frame of the above audio file can refer to an A-frame starting from the audio signal PCM decoded signal pattern as shown in FIG.
5303 ,多媒体终端将所述音频文件的起始一帧的左声道信号与右声道信号 进行叠加并获取叠加后的叠加信号。  5303. The multimedia terminal superimposes the left channel signal and the right channel signal of the first frame of the audio file and acquires the superimposed superimposed signal.
所述叠加即将两个数值求和。具体的, 多媒体终端将音频文件的起始一帧 的左声道信号与右声道信号进行求和, 求和后的数值即叠加信号, 多媒体终端 获取该叠加信号。  The superposition is to sum the two values. Specifically, the multimedia terminal sums the left channel signal and the right channel signal of the first frame of the audio file, and the summed value is a superimposed signal, and the multimedia terminal acquires the superimposed signal.
5304, 多媒体终端判断所述叠加信号的幅值是否在预设范围内。  5304. The multimedia terminal determines whether the amplitude of the superposed signal is within a preset range.
例如, 如图 8所示的一种部分音频信号 PCM解码后的信号图, 音频信号 的左、 右声道反向时, 左声道信号 A1分别与右声道信号 A2叠加后得到叠加 信号 A1+A2, 由于 IA1I « IA2I, 则 Al+A2 « 0。 此时, 只要设置一个在 "0" 附 近的预设范围, 如 ± 3, 当叠加信号满足 (Al+A2) c [-3,3], 即可判定该音频文 件的左声道与右声道信号反向。 For example, a partial audio signal PCM decoded signal diagram, audio signal as shown in FIG. When the left and right channels are reversed, the left channel signal A1 is superimposed with the right channel signal A2 to obtain a superimposed signal A1+A2. Since IA1I « IA2I, Al+A2 « 0. In this case, just set a preset range near "0", such as ± 3, and when the superimposed signal satisfies (Al+A2) c [-3,3], the left and right sounds of the audio file can be determined. The channel signal is reversed.
又例如, 如图 9所示的另一种部分音频信号 PCM解码后的信号图, 音频 信号的左、 右声道同向时, 左声道信号 A1分别与右声道信号 A2叠加后得到 叠加信号 A1+A2, 若仍设置一个在 "0" 附近的预设范围, 如 ± 3, 那么显然 叠加信号不在这个范围内, 即 (Al+A2) [-3,3] ,进而可判定该音频文件的左声 道与右声道信号同向。  For another example, as shown in FIG. 9, another partial audio signal is decoded by the PCM signal. When the left and right channels of the audio signal are in the same direction, the left channel signal A1 is superimposed with the right channel signal A2 to be superimposed. Signal A1+A2, if a preset range around "0", such as ±3, is still set, then obviously the superimposed signal is not in this range, ie (Al+A2) [-3,3], and the audio can be determined The left channel of the file is in the same direction as the right channel signal.
S305,若所述叠加信号的幅值在预设范围内, 多媒体终端则判定所述音频 文件的全部帧的左声道信号与右声道信号反向。  S305. If the amplitude of the superimposed signal is within a preset range, the multimedia terminal determines that the left channel signal of all frames of the audio file is opposite to the right channel signal.
双声道编码技术主要有两种,一种是两个声道为同向信号, 另一种是两个 声道为反向信号, 上述同向信号即符号相同的信号, 例如两个正信号或两个负 信号, 上述反向信号即符号相反的信号, 例如一正一负的两个信号。 具体的, 若多媒体终端获知叠加信号的幅值等于 0时,可判定所述音频文件的全部帧的 左声道信号与右声道信号反向, 则执行以下步骤, 反之不作任何处理。  There are two main types of two-channel encoding technology, one is that the two channels are the same direction signals, the other is that the two channels are the reverse signals, and the above-mentioned same direction signals are the same signals, for example, two positive signals. Or two negative signals, the reverse signal is a signal with the opposite sign, for example, two positive and negative signals. Specifically, if the multimedia terminal knows that the amplitude of the superimposed signal is equal to 0, it can be determined that the left channel signal of all frames of the audio file is opposite to the right channel signal, and the following steps are performed, and vice versa.
5306,若判定所述音频文件的全部帧的左声道信号与右声道信号反向, 多 媒体终端则针对所述播放指令设置反向标识。  5306. If it is determined that the left channel signal of all frames of the audio file is opposite to the right channel signal, the multimedia terminal sets a reverse identifier for the play instruction.
具体的, 多媒体终端判定所述音频文件的左声道信号与右声道信号反向 时, 设置反向标识以便后期查询。 如多媒体终端在空闲时, 预先判断本地媒体 库中的一个音频文件的左、右声道信号是否反向, 若反向则设置反向标识以便 执行该音频文件时能够立即得知其声道状况。  Specifically, when the multimedia terminal determines that the left channel signal of the audio file is opposite to the right channel signal, the reverse identifier is set for later query. For example, when the multimedia terminal is idle, it is determined in advance whether the left and right channel signals of an audio file in the local media library are reversed, and if the reverse direction is set, the reverse identifier is set to immediately know the channel status when the audio file is executed. .
可选的实现方式,上述播放指令附有一个对应的参数变量, 多媒体终端可 以对该参数变量的值进行设置,在本发明实施例中,若参数变量的值设置为 1 , 则可以表示针对播放指令设置有反向标识, 反之设置为 0, 则可以表示未设置 有反向标识。  In an optional implementation, the play command is associated with a corresponding parameter variable, and the multimedia terminal can set the value of the parameter variable. In the embodiment of the present invention, if the value of the parameter variable is set to 1, it can be expressed for playing. The instruction setting has a reverse identifier. If it is set to 0, it can indicate that the reverse identifier is not set.
5307, 多媒体终端检测是否针对所述播放指令是否设置有所述反向标识。 具体的, 多媒体终端在对音频文件进行正式解码之前,检测是否针对播放 指令设置有反向标识。 可选的实现方式, 多媒体终端检测播放指令中参数变量的值是否为 1 , 如 果为 1 , 则针对播放指令设置有反向标识, 如果为 0, 则没有。 5307. The multimedia terminal detects whether the reverse identifier is set for the play instruction. Specifically, before the multimedia file is formally decoded, the multimedia terminal detects whether a reverse identifier is set for the play instruction. In an optional implementation manner, the multimedia terminal detects whether the value of the parameter variable in the play command is 1, and if it is 1, the reverse flag is set for the play command, and if it is 0, it does not.
5308,若检测到有所述反向标识, 多媒体终端则对所述音频文件的全部帧 解码, 并保持所述音频文件的全部帧的左声道信号不变,将所述音频文件的全 部帧的右声道信号。  5308. If the reverse identifier is detected, the multimedia terminal decodes all frames of the audio file, and keeps the left channel signal of all frames of the audio file unchanged, and all frames of the audio file are Right channel signal.
具体的,多媒体终端通过反向标识得知音频文件的左声道信号与右声道信 号反向后, 对音频文件的全部帧进行解码并保持解码得到的左声道信号不变, 将音频文件的全部帧的右声道信号反转。  Specifically, after the multimedia terminal knows that the left channel signal of the audio file is reversed from the right channel signal by the reverse identifier, all the frames of the audio file are decoded and the left channel signal obtained by the decoding is kept unchanged, and the audio file is changed. The right channel signal of all frames is inverted.
5309,多媒体终端将调整为同向的所述音频文件的全部帧的左声道信号与 右声道信号按 50%比例缩小幅值后进行叠加并播放。  5309. The multimedia terminal superimposes and plays the left channel signal and the right channel signal of all the frames of the audio file that are adjusted to be in the same direction by 50%.
具体的, 为了能够同时保留左声道信号与右声道信号的信息, 多媒体终端 将调整为同向的音频文件的全部帧的左声道信号与右声道信号按 50%比例缩 小后进行叠加,得到新的信号, 并在音频输出设备的左声道与右声道同时播放 该新的信号。 例如, 左声道音响或耳机、 右声道音响或耳机同时输出相同的音 乐。  Specifically, in order to simultaneously retain the information of the left channel signal and the right channel signal, the multimedia terminal adjusts the left channel signal and the right channel signal of all the frames of the same audio file to be reduced by 50%, and then superimposed. , get a new signal, and play the new signal simultaneously on the left and right channels of the audio output device. For example, the left channel audio or headphones, right channel audio, or headphones simultaneously output the same music.
需要指出的是,多媒体终端将音频文件的左声道信号与右声道信号按 50% 比例缩小后再进行叠加的原因为: 如图 10所示的一种叠加后的信号图, 左、 右声道的单声道信号进行叠加后得到的信号(即图中双声道叠加的信号)可能 会出现幅值过大的情况, 幅值越大音量越大, 过大的音量会降低用户体验。 甚 者, 若信号的幅值超过了声道信号门限值, 将会导致信号被截断, 出现失真。 上述声道信号门限值是指声道信号允许的最大值, 例如: 一般的声道信号为 16位二进制码, 其中, 除去符号码后, 取值范围为 -65535~+65535 , 当双声道 叠加的信号的码值大于 +655535或小于 -65535时, 将会导致信号截断。 根据筒 单的数学推导可知, 50%的预设比例不仅可以避免信号截断, 还不会明显改变 最终的音量。  It should be noted that the reason why the multimedia terminal reduces the left channel signal and the right channel signal of the audio file by 50% and then superimposes is as follows: a superimposed signal diagram as shown in FIG. 10, left and right The signal obtained by superimposing the mono signal of the channel (that is, the signal superimposed by two channels in the picture) may have an excessive amplitude. The larger the amplitude, the louder the volume, and the excessive volume will reduce the user experience. . In addition, if the amplitude of the signal exceeds the channel signal threshold, the signal will be cut off and distortion will occur. The above-mentioned channel signal threshold value refers to the maximum value allowed by the channel signal, for example: The general channel signal is a 16-bit binary code, wherein, after the symbol code is removed, the value ranges from -65535 to +65535, when double-voiced When the code value of the track superimposed signal is greater than +655535 or less than -65535, the signal will be truncated. According to the mathematical derivation of the cartridge, the 50% preset ratio not only avoids signal truncation, but also does not significantly change the final volume.
5310, 多媒体终端清除所述反向标识。  5310. The multimedia terminal clears the reverse identifier.
具体的, 多媒体终端将针对播放指令设置的反向标识清除, 以免对后续其 他音频文件造成误处理。  Specifically, the multimedia terminal clears the reverse identifier set for the playback instruction, so as to avoid erroneous processing on subsequent audio files.
本发明实施例针对音频文件设置一个播放指令,在该播放指令下, 多媒体 终端分析预解码后的左、右声道信号,识别出左、右声道信号反向的音频文件, 并在该播放指令里设置反向标识。 多媒体终端在对音频文件解码前, 先检测该 播放指令下是否有反向标识, 若有, 则保持该音频文件的左声道信号不变, 反 转其右声道信号以实现左、右声道信号同向,并将同向后的信号按 50%比例缩 小后叠加,最终根据处理后的信号实现在单声道输出机制的音频输出设备上无 失真地播放左、 右声道信号反向的音频文件, 提高用户体验。 图 4是本发明实施例中一种多媒体终端的结构示意图。本发明多媒体终端 包括智能手机、 PAD, MP3以及 MP4等智能终端。 如图所示本发明实施例中 的多媒体终端至少可以包括音频解码模块 410、 信号叠加模块 420、 信号判断 模块 430、 信号调整模块 440以及音频播放模块 450, 其中: The embodiment of the invention sets a play instruction for the audio file, and under the play instruction, the multimedia The terminal analyzes the pre-decoded left and right channel signals, recognizes the audio files whose left and right channel signals are reversed, and sets a reverse identifier in the play command. Before decoding the audio file, the multimedia terminal first detects whether there is a reverse identifier under the play command, and if so, keeps the left channel signal of the audio file unchanged, and inverts the right channel signal to implement left and right sounds. The signals are in the same direction, and the backward signals are scaled down by 50%, and finally the left and right channel signals are reversed without distortion on the audio output device of the mono output mechanism according to the processed signals. Audio files to enhance the user experience. FIG. 4 is a schematic structural diagram of a multimedia terminal according to an embodiment of the present invention. The multimedia terminal of the invention comprises smart terminals such as smart phones, PAD, MP3 and MP4. The multimedia terminal in the embodiment of the present invention may include at least an audio decoding module 410, a signal superimposing module 420, a signal judging module 430, a signal adjusting module 440, and an audio playing module 450, where:
音频解码模块 410, 用于对音频文件的至少一帧进行解码, 获取所述音频 文件的至少一帧的左声道信号与右声道信号。  The audio decoding module 410 is configured to decode at least one frame of the audio file, and obtain a left channel signal and a right channel signal of at least one frame of the audio file.
所述音频文件在本发明实施例中, 主要是针对双声道音频文件,每个音频 文件可以按一定单位拆分为若干连续的帧, 另外, 音频文件需要进行解码后才 能播放, 在本发明实施例中, 上述解码可以是 PCM解码。  In the embodiment of the present invention, the audio file is mainly for a two-channel audio file, and each audio file may be split into a plurality of consecutive frames according to a certain unit. In addition, the audio file needs to be decoded before being played, in the present invention. In an embodiment, the above decoding may be PCM decoding.
具体的, 音频解码模块 410在对一个的音频文件进行 PCM解码前, 先对 该音频文件的至少一帧进行解码,得到上述帧解码后的左声道信号与右声道信 号。 需要指出的是, 上述音频文件的至少一帧可以是整个音频文件中随机选取 的一帧或多帧, 例如, 如图 7所示的一种音频信号 PCM解码后的信号图, 上 述解码的对象若为一帧, 则可以是起始的 A帧, 也可以是中间的 G帧, 还可 以是末尾的 0帧; 上述解码的对象若为多帧, 则可以是起始 A、 B、 C三帧, 也可以是中间的0、 H、 I三帧, 还可以是离散的八、 E、 H三帧。 另外, 为了 避免解码到类似 L帧, 或!^、 M、 N三帧这样的全 "零幅值" 帧, 上述的至少 一帧优选离散的多帧,从而可以减少在后续过程中对音频文件的误判,提高播 放音频文件的准确性。  Specifically, the audio decoding module 410 decodes at least one frame of the audio file before performing PCM decoding on the audio file to obtain the left channel signal and the right channel signal after the frame decoding. It should be noted that at least one frame of the audio file may be one or more frames randomly selected in the entire audio file, for example, a signal diagram of the PCM decoded audio signal shown in FIG. 7, the above decoded object If it is a frame, it may be the initial A frame, or the middle G frame, or the last 0 frame. If the above decoded object is a multi-frame, it may be the start A, B, C. The frame may also be the intermediate 0, H, and I frames, or may be discrete eight, E, and H frames. Also, to avoid decoding to a similar L frame, or! For all "zero amplitude" frames such as ^, M, and N frames, at least one of the above frames is preferably a discrete multiframe, thereby reducing misjudgment of audio files in subsequent processes and improving the accuracy of playing audio files.
信号叠加模块 420, 用于将所述音频文件的至少一帧的左声道信号与右声 道信号进行叠加并获取叠加后的叠加信号。  The signal superimposing module 420 is configured to superimpose the left channel signal and the right channel signal of at least one frame of the audio file and obtain the superimposed superimposed signal.
所述叠加即将两个数值求和。具体的,信号叠加模块 420将音频文件的至 少一帧的左声道信号与右声道信号进行求和, 求和后的数值即叠加信号, 多媒 体终端获取该叠加信号。 The superposition is to sum the two values. Specifically, the signal overlay module 420 will The left channel signal and the right channel signal of one frame are summed, and the summed value is a superimposed signal, and the multimedia terminal acquires the superimposed signal.
信号判断模块 430, 用于判断所述叠加信号的幅值是否在预设范围内, 若 所述叠加信号的幅值在预设范围内,则判定所述音频文件的全部帧的左声道信 号与右声道信号反向。  The signal determining module 430 is configured to determine whether the amplitude of the superimposed signal is within a preset range, and if the amplitude of the superimposed signal is within a preset range, determine a left channel signal of all frames of the audio file. Reversed to the right channel signal.
双声道编码技术主要有两种, 一种是两个声道为同向信号, 另一种是两个 声道为反向信号, 上述同向信号即符号相同的信号, 例如两个正信号或两个负 信号, 上述反向信号即符号相反的信号, 例如一正一负的两个信号。 具体的, 信号判断模块 430根据叠加信号的幅值是否在预设范围内,判断音频文件的全 部帧的左声道信号与右声道信号是否反向。  There are two main types of two-channel coding technology. One is that two channels are the same direction signals, the other is that the two channels are reverse signals, and the above-mentioned same direction signals are the same signals, for example, two positive signals. Or two negative signals, the reverse signal is a signal with the opposite sign, for example, two positive and negative signals. Specifically, the signal determining module 430 determines whether the left channel signal and the right channel signal of all the frames of the audio file are reversed according to whether the amplitude of the superimposed signal is within a preset range.
进一步的, 上述判断方法具体可以是:  Further, the foregoing determining method may specifically be:
判断叠加信号的幅值是否在预设范围内, 若叠加信号的幅值在预设范围 内, 则判定该音频文件的左声道信号与右声道信号反向。  It is judged whether the amplitude of the superimposed signal is within a preset range, and if the amplitude of the superimposed signal is within a preset range, it is determined that the left channel signal of the audio file is opposite to the right channel signal.
例如, 如图 8所示的一种部分音频信号 PCM解码后的信号图, 音频信号 的左、 右声道反向时, 左声道信号 Al、 Bl、 CI分别与右声道信号 A2、 B2、 C2叠加后得到叠加信号 Al+A2、 Bl+B2、 C1+C2, 由于 IA1I « IA2I, IB1I « IB2I, IC1 « IC2I, 则 Al+A2 « 0, Bl+B2 « 0, Cl+C2 « 0。 此时, 只要设置一个在 "0" 附近的预设范围,如 ± 3, 当叠加信号满足 (Al+A2) c [-3,3],(B1+B2) 匚 [-3,3], (C1+C2) [ [-3,3]时, 即可判定该音频文件的左声道与右声道信号反向。  For example, as shown in FIG. 8, a partial audio signal is decoded by a PCM signal. When the left and right channels of the audio signal are reversed, the left channel signals A1, Bl, and CI are respectively associated with the right channel signals A2 and B2. After superimposing C2, the superimposed signals Al+A2, Bl+B2, C1+C2 are obtained. Since IA1I « IA2I, IB1I « IB2I, IC1 « IC2I, then Al+A2 « 0, Bl+B2 « 0, Cl+C2 « 0 . In this case, just set a preset range around "0", such as ± 3, when the superimposed signal satisfies (Al+A2) c [-3,3], (B1+B2) 匚[-3,3], (C1+C2) [ [-3,3], it can be determined that the left and right channel signals of the audio file are reversed.
又例如, 如图 9所示的另一种部分音频信号 PCM解码后的信号图, 音频 信号的左、 右声道同向时, 左声道信号 Al、 Bl、 CI分别与右声道信号 A2、 B2、 C2叠加后得到叠加信号 Al+A2、 Bl+B2、 C1+C2, 若仍设置一个在 "0" 附近的预设范围, 如 ± 3 , 那么显然叠加信号不在这个范围内, 即 (Al+A2) c^ [-3,3] , (B1+B2) (^ [-3,3] , (Cl+C2) c [-3,3] , 进而可判定该音频文 件的左声道与右声道信号同向。  For another example, as shown in FIG. 9, another partial audio signal is decoded by the PCM signal. When the left and right channels of the audio signal are in the same direction, the left channel signals A1, Bl, and CI are respectively associated with the right channel signal A2. After superimposing B2 and C2, the superimposed signals Al+A2, Bl+B2, and C1+C2 are obtained. If a preset range near "0" is still set, such as ±3, then obviously the superimposed signal is not in this range, that is ( Al+A2) c^ [-3,3] , (B1+B2) (^ [-3,3] , (Cl+C2) c [-3,3] , which in turn determines the left channel of the audio file It is in the same direction as the right channel signal.
更进一步的, 由于一般情况下, 左、 右声道信号满足 IA1I=IA2I, IB1HB2I, IC1HC2I, 即 Al+A2=0, Bl+B2=0, Cl+C2=0。 因此上述预设方法可以直接为: 判断叠加信号的幅值是否为零, 若叠加信号的幅值为零, 则判定所述音频文件 的左声道信号与右声道信号反向。此实现方法具有筒单、 实用以及准确性高的 优点。 Further, since the left and right channel signals generally satisfy IA1I=IA2I, IB1HB2I, IC1HC2I, that is, Al+A2=0, Bl+B2=0, Cl+C2=0. Therefore, the foregoing preset method may directly be: determining whether the amplitude of the superimposed signal is zero, and if the amplitude of the superimposed signal is zero, determining that the left channel signal of the audio file is opposite to the right channel signal. This implementation has a single, practical and accurate Advantages.
信号调整模块 440, 用于若所述音频文件的全部帧的左声道信号与右声道 信号反向, 则对所述音频文件的全部帧进行解码, 并将解码后得到的所述音频 文件的全部帧的左声道信号与右声道信号调整为同向。  The signal adjustment module 440 is configured to: if the left channel signal of the entire frame of the audio file is inverted with the right channel signal, decode all the frames of the audio file, and decode the obtained audio file. The left channel signal and the right channel signal of all the frames are adjusted in the same direction.
具体的,当信号判断模块 430获知音频文件的全部帧的左声道信号与右声 道信号反向时,信号调整模块 440即可对音频文件的全部帧解码并把解码得到 的左、 右声道信号调整为同向的信号。  Specifically, when the signal determining module 430 knows that the left channel signal of all frames of the audio file is opposite to the right channel signal, the signal adjusting module 440 can decode all the frames of the audio file and decode the left and right sounds. The channel signal is adjusted to the same direction signal.
可选的, 具体调整方法可以是: 保持音频文件的左声道信号不变, 将音频 文件的右声道信号反转, 或保持音频文件的右声道信号不变,将音频文件的左 声道信号反转。 此实现方法具有筒单、 实用的优点。  Optionally, the specific adjustment method may be: keeping the left channel signal of the audio file unchanged, inverting the right channel signal of the audio file, or keeping the right channel signal of the audio file unchanged, and the left sound of the audio file The signal is inverted. This implementation has the advantages of a single, practical.
音频播放模块 450, 用于将调整为同向的所述音频文件的全部帧的左声道 信号与右声道信号进行叠加并播放。  The audio playing module 450 is configured to superimpose and play the left channel signal and the right channel signal of all frames of the audio file adjusted to be in the same direction.
具体的, 为了能够同时保留左声道信号与右声道信号的信息, 音频播放模 块 450将调整为同向的音频文件的全部帧的左声道信号与右声道信号进行叠 加,得到新的信号,并在音频输出设备的左声道与右声道同时播放该新的信号。 例如, 左声道音响或耳机、 右声道音响或耳机同时输出相同的音乐。  Specifically, in order to simultaneously retain the information of the left channel signal and the right channel signal, the audio playing module 450 superimposes the left channel signal and the right channel signal of all frames adjusted to the same audio file to obtain a new one. Signal and play the new signal simultaneously on the left and right channels of the audio output device. For example, the left channel audio or headphones, right channel audio, or headphones simultaneously output the same music.
需要指出的是, 如图 10所示的一种叠加后的信号图, 左、 右声道的单声 道信号进行叠加后得到的信号(即图中双声道叠加的信号)可能会出现幅值过 大的情况, 幅值越大音量越大, 过大的音量会降低用户体验。 甚者, 若信号的 幅值超过了声道信号门限值, 将会导致信号被截断, 出现失真。 上述声道信号 门限值是指声道信号允许的最大值, 例如: 一般的声道信号为 16位二进制码, 其中, 除去符号码后, 取值范围为 -65535~+65535 , 当双声道叠加的信号的码 值大于 +655535或小于 -65535时, 将会导致信号截断。  It should be pointed out that, as shown in FIG. 10, a superimposed signal diagram, signals obtained by superimposing mono signals of the left and right channels (ie, signals superimposed by two channels in the figure) may appear. In the case of too large a value, the larger the amplitude, the louder the volume, and the excessive volume will reduce the user experience. In addition, if the amplitude of the signal exceeds the channel signal threshold, the signal will be cut off and distortion will occur. The above-mentioned channel signal threshold value refers to the maximum value allowed by the channel signal, for example: The general channel signal is a 16-bit binary code, wherein, after the symbol code is removed, the value ranges from -65535 to +65535, when double-voiced When the code value of the track superimposed signal is greater than +655535 or less than -65535, the signal will be truncated.
进一步的, 为了避免上述情况的出现, 音频播放模块 450将调整为同向的 音频文件的全部帧的左声道信号与右声道信号按预设比例缩小幅值后进行叠 加。  Further, in order to avoid the above situation, the audio play module 450 superimposes the left channel signal and the right channel signal of all frames adjusted to the same audio file by a preset ratio and then superimposes the amplitude.
进一步可选的,上述预设比例可以为 50%。根据筒单的数学推导可知, 50% 的预设比例不仅可以避免信号截断, 还不会明显改变最终的音量。  Further optionally, the preset ratio may be 50%. According to the mathematical derivation of the cartridge, the 50% preset ratio not only avoids signal truncation, but also does not significantly change the final volume.
请参阅图 4, 多媒体终端还可以包括播放指令获耳 ^莫块 460、 反向标识设 置模块 470以及反向标识清除模块 480, 其中: Referring to FIG. 4, the multimedia terminal may further include a play instruction, and the reverse identifier is set. The module 470 and the reverse identity clearing module 480, wherein:
播放指令获取模块 460, 用于获取针对所述音频文件的播放指令以触发所 述音频预解码模块。  The play instruction acquisition module 460 is configured to acquire a play instruction for the audio file to trigger the audio pre-decoding module.
具体的,播放指令获取模块 460在响应多媒体文件的操作前,会获取到针 对音频文件的播放指令, 并在该播放指令下触发音频解码模块。  Specifically, before the operation of the multimedia file is processed, the play instruction acquisition module 460 obtains a play instruction for the audio file, and triggers the audio decoding module under the play command.
反向标识设置模块 470, 用于若判定所述音频文件的全部帧的左声道信号 与右声道信号反向, 则针对所述播放指令设置反向标识。  The reverse identifier setting module 470 is configured to set a reverse identifier for the play command if it is determined that the left channel signal of all frames of the audio file is opposite to the right channel signal.
具体的,反向标识设置模块 470设置反向标识以便后期查询。如多媒体终 端在空闲时,预先判断本地媒体库中的一个音频文件的左、右声道信号是否反 向, 若反向, 则反向标识设置模块 470设置反向标识以便执行该音频文件时能 够立即得知其声道状况。  Specifically, the reverse identity setting module 470 sets the reverse identity for later query. If the multimedia terminal is idle, it is determined in advance whether the left and right channel signals of an audio file in the local media library are reversed. If the reverse direction, the reverse identifier setting module 470 sets the reverse identifier to enable the audio file to be executed. Immediately know the status of its channel.
可选的实现方式, 上述反向标识设置模块 470附有一个对应的参数变量, 多媒体终端可以对该参数变量的值进行设置,在本发明实施例中, 若参数变量 的值设置为 1 , 则可以表示针对播放指令设置有反向标识, 反之设置为 0, 则 可以表示未设置有反向标识。  In an optional implementation manner, the reverse identifier setting module 470 is provided with a corresponding parameter variable, and the multimedia terminal can set the value of the parameter variable. In the embodiment of the present invention, if the value of the parameter variable is set to 1, It can be said that the reverse indication is set for the play instruction, and if it is set to 0, it can mean that the reverse identifier is not set.
反向标识清除模块 480, 用于在所述音频播放模块播放完所述新音频信号 后清除所述反向标识。  The reverse identifier clearing module 480 is configured to clear the reverse identifier after the audio playing module plays the new audio signal.
具体的,反向标识清除模块 480将针对播放指令设置的反向标识清除, 以 免对后续其他音频文件造成误处理。  Specifically, the reverse identifier clearing module 480 clears the reverse identifier set for the play command to avoid misprocessing of subsequent audio files.
在此基础上,请参阅图 5所示的一种信号调整模块的结构示意图,信号调 整模块 440可以进一步包括: 反向标识检测单元 441和信号调整单元 442, 其 中:  On the basis of this, referring to the structure diagram of a signal adjustment module shown in FIG. 5, the signal adjustment module 440 may further include: a reverse identifier detection unit 441 and a signal adjustment unit 442, where:
反向标识检测单元 441 , 用于在对所述音频文件进行解码之前, 检测是否 针对所述播放指令设置有所述反向标识。  The reverse identifier detecting unit 441 is configured to detect whether the reverse identifier is set for the play instruction before decoding the audio file.
具体的,反向标识检测单元 441在对音频文件进行正式解码之前,检测是 否针对播放指令设置有反向标识。  Specifically, the reverse identification detecting unit 441 detects whether a reverse identification is set for the playback instruction before the audio file is formally decoded.
可选的实现方式,反向标识检测单元 441检测播放指令中参数变量的值是 否为 1 , 如果为 1 , 则针对播放指令设置有反向标识, 如果为 0, 则没有。  In an optional implementation manner, the reverse identifier detecting unit 441 detects whether the value of the parameter variable in the play command is 1 or not. If it is 1, the reverse flag is set for the play command, and if it is 0, it is not.
信号调整单元 442, 用于若检测到有所述反向标识, 则对所述音频文件的 全部帧解码,并将解码后得到的所述音频文件的全部帧的左声道信号与右声道 信号调整为同向。 a signal adjustment unit 442, configured to: if the reverse identifier is detected, the audio file All frames are decoded, and the left channel signal and the right channel signal of all frames of the audio file obtained after decoding are adjusted to be in the same direction.
具体的,信号调整单元 442通过反向标识得知音频文件的左声道信号与右 声道信号反向后,对音频文件的全部帧进行解码并把解码得到的左、右声道信 号调整为同向的信号。  Specifically, after the signal adjustment unit 442 knows that the left channel signal of the audio file is inverted with the right channel signal, the entire frame of the audio file is decoded and the decoded left and right channel signals are adjusted to The same direction signal.
可选的, 具体调整方法可以是: 保持音频文件的左声道信号不变, 将音频 文件的右声道信号反转, 或保持音频文件的右声道信号不变,将音频文件的左 声道信号反转。 此实现方法具有筒单、 实用的优点。 图 6是本发明实施例中的另一种多媒体终端的结构示意图,如图 6所示, 该 多媒体终端可以包括:至少一个处理器 601 ,例如 CPU ( Central Processing Unit, 中央处理器), 存储器 602, 至少一个通信总线 603 , 音频输出设备 604。 其中, 通信总线 603用于实现这些组件之间的连接通信。其中, 音频输出设备 604用于 将音频文件的声道信号转化为声音。 存储器 602可以是高速 RAM存储器, 也可 以是非易失性的存储器, 例如至少一个磁盘存储器。 存储器 602还可以是至少 一个位于远离前述处理器 602的存储装置。存储器 602中存储一组程序代码,且 处理器用于调用存储器中存储的程序代码, 用于执行以下操作:  Optionally, the specific adjustment method may be: keeping the left channel signal of the audio file unchanged, inverting the right channel signal of the audio file, or keeping the right channel signal of the audio file unchanged, and the left sound of the audio file The signal is inverted. This implementation has the advantages of a single, practical. FIG. 6 is a schematic structural diagram of another multimedia terminal according to an embodiment of the present invention. As shown in FIG. 6, the multimedia terminal may include: at least one processor 601, such as a CPU (Central Processing Unit), and a memory 602. At least one communication bus 603, audio output device 604. Among them, the communication bus 603 is used to implement connection communication between these components. Among them, the audio output device 604 is used to convert the channel signal of the audio file into sound. The memory 602 can be a high speed RAM memory or a non-volatile memory such as at least one disk memory. Memory 602 can also be at least one storage device located remotely from processor 602. A set of program codes is stored in the memory 602, and the processor is configured to call program code stored in the memory for performing the following operations:
对音频文件的至少一帧进行解码,获取所述音频文件的至少一帧的左声道 信号与右声道信号;  Decoding at least one frame of the audio file to obtain a left channel signal and a right channel signal of at least one frame of the audio file;
将所述音频文件的至少一帧的左声道信号与右声道信号进行叠加并获取 叠加后的叠加信号;  Superimposing a left channel signal of at least one frame of the audio file with a right channel signal and acquiring the superimposed superimposed signal;
判断所述叠加信号的幅值是否在预设范围内,若所述叠加信号的幅值在预 设范围内, 则判定所述音频文件的全部帧的左声道信号与右声道信号反向; 若所述音频文件的全部帧的左声道信号与右声道信号反向,则对所述音频 文件的全部帧解码,并将解码后得到的所述音频文件的全部帧的左声道信号与 右声道信号调整为同向;  Determining whether the amplitude of the superimposed signal is within a preset range, and if the amplitude of the superimposed signal is within a preset range, determining that the left channel signal and the right channel signal of all frames of the audio file are reversed If the left channel signal of all frames of the audio file is inverted with the right channel signal, all frames of the audio file are decoded, and the left channel of all frames of the audio file obtained after decoding is decoded The signal and the right channel signal are adjusted to be in the same direction;
将调整为同向的所述音频文件的全部帧的左声道信号与右声道信号进行 叠力口并播放。  The left channel signal and the right channel signal of all frames of the audio file adjusted to be in the same direction are overlapped and played.
特别的,处理器 601判断所述叠加信号的幅值是否在预设范围内具体可以 是: In particular, the processor 601 determines whether the amplitude of the superposed signal is within a preset range. Yes:
判断所述叠加信号的幅值是否为零。  It is judged whether the amplitude of the superimposed signal is zero.
相应的, 若所述叠加信号的幅值为零, 处理器 601则判定所述音频文件的 全部帧的左声道信号与右声道信号反向。  Correspondingly, if the amplitude of the superimposed signal is zero, the processor 601 determines that the left channel signal of all frames of the audio file is opposite to the right channel signal.
可选的, 处理器 601执行的具体操作还可以包括:  Optionally, the specific operations performed by the processor 601 may further include:
获取针对所述音频文件的播放指令;  Obtaining a play instruction for the audio file;
若判定所述音频文件的全部帧的左声道信号与右声道信号反向,多媒体终 端则针对所述播放指令设置反向标识。  If it is determined that the left channel signal of all frames of the audio file is opposite to the right channel signal, the multimedia terminal sets a reverse flag for the play command.
相应的, 处理器 601 通过检测是否针对所述播放指令设置有所述反向标 识, 可得知音频文件的全部帧的左声道信号与右声道信号是否反向。  Correspondingly, the processor 601 can detect whether the left channel signal and the right channel signal of all frames of the audio file are reversed by detecting whether the reverse identifier is set for the play instruction.
进一步的, 处理器 601若检测到有所述反向标识, 则对所述音频文件的全 部帧解码并将所述左声道信号与所述右声道信号调整为同向。  Further, if the processor 601 detects the reverse identifier, the entire frame of the audio file is decoded and the left channel signal and the right channel signal are adjusted to be in the same direction.
更进一步的,处理器 601将调整为同向的所述音频文件的全部帧的左声道 信号与右声道信号进行叠加并播放之后, 清除所述反向标识。  Further, after the processor 601 superimposes and plays the left channel signal and the right channel signal of all the frames of the audio file adjusted in the same direction, the reverse identifier is cleared.
可选的,处理器 601对所述音频文件的全部帧解码并将所述左声道信号与 所述右声道信号调整为同向具体操作可以为:  Optionally, the processor 601 decodes all frames of the audio file and adjusts the left channel signal and the right channel signal to perform the same operation in the same direction:
保持所述音频文件的全部帧的左声道信号不变,将所述音频文件的全部帧 的右声道信号反转; 或  Keeping the left channel signal of all frames of the audio file unchanged, inverting the right channel signal of all frames of the audio file; or
保持所述音频文件的全部帧的右声道信号不变,将所述音频文件的全部帧 的左声道信号反转。  The right channel signal of all frames of the audio file is kept unchanged, and the left channel signal of all frames of the audio file is inverted.
可选的,处理器 601将调整为同向的所述音频文件的全部帧的左声道信号 与右声道信号进行叠加具体操作可以为:  Optionally, the processor 601 superimposes the left channel signal and the right channel signal of all frames of the audio file that are adjusted to be in the same direction. The specific operation may be:
将调整为同向的所述音频文件的全部帧的左声道信号与右声道信号按预 设比例缩小幅值后进行叠加。 特别的, 预设比例可以是 50%。  The left channel signal and the right channel signal of all the frames of the audio file adjusted to be in the same direction are superimposed by a preset ratio reduction amplitude. In particular, the preset ratio can be 50%.
本发明实施例还提出了一种计算机存储介质,所述计算机存储介质存储有 程序, 所述程序执行时包括本发明实施例结合图 1~图 3所描述的一种在多媒 体终端中播放音频文件的方法。 本发明通过对音频文件的部分帧预解码,分析预解码后的左、右声道信号, 从而识别出音频文件的左、 右声道信号是否反向, 并对左、 右声道信号反向的 音频文件进行处理, 即将其左、 右声道信号调整为同向并叠加, 最终根据处理 后的信号实现在单声道输出机制的音频输出设备上无失真地播放该音频文件。 进一步的, 本发明还针对上述过程设置一个播放指令, 在此播放指令中, 识别 出的左、右声道信号反向的音频文件会被设置反向标识, 方便多媒体终端根据 该反向标识执行对音频文件的处理。 更进一步的, 本发明在对左、 右声道信号 调整为同向后,按 50%缩小其幅值后再叠加,避免信号截断同时不会明显改变 音量的大小, 提高用户体验。 The embodiment of the present invention further provides a computer storage medium, where the computer storage medium stores a program, and the program execution includes an audio file played in a multimedia terminal according to an embodiment of the present invention in combination with FIG. 1 to FIG. Methods. The invention analyzes the pre-decoded left and right channel signals by pre-decoding a partial frame of the audio file, thereby identifying whether the left and right channel signals of the audio file are reversed, and reversing the left and right channel signals. of The audio file is processed, that is, the left and right channel signals are adjusted to be in the same direction and superimposed, and finally the audio file is played without distortion on the audio output device of the mono output mechanism according to the processed signal. Further, the present invention further provides a play instruction for the above process, in which the recognized audio files of the left and right channel signals are reversely identified, which facilitates the multimedia terminal to execute according to the reverse identifier. Processing of audio files. Further, the present invention adjusts the left and right channel signals to the same direction, and then reduces the amplitude by 50% and then superimposes to avoid signal truncation without significantly changing the volume of the volume, thereby improving the user experience.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程, 是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算 机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。 其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory, ROM )或随机存储记忆体(Random Access Memory, RAM )等。  A person skilled in the art can understand that all or part of the process of implementing the above embodiment method can be completed by a computer program to instruct related hardware, and the program can be stored in a computer readable storage medium, the program When executed, the flow of an embodiment of the methods as described above may be included. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
以上所揭露的仅为本发明较佳实施例而已,当然不能以此来限定本发明之 权利范围,因此依本发明权利要求所作的等同变化,仍属本发明所涵盖的范围。  The above is only the preferred embodiment of the present invention, and the scope of the present invention is not limited thereto, and the equivalent changes made by the claims of the present invention are still within the scope of the present invention.

Claims

权 利 要 求 Rights request
1、 一种在多媒体终端中播放音频文件的方法, 其特征在于, 包括: 多媒体终端对音频文件的至少一帧进行解码,获取所述音频文件的至少一 帧的左声道信号与右声道信号; 1. A method for playing audio files in a multimedia terminal, characterized by comprising: the multimedia terminal decoding at least one frame of the audio file, and obtaining the left channel signal and the right channel of at least one frame of the audio file. Signal;
多媒体终端将所述音频文件的至少一帧的左声道信号与右声道信号进行 叠加并获取叠加后的叠加信号; The multimedia terminal superimposes the left channel signal and the right channel signal of at least one frame of the audio file and obtains the superimposed superimposed signal;
多媒体终端判断所述叠加信号的幅值是否在预设范围内,若所述叠加信号 的幅值在预设范围内,则判定所述音频文件的全部帧的左声道信号与右声道信 号反向; The multimedia terminal determines whether the amplitude of the superimposed signal is within the preset range. If the amplitude of the superimposed signal is within the preset range, it determines the left channel signal and the right channel signal of all frames of the audio file. reverse;
若所述音频文件的全部帧的左声道信号与右声道信号反向,多媒体终端则 对所述音频文件的全部帧解码,并将解码后得到的所述音频文件的全部帧的左 声道信号与右声道信号调整为同向; If the left channel signal and the right channel signal of all frames of the audio file are reversed, the multimedia terminal decodes all frames of the audio file, and obtains the left channel signal of all frames of the audio file after decoding. channel signal and the right channel signal are adjusted to the same direction;
多媒体终端将调整为同向的所述音频文件的全部帧的左声道信号与右声 道信号进行叠加并播放。 The multimedia terminal superimposes and plays the left channel signal and the right channel signal of all frames of the audio file adjusted to the same direction.
2、 如权利要求 1所述的方法, 其特征在于, 所述多媒体终端判断所述叠 加信号的幅值是否在预设范围内, 若所述叠加信号的幅值在预设范围内, 则判 定所述音频文件的全部帧的左声道信号与右声道信号反向包括: 2. The method of claim 1, wherein the multimedia terminal determines whether the amplitude of the superimposed signal is within a preset range, and if the amplitude of the superimposed signal is within the preset range, then determines The reverse direction of the left channel signal and right channel signal of all frames of the audio file includes:
多媒体终端判断所述叠加信号的幅值是否为零,若所述叠加信号的幅值为 零, 则判定所述音频文件的全部帧的左声道信号与右声道信号反向。 The multimedia terminal determines whether the amplitude of the superimposed signal is zero. If the amplitude of the superimposed signal is zero, it determines that the left channel signal and the right channel signal of all frames of the audio file are opposite.
3、 如权利要求 1-2任一项所述的方法, 其特征在于, 所述多媒体终端对 音频文件的至少一帧进行解码,获取所述音频文件的至少一帧的左声道信号与 右声道信号之前还包括: 3. The method according to any one of claims 1-2, characterized in that the multimedia terminal decodes at least one frame of the audio file and obtains the left channel signal and the right channel signal of at least one frame of the audio file. The channel signal also previously included:
多媒体终端获取针对所述音频文件的播放指令; The multimedia terminal obtains a playback instruction for the audio file;
所述多媒体终端判断所述叠加信号的幅值是否在预设范围内,若所述叠加 信号的幅值在预设范围内,则判定所述音频文件的全部帧的左声道信号与右声 道信号反向之后还包括: 若判定所述音频文件的全部帧的左声道信号与右声道信号反向,多媒体终 端则针对所述播放指令设置反向标识; The multimedia terminal determines whether the amplitude of the superimposed signal is within a preset range. If the amplitude of the superimposed signal is within the preset range, it determines the left channel signal and the right channel signal of all frames of the audio file. After the channel signal is reversed, it also includes: If it is determined that the left channel signal and the right channel signal of all frames of the audio file are reversed, the multimedia terminal sets a reverse flag for the playback instruction;
所述若所述音频文件的全部帧的左声道信号与右声道信号反向,多媒体终 端则对所述音频文件的全部帧解码,并将解码后得到的所述音频文件的全部帧 的左声道信号与右声道信号调整为同向包括: If the left channel signal and the right channel signal of all frames of the audio file are reversed, the multimedia terminal decodes all frames of the audio file and obtains the decoded values of all frames of the audio file. Adjusting the left channel signal and the right channel signal to the same direction includes:
多媒体终端检测是否针对所述播放指令是否设置有所述反向标识; 若检测到有所述反向标识, 多媒体终端则对所述音频文件的全部帧解码, 并将解码后得到的所述音频文件的全部帧的左声道信号与右声道信号调整为 同向。 The multimedia terminal detects whether the reverse flag is set for the playback instruction; if the reverse flag is detected, the multimedia terminal decodes all frames of the audio file and obtains the decoded audio The left channel signal and right channel signal of all frames of the file are adjusted to the same direction.
4、 如权利要求 3所述的方法, 其特征在于, 所述若检测到有所述反向标 识, 多媒体终端则对所述音频文件的全部帧解码, 并将解码后得到的所述音频 文件的全部帧的左声道信号与右声道信号调整为同向之后还包括: 4. The method of claim 3, wherein if the reverse identifier is detected, the multimedia terminal decodes all frames of the audio file, and decodes the audio file obtained after decoding. After the left channel signal and right channel signal of all frames are adjusted to the same direction, it also includes:
多媒体终端清除所述反向标识。 The multimedia terminal clears the reverse identifier.
5、 如权利要求 1-4任一项所述的方法, 其特征在于, 所述多媒体终端将 调整为同向的所述音频文件的全部帧的左声道信号与右声道信号进行叠加并 播放具体包括: 5. The method according to any one of claims 1 to 4, characterized in that the multimedia terminal superimposes and combines the left channel signal and the right channel signal of all frames of the audio file adjusted to the same direction. Playback details include:
多媒体终端将调整为同向的所述音频文件的全部帧的左声道信号与右声 道信号按预设比例缩小幅值后进行叠加并播放。 The multimedia terminal reduces the amplitude of the left channel signal and the right channel signal of all frames of the audio file adjusted to the same direction according to a preset ratio, then superimposes and plays them.
6、 如权利要求 5所述的方法, 其特征在于, 所述多媒体终端将调整为同 向的所述音频文件的全部帧的左声道信号与右声道信号按预设比例缩小幅值 后进行叠加并播放具体包括: 6. The method of claim 5, wherein the multimedia terminal reduces the amplitude of the left channel signal and the right channel signal of all frames of the audio file adjusted to the same direction according to a preset ratio. Overlaying and playing include:
多媒体终端将调整为同向的所述音频文件的全部帧的左声道信号与右声 道信号按 50%比例缩小幅值后进行叠加并播放。 The multimedia terminal will reduce the amplitude of the left channel signal and the right channel signal of all frames of the audio file adjusted to the same direction by 50%, then superimpose and play them.
7、 如权利要求 1所述的方法, 其特征在于, 所述将解码后得到的所述音 频文件的全部帧的左声道信号与右声道信号调整为同向包括: 保持所述音频文件的全部帧的左声道信号不变,将所述音频文件的全部帧 的右声道信号反转; 或 7. The method of claim 1, wherein adjusting the left channel signal and the right channel signal of all frames of the decoded audio file to be in the same direction includes: Keep the left channel signal of all frames of the audio file unchanged, and invert the right channel signal of all frames of the audio file; or
保持所述音频文件的全部帧的右声道信号不变,将所述音频文件的全部帧 的左声道信号反转。 The right channel signal of all frames of the audio file is kept unchanged, and the left channel signal of all frames of the audio file is inverted.
8、 如权利要求 1-4任一项所述的方法, 其特征在于, 所述音频文件的至 少一帧包括: 8. The method according to any one of claims 1 to 4, characterized in that at least one frame of the audio file includes:
所述音频文件的起始第一帧或离散的至少两帧。 The first first frame or at least two discrete frames of the audio file.
9、 一种多媒体终端, 其特征在于, 所述多媒体终端包括: 9. A multimedia terminal, characterized in that, the multimedia terminal includes:
音频解码模块, 用于对音频文件的至少一帧进行解码,获取所述音频文件 的至少一帧的左声道信号与右声道信号; An audio decoding module, used to decode at least one frame of the audio file and obtain the left channel signal and the right channel signal of at least one frame of the audio file;
信号叠加模块,用于将所述音频文件的至少一帧的左声道信号与右声道信 号进行叠加并获取叠加后的叠加信号; A signal superposition module, used to superimpose the left channel signal and the right channel signal of at least one frame of the audio file and obtain the superimposed superimposed signal;
信号判断模块, 用于判断所述叠加信号的幅值是否在预设范围内, 若所述 叠加信号的幅值在预设范围内,则判定所述音频文件的全部帧的左声道信号与 右声道信号反向; A signal judgment module, used to judge whether the amplitude of the superimposed signal is within the preset range. If the amplitude of the superimposed signal is within the preset range, then determine the left channel signal of all frames of the audio file and The right channel signal is reversed;
信号调整模块,用于若所述音频文件的全部帧的左声道信号与右声道信号 反向, 则对所述音频文件的全部帧解码, 并将解码后得到的所述音频文件的全 部帧的左声道信号与右声道信号调整为同向; A signal adjustment module, configured to decode all frames of the audio file if the left channel signal and the right channel signal of all frames of the audio file are reversed, and decode all the decoded audio files. The left channel signal and right channel signal of the frame are adjusted to the same direction;
音频播放模块,用于将调整为同向的所述音频文件的全部帧的左声道信号 与右声道信号进行叠加并播放。 The audio playback module is used to superimpose and play the left channel signal and the right channel signal of all frames of the audio file adjusted to the same direction.
10、 如权利要求 9所述的多媒体终端, 其特征在于, 10. The multimedia terminal according to claim 9, characterized in that,
所述信号判断模块用于判断所述叠加信号的幅值是否为零,若所述叠加信 号的幅值为零, 则判定所述音频文件的全部帧的左声道信号与右声道信号反 向。 The signal judgment module is used to judge whether the amplitude of the superimposed signal is zero. If the amplitude of the superimposed signal is zero, then it is determined that the left channel signal and the right channel signal of all frames of the audio file are inversely Towards.
11、 如权利要求 9-10任一项所述的多媒体终端, 其特征在于, 所述多媒 体终端还包括: 播放指令获取模块,用于获取针对所述音频文件的播放指令以触发所述音 频解码模块; 11. The multimedia terminal according to any one of claims 9 to 10, characterized in that, the multimedia terminal further includes: A playback instruction acquisition module, used to obtain a playback instruction for the audio file to trigger the audio decoding module;
反向标识设置模块,用于若判定所述音频文件的全部帧的左声道信号与右 声道信号反向, 则针对所述播放指令设置反向标识; A reverse flag setting module, configured to set a reverse flag for the playback instruction if it is determined that the left channel signal and the right channel signal of all frames of the audio file are reversed;
所述信号调整模块包括: The signal adjustment module includes:
反向标识检测单元, 用于在对所述音频文件进行解码之前,检测是否针对 所述播放指令设置有所述反向标识; A reverse identification detection unit, configured to detect whether the reverse identification is set for the playback instruction before decoding the audio file;
信号调整单元, 用于若检测到有所述反向标识, 则对所述音频文件的全部 帧解码,并将解码后得到的所述音频文件的全部帧的左声道信号与右声道信号 调整为同向。 A signal adjustment unit, configured to decode all frames of the audio file if the reverse identifier is detected, and obtain the decoded left channel signal and right channel signal of all frames of the audio file. Adjust to the same direction.
12、 如权利要求 11所述的多媒体终端, 其特征在于, 所述多媒体终端还 包括: 12. The multimedia terminal according to claim 11, characterized in that, the multimedia terminal further includes:
反向标识清除模块,用于在所述音频播放模块播放完所述新音频信号后清 除所述反向标识。 The reverse mark clearing module is used to clear the reverse mark after the audio playback module finishes playing the new audio signal.
13、 如权利要求 9-12任一项所述的多媒体终端, 其特征在于, 所述音频 播放模块用于将调整为同向的所述音频文件的全部帧的左声道信号与右声道 信号按预设比例缩小幅值后进行叠加并播放。 13. The multimedia terminal according to any one of claims 9 to 12, wherein the audio playback module is configured to adjust the left channel signal and the right channel signal of all frames of the audio file in the same direction. The signals are reduced in amplitude according to a preset ratio, then superimposed and played.
14、 如权利要求 13所述的多媒体终端, 其特征在于, 所述音频播放模块 用于将调整为同向的所述音频文件的全部帧的左声道信号与右声道信号按 50%比例缩小幅值后进行叠加并播放。 14. The multimedia terminal according to claim 13, wherein the audio playback module is configured to adjust the left channel signal and the right channel signal of all frames of the audio file in the same direction according to a 50% ratio. Reduce the amplitude and then superimpose and play.
15、 如权利要求 9所述的多媒体终端, 其特征在于, 15. The multimedia terminal according to claim 9, characterized in that,
所述信号调整模块用于: The signal conditioning module is used for:
若所述音频文件的全部帧的左声道信号与右声道信号反向,则对所述音频 文件的全部帧解码, 并保持所述音频文件的全部帧的左声道信号不变,将所述 音频文件的全部帧的右声道信号反转; 或 若所述音频文件的全部帧的左声道信号与右声道信号反向,则对所述音频 文件的全部帧解码, 并保持所述音频文件的全部帧的右声道信号不变,将所述 音频文件的全部帧的左声道信号反转。 If the left channel signal and the right channel signal of all frames of the audio file are reversed, decode all frames of the audio file, and keep the left channel signal of all frames of the audio file unchanged, and The right channel signal of all frames of the audio file is inverted; or If the left channel signal and the right channel signal of all frames of the audio file are reversed, decode all frames of the audio file, and keep the right channel signal of all frames of the audio file unchanged, and The left channel signal is inverted for all frames of the audio file.
16、 如权利要求 9-12任一项所述的方法, 其特征在于, 所述音频文件的 至少一帧包括: 16. The method according to any one of claims 9-12, characterized in that at least one frame of the audio file includes:
所述音频文件的起始第一帧或离散的至少两帧。 The first first frame or at least two discrete frames of the audio file.
17、 一种多媒体终端, 其特征在于, 所述多媒体终端包括音频输出设备、 存储器以及处理器, 其中, 存储器中存储一组播放器程序, 且处理器用于调用 存储器中存储的播放器程序, 用于执行以下操作: 17. A multimedia terminal, characterized in that the multimedia terminal includes an audio output device, a memory and a processor, wherein a set of player programs is stored in the memory, and the processor is used to call the player program stored in the memory, using To do the following:
对音频文件的至少一帧进行解码,获取所述音频文件的至少一帧的左声道 信号与右声道信号; Decode at least one frame of the audio file and obtain the left channel signal and the right channel signal of at least one frame of the audio file;
将所述音频文件的至少一帧的左声道信号与右声道信号进行叠加并获取 叠加后的叠加信号; Superimpose the left channel signal and the right channel signal of at least one frame of the audio file and obtain the superimposed superimposed signal;
判断所述叠加信号的幅值是否在预设范围内,若所述叠加信号的幅值在预 设范围内, 则判定所述音频文件的全部帧的左声道信号与右声道信号反向; 若所述音频文件的全部帧的左声道信号与右声道信号反向,则对所述音频 文件的全部帧解码,并将解码后得到的所述音频文件的全部帧的左声道信号与 右声道信号调整为同向; Determine whether the amplitude of the superimposed signal is within the preset range. If the amplitude of the superimposed signal is within the preset range, determine whether the left channel signal and the right channel signal of all frames of the audio file are inversely ; If the left channel signal and the right channel signal of all frames of the audio file are reversed, decode all frames of the audio file, and obtain the left channel of all frames of the audio file after decoding. The signal and the right channel signal are adjusted to the same direction;
将调整为同向的所述音频文件的全部帧的左声道信号与右声道信号进行 叠力口并播放。 The left channel signal and the right channel signal of all frames of the audio file adjusted to the same direction are overlapped and played.
PCT/CN2013/089678 2013-12-17 2013-12-17 Method for playing audio file in multimedia terminal and multimedia terminal WO2015089733A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2013/089678 WO2015089733A1 (en) 2013-12-17 2013-12-17 Method for playing audio file in multimedia terminal and multimedia terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2013/089678 WO2015089733A1 (en) 2013-12-17 2013-12-17 Method for playing audio file in multimedia terminal and multimedia terminal

Publications (1)

Publication Number Publication Date
WO2015089733A1 true WO2015089733A1 (en) 2015-06-25

Family

ID=53401922

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/089678 WO2015089733A1 (en) 2013-12-17 2013-12-17 Method for playing audio file in multimedia terminal and multimedia terminal

Country Status (1)

Country Link
WO (1) WO2015089733A1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4342059A (en) * 1979-04-24 1982-07-27 Polaroid Corporation Electronic gain and noise control for recording of analog information
CN102113315A (en) * 2008-07-29 2011-06-29 Lg电子株式会社 Method and apparatus for processing audio signal
CN102264026A (en) * 2010-05-25 2011-11-30 晨星软件研发(深圳)有限公司 audio processing device and audio processing method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4342059A (en) * 1979-04-24 1982-07-27 Polaroid Corporation Electronic gain and noise control for recording of analog information
CN102113315A (en) * 2008-07-29 2011-06-29 Lg电子株式会社 Method and apparatus for processing audio signal
CN102264026A (en) * 2010-05-25 2011-11-30 晨星软件研发(深圳)有限公司 audio processing device and audio processing method

Similar Documents

Publication Publication Date Title
US10768889B2 (en) Audio adjustment system
TWI664623B (en) Audio processor and corresponding method for loudness control for user interactivity in audio coding systems, and audio encoder
AU2008295723B2 (en) A method and an apparatus of decoding an audio signal
EP2044592A1 (en) A device and a method for playing audio-video content
JPWO2004077406A1 (en) Playback apparatus and playback method
CN106303816B (en) Information control method and electronic equipment
WO2010091555A1 (en) Stereo encoding method and device
CN106792048B (en) Method and device for recognizing voice command of smart television user
CN103841451B (en) Multi-medium play method, device and terminal
CN106878290B (en) Audio and video playing method and device
CN105654973A (en) Audio file processing method and system
CA2449255A1 (en) Hierarchical lossless encoding and decoding method, hierarchical lossless encoding method, hierarchical lossless decoding method, apparatus and program therefor
US11638112B2 (en) Spatial audio capture, transmission and reproduction
WO2015089733A1 (en) Method for playing audio file in multimedia terminal and multimedia terminal
JP2011090290A (en) Music extraction device and music recording apparatus
KR101073407B1 (en) Method and System for Control Mixing Audio Data
US11729574B2 (en) Spatial audio augmentation and reproduction
US20190213215A1 (en) Method and device for continuing a running playback of audio and/or video content from a first source after a temporary interruption or overlaying the running playback by a playback of audio and/or video content from a second source
JP2009277277A (en) Speech processing unit
JP2010074823A5 (en)
TW200603079A (en) Data processor and data processing method, program and program recording medium, and data recording medium
JP2008286904A (en) Audio decoding device
CN106941649B (en) Method for changing audio output mode of vehicle and apparatus therefor
WO2019051689A1 (en) Sound control method and apparatus for intelligent terminal
JP2003162299A (en) Speech reproducing circuit, decoding circuit, and device and method for reproducing speech

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13899954

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13899954

Country of ref document: EP

Kind code of ref document: A1