METHOD AND ELECTRONIC DEVICE FOR JOINTLY PLAYING HIGH-FIDELITY SOUNDS OF MULTIPLE PLAYERS
20170178636 ยท 2017-06-22
Inventors
Cpc classification
G10L19/0017
PHYSICS
G10L19/08
PHYSICS
G10L19/167
PHYSICS
International classification
G10L19/00
PHYSICS
G10L19/08
PHYSICS
Abstract
Disclosed are a data download method and a method and electronic device for jointly playing high-fidelity sounds of multiple players includes: receiving first sound data of a HIFI audio format and second sound data of a second audio format; transmitting the first sound data of the HIFI audio format to a first processor for decoding, decoding the second sound data of the second audio format, and converting the decoded second sound data into the second audio data of a PCM format; controlling the first processor to convert the second sound data of the PCM format into the second sound data of the HIFI audio format; and mixing and playing the first sound data and the second sound data of the HIFI audio format. The disclosure realizes reminder function while ensuring sound mixing joint playing of multiple paths of sound sources.
Claims
1. A method for jointly playing HIFI sounds of multiple players, executed by an electronic device, comprising: receiving first sound data of a HIFI audio format and second sound data of a second audio format, wherein the second audio format is an audio format except the HIFI format; transmitting the first sound data of the HIFI audio format to a first processor for decoding, decoding the second sound data of the second audio format, and converting the decoded second sound data into the second audio data of a pulse coding modulation PCM format; controlling the first processor to convert the second sound data of the PCM format into the second sound data of the HIFI audio format; and mixing and playing the first sound data and the second sound data of the HIFI audio format.
2. The method according to claim 1, wherein the first audio data of the HIFI audio format is decoded in a hardware decoding mode; and the sound data of the second audio format is decoded in a software decoding mode.
3. The method according to claim 1, wherein the PCM format is 48 k 16 bit PCM format.
4. The method according to claim 1, wherein mixing and playing the first sound data and the second sound data of the HIFI audio format comprises: mixing the first sound data and the second sound data of the HIFI audio format; performing digital-to-analogue conversion on the first and second sound mixed data after being mixed; transmitting the converted first and second sound mixed data for playing.
5. The method according to claim 1, wherein the first processor comprises: an audio signal processing chip ADSP.
6. An electronic device, comprising: at least one processor; and a memory communicably connected with the at least one processor for storing instructions executable by the at least one processor, wherein execution of the instructions by the at least one processor causes the at least one processor to: receiving first sound data of a HIFI audio format and second sound data of a second audio format, wherein the second audio format is an audio format except the HIFI format; transmitting the first sound data of the HIFI audio format to a first processor for decoding, decoding the second sound data of the second audio format, and converting the decoded second sound data into the second audio data of a pulse coding modulation PCM format; controlling the first processor to convert the second sound data of the PCM format into the second sound data of the HIFI audio format; and mixing and playing the first sound data and the second sound data of the HIFI audio format.
7. The electronic device according to claim 6, wherein the first audio data of the HIFI audio format is decoded in a hardware decoding mode; and the sound data of the second audio format is decoded in a software decoding mode.
8. The electronic device according to claim 6, wherein the PCM format is 48 k 16 bit PCM format.
9. The electronic device according to claim 6, wherein execution of the instructions by the at least one processor causes the at least one processor to: mix the first sound data and the second sound data of the HIFI audio format; perform digital-to-analogue conversion on the first and second sound mixed data after being mixed; transmit the converted first and second sound mixed data for playing.
10. The electronic device according to claim 6, wherein the first processor comprises: an audio signal processing chip ADSP.
11. A non-transitory computer-readable storage medium storing executable instructions that, when executed by an electronic device, cause the electronic device to: receive first sound data of a HIFI audio format and second sound data of a second audio format, wherein the second audio format is an audio format except the HIFI format; transmit the first sound data of the HIFI audio format to a first processor for decoding, decoding the second sound data of the second audio format, and converting the decoded second sound data into the second audio data of a pulse coding modulation PCM format; control the first processor to convert the second sound data of the PCM format into the second sound data of the HIFI audio format; and mix and playing the first sound data and the second sound data of the HIFI audio format.
12. The non-transitory computer-readable storage medium according to claim 11, wherein the first audio data of the HIFI audio format is decoded in a hardware decoding mode; and the sound data of the second audio format is decoded in a software decoding mode.
13. The non-transitory computer-readable storage medium according to claim 11, wherein the PCM format is 48 k 16 bit PCM format.
14. The non-transitory computer-readable storage medium according to claim 11, when the executable instructions is executed by an electronic device, cause the electronic device to: mix the first sound data and the second sound data of the HIFI audio format; perform digital-to-analogue conversion on the first and second sound mixed data after being mixed; transmit the converted first and second sound mixed data for playing.
15. The non-transitory computer-readable storage medium according to claim 11, wherein the first processor comprises: an audio signal processing chip ADSP.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0009] One or more embodiments are illustrated by way of example, and not by limitation, in the figures of the accompanying drawings, wherein elements having the same reference numeral designations represent like elements throughout. The drawings are not to scale, unless otherwise disclosed.
[0010]
[0011]
[0012]
[0013]
[0014]
DETAILED DESCRIPTION
[0015] The preferred embodiments of the present disclosure will be illustrated in conjunction with the following drawings. It should be appreciated that the preferred embodiments of the present disclosure are merely used for illustrating and explaining the present disclosure, rather than limiting it.
[0016] As shown in
[0017] S101: first sound data of the HIFI audio format and second sound data of the second audio format is received.
[0018] Wherein, opening HIFI music to play or playing HIFI music is regarded as receiving the first sound data of the HIFI audio format.
[0019] Wherein the second audio format in the embodiment may represent one or more audio formats except the HIFI format, such as tone, music played in a webpage, or music of other formats. The second sound data may also be sound data of multiple audio formats. In short, because all sound data of the second audio format are processed by a same way in the embodiment, sound data of the all other audio formats except the HIFI format, which may be one or more types of sound data, are referred to as second sound data of the second audio format. Further, the sound data in the embodiment may also be music data, or may be other sounds, such as the sound of speech.
[0020] S102: the first sound data of the HIFI audio format is transmitted to a first processor for decoding, and the second sound data of the second audio format is converted into the second audio data of a PCM format after decoding.
[0021] In an alternative implementation, the first sound data of the HIFI format are directly transmitted to the first processor for decoding by a hardware decoding method, the second sound data of the second audio format are decoded by a software decoding method, and the decoded second sound data is converted into the second sound data of the PCM format.
[0022] Due to lower power consumption of the hardware decoding method as compared with that of the software decoding method, it's preferred to play the first sound data by using the hardware decoding method; however, for a device with good performance, a device of high energy storage capability, the first sound data may also be decoded by using the software decoding method.
[0023] Further, in consideration of the advantage of software decoding that multi-path simultaneous decoding and playing can be realized, it's preferred to use the software decoding method for decoding the second sound data of the second audio format. In the same way, if a device is provided with more hardware decoders, or only one type of sound data of the second format exists, the sound data of the second format may also be decoded by using the hardware decoding method.
[0024] S103, the first processor is controlled to convert the second sound data of the PCM format into the second sound data of the HIFI audio format.
[0025] The first processor normally decodes the first sound data of the HIFI format, and converts the second sound data of the PCM format into the second sound data of the HIFI format.
[0026] In consideration of the case that the HIFI is not a fixed type of audio format, but rather mainly refers to an audio format in which play is performed with maintaining sampling rate and bit width of the sound source, sound mixing processing in the embodiment requires that audio data flow involved in sound mixing should be decoded into the PCM format before being carried out, thus the second sound data require to be decoded into the PCM format, and then re-sampled in accordance with the source format of the first sound data which are playing currently, and sound mixing is performed on the first sound and the re-sampled second sound, therefore, the technical effect of playing after mixing can be achieved.
[0027] S104: the first sound data and the second sound data of the HIFI audio format are mixed and played.
[0028] The first sound data and the second sound data are both in the HIFI format after being processed by the above-described steps 102-103, and thus can be jointly played.
[0029] Wherein an alternative solution is to specially convert the second sound data in 102 into the second sound data of a 48 k 16 bit PCM format. It should be noted that the tone is sound data of the 48 k 16 bit PCM format after being decoded, thus conversion is not needed, but for sound data of other audio formats, such as sound data of the music format playing in a webpage, re-sampling is required to obtain the 48 k 16 bit PCM format after decoding.
[0030] In an alternative solution, the 104 is specially realized by the following steps: mixing the first sound data of the HIFI audio format and the second sound data; performing digital-to-analogue conversion on the first and second sound mixed data after mixing; and transmitting the converted first and second sound mixed data to a headphone for playing.
[0031] Due to only having one output device, the playing music format is only one, and in case that multiple paths of audio stream are played at the same time without sound mixing, only one path of audio stream can be normally played while other paths of audio stream are stopped. Therefore, the music which is played currently is interrupted due to playing of tone and webpage in the prior art, thereby influencing normal playing of music.
[0032] In the above method provided by the embodiment, because considering that play of tone or an owned sound of a webpage is only used for prompting existence of the webpage for a user or appearing of corresponding prompt information, in normal application scenarios, the user does not need to care about the audios which are jointly playing, so that the technical means that the sound data in the non-HIFI format are converted into sound data in the HIFI format, and then mixed into the HIFI sound data to be played is adopted, thus receiving tone or sound played when a webpage is opened while realizing enjoyment of HIFI music, as well as achieving the technical effect of realizing reminder function while ensuring sound mixing joint playing of multiple paths of sound sources.
[0033] Optically, the embodiment described above is more suitable for the situation with only one output apparatus, if more output apparatuses exist, the above method is still available. To be specific, for example, if two output apparatuses exist, one is used for playing HIFI audio and the other one is used for playing audio of other formats (that is, the above audio data of the second audio format), if audio of a third format needs to be played when HIFI audio is playing, the audio of the third format can be processed as the audio data of the second audio format in the above embodiment, so as to be jointly played with the HIFI audio.
[0034] As shown in
[0035] S201: a hardware decoding mode is selected for play when the HIFI player of a mobile phone is intended to play a HIFI music, where the audio data stream is directly output to an audio signal processing chip (ADSP) for decoding.
[0036] S202: a software decoding mode is set for play of a tone when the tone is intended to be played during the HIFI play, where the audio data are decoded into an audio data of a 48 k 16 bit PCM format and then output to a sound mixing thread, such as audioflinger mixer thread.
[0037] S203: the software decoding mode is used for more subsequent play, sound data, such as webpage music, is output to the audioflinger sound mixer threading.
[0038] All the sound data received by the audioflinger sound mixer thread is re-sampled and mixed into the 48 k 16 bit PCM format, and output to the audio signal processing chip (ADSP).
[0039] S204: the ADSP decodes sound data of the HIFI audio format, and re-samples other sound data of the PCM format which need to be output into the sound data of the HIFI audio format which is played currently, and then mixed and output to a HIFI chip.
[0040] S205: after performing digital-analog sampling on the mixed sound data by the HIFI chip, the analog data is send to a headset/headphone for play.
[0041] The method provided by the embodiment can be used for jointly playing music of the HIFI format and music of other formats without interrupting the play of music of the HIFI format, thus improving auditory experience of a user.
[0042] In order to facilitate realization of the method in the embodiment as shown in
[0043] The receiving module 41 is configured to receive first sound data of the HIFI audio format and second sound data of a second audio format, wherein the second audio format is an audio format except the HIFI format;
[0044] The decoding module 42 is configured to transmit the first sound data of the HIFI audio format to a first processor for decoding, decode the second sound data of the second audio format, and convert the decoded second sound data into the second audio data of a PCM format.
[0045] The converting module 43 is configured to control the first processor to convert the second sound data of the PCM format into the second sound data of the HIFI audio format.
[0046] The mixing and playing module 44 is configured to mix and play the first sound data and the second sound data of the HIFI audio format.
[0047] Wherein, the decoding module 42 uses a hardware decoding mode for decoding the first audio data in the HIFI audio format. The decoding module 42 uses a software decoding mode for decoding the sound data in the second audio format.
[0048] Wherein, the PCM format is 48 k 16 bit PCM format.
[0049] Optionally, the mixing and playing module 44 includes: a mixing unit, configured to mix the first sound data and the second sound data in the HIFI audio format; a digital-to-analogue conversion unit, configured to perform digital-to-analogue conversion on the first and second sound mixed data after mixing; and a transmitting unit, configured to transmit the converted first and second sound mixed data to a headset/headphone for play.
[0050] Optionally, the first processor includes: an ADSP.
[0051] The electronic device provided by the embodiment is provided with a function of jointly playing sound data of the non-HIFI format and sound data of the HIFI format, thus, the technical effect that other sounds, such as a short message tone can be played without interruption of the playing HIFI music can be achieved.
[0052]
[0053] The electronic device 1100 for jointly playing HIFI sounds of multiple players includes a processor 1110, a communications interface 1120, a memory 1130 and a bus 1140, where the processor 1110, the communications interface 1120 and the memory array 1130 communicate with one another via the bus 1140.
[0054] The communications interface 1120 is configured to communicate with a network element, wherein the network element includes a virtual machine management center, a shared memory and the like.
[0055] The processor 1110 is configured to execute a program. The processor 1110 may be a CPU (Central Processing Unit), or an ASIC (Application Specific Integrated Circuit) or one or more integrated circuits configured to implement the embodiments of the present disclosure.
[0056] The memory 1130 is configured to store a file. The memory 1130 may include a high-speed RAM memory, and may also include a non-volatile memory, such as a magnetic disk memory. The memory 1130 may also be a memory array. The memory 1130 may be divided into blocks, and the blocks are combined into a virtual volume according to a particular rule.
[0057] In one possible implementation, the above program may be program code containing computer operating instructions. The program is specially configured to perform the following steps: receiving a first sound data of a HIFI audio format and a second sound data of a second audio format, wherein the second audio format is one audio format except the HIFI format; transmitting the first sound data of the HIFI audio format to the first processor for decoding, decoding the second sound data of the second audio format, and converting the decoded second sound data into the second audio data of a PCM format; controlling the first processor to convert the second sound data of the PCM format into the second sound data of the HIFI audio format; and mixing and playing the first sound data of the HIFI audio format and the second sound data.
[0058] In one possible implementation, the hardware decoding mode is used to decode the first audio data of the HIFI audio format; and the software decoding mode is used for decoding the sound data of the second audio format.
[0059] In one possible implementation, the PCM format is 48 k 16 bit PCM format.
[0060] In one possible implementation, mixing and playing the first sound data of the HIFI audio format and the second audio format includes: mixing the first sound data in the HIFI audio format and the second sound data; performing digital-to-analogue conversion on the first and second sound mixed data after mixing; and transmitting the converted first and second sound mixed data to a headset/headphone for play.
[0061] In one possible implementation, the first processor includes: an audio signal processing chip (ADSP).
[0062] The embodiment of the present disclosure provides a non-transitory computer-readable storage medium storing executable instructions that, when executed by an electronic device, cause the electronic device to execute the processing method in the case of any method embodiment mentioned above.
[0063] Those skilled in the art should be understood that, the embodiment of the present disclosure can be provided as a method, a system or a computer program product. Therefore, the present disclosure may in form of a full hardware embodiment, a full software embodiment, or an embodiment of combination of software and hardware. Moreover, the present disclosure may also in form of a computer program product implemented on one or more computer usable storage media (includes but is not limited to a magnetic disk memory, an optical memory and the like) containing computer usable program code.
[0064] The present disclosure is described with reference to the flowchart and/or block diagram of the method, device (system) and computer program product. It should be understood that each flow and/or block of the flowchart and/or the block diagram as well as a combination of flows and/or blocks of the flowchart and/or the block diagram may be implemented by computer program instructions. These computer program instructions may be provided to a general-purpose computer, a dedicated computer, an embedded processor or processors of other programmable data processing device to generate a machine, such that an electronic device configured to implement functions of one or more flows in the flowchart and/or one block or more blocks in the block diagram may be generated by the instructions executed on a computer or processors of other programmable data processing apparatuses.
[0065] These computer program instructions may also be stored in a computer readable memory which can direct the computer or other programmable data processing devices to operate in a specific mode, so as to enable the instructions stored in the computer readable memory to generate a manufacture product containing an instruction apparatus. The instruction apparatus can implement the function designated in one or more flows in the flowchart and/or one block or more blocks in the block diagram.
[0066] These computer program instructions may also be loaded in a computer or other programmable data processing devices, so as to perform a series of operation steps on the computer or other programmable data processing devices to generate processing implemented by the computer, thus instructions executed on the computer or other programmable devices can provide steps for implementing functions designated by one flow or more flows in the flowchart and/or one block or more blocks in the block diagram.
[0067] Descriptions of the specific exemplary embodiments of the foregoing present disclosure are for the purposes of explanation and illustration. Theses descriptions are not intended to limit the present disclosure as the disclosed precise form, and apparently, various alterations and variations can be made according to the above teaching. Selection and description for the exemplary embodiments aim at the specific principle and practical applications of the specific principle explaining the present disclosure, such that those skilled in the art can realize and utilize various different exemplary embodiments in the present disclosure and various different selections and alterations.
[0068] The above described device embodiments are merely exemplary, wherein units for separation component explanation can be or cannot be separated physically, and components as unit display can be or cannot be physical units, namely, can be located on the same position, or can be distributed on multiple network units. Part or all modules can be selected to realize the purpose of the solution of the embodiment according to practical needs. Those skilled in the art can understand and implement without creative effect.