Audio playing method and device, mobile terminal and storage medium

By creating a virtual device by acquiring the target device's hardware parameters, the problem of mobile terminals being unable to adaptively play high-resolution audio is solved, enabling adaptive cross-device playback of audio data and improving audio playback quality.

CN115237367BActive Publication Date: 2025-12-16Z-ONE TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210566938.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-23
Publication Date
2025-12-16
Estimated Expiration
2042-05-23

AI Technical Summary

Technical Problem

Mobile devices cannot adaptively match external high-quality audio playback devices, resulting in the inability to effectively play high-resolution audio data and affecting the user experience.

Method used

By obtaining the hardware parameters of the target device, a matching virtual device is created, the audio playback device is updated, and the audio data is processed based on the audio processing capabilities of the target device and sent to the target device for playback.

Benefits of technology

It enables adaptive cross-platform playback of audio data, improves audio playback quality, and allows users to enjoy high-quality audio.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115237367B_ABST
    Figure CN115237367B_ABST
Patent Text Reader

Abstract

The application discloses an audio playing method and device, a mobile terminal and a storage medium. The method comprises the following steps: obtaining a hardware parameter used for indicating an audio processing capability of a target device; creating a target virtual device matched with the hardware parameter; updating an audio playing device of the mobile terminal to the target virtual device; and sending audio data matched with the audio processing capability to the target device for playing based on the audio playing device. Thus, the audio data processed by the mobile terminal can be matched with the audio processing capability of the target device by creating the target virtual device, and the audio data processed by the mobile terminal is played through the target device, so that the adaptive cross-terminal playing of the audio data is realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of audio processing, and more particularly, to an audio playing method and device, a mobile terminal, and a storage medium. BACKGROUND

[0002] With the continuous upgrading of the capabilities of music playing devices, people's requirements for the quality of played music are also constantly improving. The traditional Moving Picture Experts Group Audio Layer-3 (MP3) sound quality, or even the Compact Disk (CD) sound quality, cannot meet the needs of many users, and people begin to pursue higher quality audio data, such as High Resolution Audio (Hi-Res). However, playing high-quality audio data such as Hi-Res usually requires some requirements for local playing devices, and for most electronic devices, mobile terminals such as mobile phones and tablets used for playing music on a daily basis cannot meet the ability to play such high-quality audio data. SUMMARY

[0003] In view of the above problems, the present application provides an audio playing method and device, a mobile terminal, and a storage medium, so as to enable the mobile terminal to realize adaptive cross-terminal playing of audio data.

[0004] In a first aspect, an embodiment of the present application provides an audio playing method applied to a mobile terminal, the method comprising: obtaining a hardware parameter of a target device, the hardware parameter being used to indicate an audio processing capability of the target device; creating a target virtual device matched with the hardware parameter; updating an audio playing device of the mobile terminal to the target virtual device; and based on the audio playing device, sending audio data matched with the audio processing capability to the target device for playing.

[0005] In a second aspect, an embodiment of the present application provides an audio playing device applied to a mobile terminal, the device comprising: a parameter obtaining module, a device creating module, a device updating module, and an audio playing module, wherein the parameter obtaining module is configured to obtain a hardware parameter of a target device, the hardware parameter being used to indicate an audio processing capability of the target device; the device creating module is configured to create a target virtual device matched with the hardware parameter; the device updating module is configured to update an audio playing device of the mobile terminal to the target virtual device; and the audio playing module is configured to, based on the audio playing device, send audio data matched with the audio processing capability to the target device for playing.

[0006] In a third aspect, an embodiment of the present application provides a mobile terminal, comprising: one or more processors; a memory; and one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the audio playing method in the first aspect.

[0007] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, wherein the computer readable storage medium stores program codes, and the program codes can be invoked by a processor to execute the audio playing method in the first aspect.

[0008] The scheme provided by the present application comprises the following steps: obtaining a hardware parameter of a target device, the hardware parameter being used to indicate an audio processing capability of the target device; creating a target virtual device matched with the hardware parameter; updating an audio playing device of the mobile terminal to the target virtual device; and sending audio data matched with the audio processing capability to the target device for playing based on the audio playing device. Thus, by creating the target virtual device, the audio data processed by the mobile terminal can be matched with the audio processing capability of the target device, and the audio data processed by the mobile terminal is played by the target device, so that the adaptive cross-terminal playing of the audio data is realized, and the audio playing effect is improved. BRIEF DESCRIPTION OF DRAWINGS

[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort.

[0010] Figure 1 An application scenario diagram of the audio playing method provided by an embodiment of the present application is shown.

[0011] Figure 2 A flowchart of the audio playing method provided by an embodiment of the present application is shown.

[0012] Figure 3 A flowchart of the audio playing method provided by another embodiment of the present application is shown.

[0013] Figure 4 A flowchart of the audio playing method provided by another embodiment of the present application is shown.

[0014] Figure 5 A flowchart of the audio playing method provided by another embodiment of the present application is shown.

[0015] Figure 6 A structural block diagram of an audio playing device provided by an embodiment of the present application is shown.

[0016] Figure 7 A structural block diagram of a mobile terminal provided by an embodiment of the present application is shown.

[0017] Figure 8 A structural block diagram of a computer readable storage medium provided by an embodiment of the present application is shown. DETAILED DESCRIPTION

[0018] In order to make the personnel in the technical field better understand the present application scheme, the technical scheme in the present application embodiment will be clearly and completely described below in combination with the drawings in the present application embodiment.

[0019] At present, people enjoy music anytime through mobile terminals such as mobile phones, and the quality requirement for playing music is also getting higher and higher. The traditional MP3 audio quality music has been unable to meet the needs of users, and developers have begun to pursue higher quality music playing. Therefore, CD audio quality audio data, and even Hi-Res audio quality audio data appear to maximize the characteristics of the original audio. Among them, Hi-Res is a high-quality audio product design standard proposed and defined by Sony, formulated by the Japan Audio Society and the Consumer Electronics Association, which can enable users to obtain the real feeling of the singer or performer in the live performance. The sound information contained therein exceeds the CD audio quality.

[0020] However, the mobile terminals such as mobile phones that people carry with them every day usually cannot support the playing of high-quality audio data such as Hi-Res due to hardware limitations. At this time, if the user's surroundings have external music playing devices that can play high-quality audio data such as Hi-Res, the user may naturally want to connect the mobile terminal with the external playing device to realize the playing of high-quality audio data through these external playing devices. However, in actual situations, the mobile terminal does not obtain the audio processing capability of the external device when playing audio data. Even if the external device is connected with the mobile terminal device, the mobile terminal still processes the original audio data with the audio playing capability of its own hardware device, and cannot adapt the audio data to the audio processing capability of the external playing device, so as to obtain high-quality audio data. Even if the playing is performed through the external playing device, the user cannot enjoy the playing effect of high-quality audio data.

[0021] In view of the above problems, the present application provides an audio playing method, device, mobile terminal and storage medium, which can realize the self-adaptive cross-terminal playing of audio data. The specific audio playing method is described in detail in the subsequent embodiments.

[0022] The hardware environment of the audio playing method provided by the embodiment of the present application is introduced as follows.

[0023] Please refer to Figure 1 , Figure 1 The application scenario diagram of the audio playing method provided by the embodiment of the present application is shown. The audio playing method is applied to a mobile terminal 300, which can be a mobile communication device such as a mobile phone, a tablet computer, a smart watch, etc. The mobile terminal includes an audio playing application capable of obtaining high-quality original audio data. The audio playing application can be a third-party audio playing application or an audio playing application provided by the operating system of the mobile terminal. These audio playing applications can obtain high-quality original audio data by reading music files from a local storage area or obtaining music files from a network, etc. The external audio playing device 400 can be an audio playing device of a car machine or an external independent playing device capable of playing high-quality audio data. The mobile terminal 300 can be connected with the external audio playing device 400 through wireless communication. The audio data of the mobile terminal 300 can be sent to the external audio playing device 400 for playing through the connection established between the mobile terminal 300 and the external audio playing device 400 through wireless communication. The wireless communication can be Bluetooth communication or wireless network communication, etc.

[0024] The audio playing method provided by the embodiment of the present application will be described in detail below with reference to the accompanying drawings.

[0025] Please refer to Figure 2 , Figure 2 The flowchart of the audio playing method provided by the embodiment of the present application is shown. The audio playing method is applied to a mobile terminal. The audio playing method will be described in detail below with reference to the flowchart shown in Figure 2 The audio playing method can include the following steps:

[0026] Step S110: Obtain the hardware parameter of the target device, which is used to indicate the audio processing capability of the target device.

[0027] In the embodiments of the present application, the target device refers to a device where the audio data is finally played. The mobile terminal acquires the hardware parameters of the target device, so as to process the audio data to match the audio processing capability of the target device according to the audio processing capability of the target device indicated by the hardware parameters, thereby enabling the target device to play the audio data matching the audio processing capability of the target device. It can be understood that different audio playing devices can have different quality of audio data to be played due to the limitation of their own hardware conditions, and in general, even if the mobile terminal is connected with the target device, the mobile terminal cannot process the original audio data based on the audio processing capability of the target device. Therefore, the mobile terminal can acquire the hardware parameters of the target device before sending the audio data to the target device, so as to acquire the audio processing capability of the target device, and process the original audio data based on the hardware parameters of the target device, thereby enabling the audio data to be played to be sent to the target device to match the audio processing capability of the target device.

[0028] The audio processing capability of the target device is not related to the audio processing capability of the mobile terminal, that is, the audio processing capability of the target device can be stronger than the audio processing capability of the mobile terminal, and the mobile terminal processes the original audio data based on the hardware parameters of the target device and sends it to the target device for playing, thereby enabling the user to enjoy higher quality audio data. Of course, the audio processing capability of the target device can be equal to or weaker than the audio processing capability of the mobile terminal, and the mobile terminal processes the audio data based on the hardware parameters and sends it to the target device for playing, thereby enabling the audio data sent by the mobile terminal to the target device to be more suitable for the playing capability of the target device.

[0029] In some embodiments, the mobile terminal can acquire the hardware parameters of the target device by interacting with the target device to acquire the hardware parameters of the target device when the communication with the target device is established. For example, a preset application can be installed in the target device, which can acquire the hardware parameters of the target device and send the acquired hardware parameters to the mobile terminal through the communication between the mobile terminal and the target device, and then the mobile terminal can acquire the hardware parameters of the target device.

[0030] In a possible embodiment, the mobile terminal can interact with the target device to acquire the hardware parameters of the target device when the audio playing instruction is detected, so as to process the audio data in the audio playing process according to the acquired hardware parameters, thereby enabling the target device to play the audio data matching the audio processing capability of the target device.

[0031] In another possible implementation, the mobile terminal pre-stores the hardware parameters of the target device, and when the mobile terminal plays audio data, the mobile terminal can read the stored hardware parameters and process the audio data in the audio playing process based on the obtained hardware parameters. For example, the target device is an audio playing device of a car machine end, and the mobile terminal can obtain the hardware parameters of the audio playing device of the car machine end when the mobile terminal plays audio through the audio playing device of the car machine end in the historical connection with the audio playing device of the car machine end, and store the hardware parameters, so as to read the stored hardware parameters when the mobile terminal is connected to the audio playing device of the car machine end again.

[0032] In some implementations, the mobile terminal can obtain the original audio data through a third-party audio playing application installed in the system or an audio playing application of the system. In addition, the original audio data can be obtained by the mobile terminal from other devices through a network or from a local storage space, which is not limited herein.

[0033] Step S120: creating a target virtual device matched with the hardware parameters.

[0034] In the embodiments of the present application, after the mobile terminal obtains the hardware parameters of the target device, the mobile terminal can obtain the audio processing capability of the target device based on the hardware parameters. Therefore, the mobile terminal can create a target virtual device matched with the hardware parameters, and the target virtual device has the same hardware parameters as the target device but does not have an entity hardware device. Therefore, after the mobile terminal obtains the original audio data, the mobile terminal can process the original audio data based on the audio processing capability of the target virtual device when the mobile terminal needs to play audio through the target device, so that the obtained audio data to be played can adapt to the audio processing capability of the target virtual device, that is, can adapt to the audio processing capability of the target device.

[0035] It can be understood that after the mobile terminal creates the target virtual device, the mobile terminal includes two devices that can be used to play audio data, the target virtual device and the local playing device of the mobile terminal. At this time, the mobile terminal does not need to perceive the difference between the target virtual device and the local playing device before processing the original audio data, that is, the local playing device can be replaced by the target virtual device, and then the mobile terminal can process the original audio data based on the audio processing capability of the target virtual device.

[0036] In some embodiments, the mobile terminal can create a blank virtual model first by using the virtual device creation interface provided by the Android system, and then modify, limit and fill the blank virtual model based on the hardware parameters of the target device to make it have the same audio processing capability as the target device, thereby obtaining a target virtual device matching the hardware parameters of the target device, which is only a memory space or buffer interval and does not have actual hardware devices.

[0037] Step S130: updating the audio playing device of the mobile terminal to the target virtual device.

[0038] In the embodiments of the present application, although the mobile terminal can create a target virtual device based on the hardware parameters of the target device, the fixed audio playing process of the mobile terminal will not change. That is, the mobile terminal will still obtain the audio playing capability corresponding to the audio playing device of the mobile terminal in the process of playing audio data, and process the obtained original audio data to make the obtained audio data to be played conform to the audio processing capability of the audio playing device of the mobile terminal, and the audio playing device of the mobile terminal generally points to the local playing device of the mobile terminal by default. Therefore, after the mobile terminal creates a target virtual device, the mobile terminal can update the local audio playing device to the target virtual device, that is, make the audio playing device point to the target virtual device again, so that the mobile terminal takes the target virtual device as the audio playing device of the mobile terminal in the process of playing audio data, and then processes the original audio data based on the audio processing capability of the audio playing device, that is, the target virtual device. Thus, the audio data matching the audio processing capability of the target virtual device, that is, the target device, can be obtained.

[0039] Step S140: sending the audio data matching the audio processing capability to the target device for playing based on the audio playing device.

[0040] In the embodiments of the present application, after the mobile terminal updates the audio playing device to the target virtual device, the mobile terminal can obtain the audio data matching the audio processing capability of the audio playing device, that is, the target virtual device, and then send the audio data to the target device for playing, so that the target device can play the audio data matching its audio processing capability. It is worth noting that the played audio data can adapt to the audio processing capability of the target device, that is, the self-adaptive cross-terminal playing of the audio data is realized even if the audio data is obtained and processed by the mobile terminal.

[0041] The audio playing method provided in the embodiments of the present application can create a target virtual device by indicating the hardware parameter of the audio processing capability of the target device, so that the audio data of the mobile terminal can be matched with the audio processing capability of the target device, and then the target device is used to play the audio data, thereby realizing adaptive cross-terminal playing of the audio data and improving the audio playing effect.

[0042] Please refer to Figure 3 , Figure 3 The flowchart of the audio playing method provided in another embodiment of the present application is shown, and the following will be described in detail with respect to the flowchart shown in Figure 3 The audio playing method can specifically include the following steps:

[0043] Step S210: Obtain the hardware parameter of the target device, which is used to indicate the audio processing capability of the target device.

[0044] Step S220: Create a target virtual device matched with the hardware parameter.

[0045] Step S230: Update the audio playing device of the mobile terminal to the target virtual device.

[0046] In the embodiments of the present application, steps S210 to S230 can refer to the content of other embodiments, which will not be described herein.

[0047] Step S240: Obtain original audio data.

[0048] In the embodiments of the present application, after the mobile terminal updates the audio playing device to the target virtual device, the original audio data can be obtained, so as to process the original audio data based on the audio playing device, and obtain audio data that can adapt to the audio processing capability of the audio playing device. When the mobile terminal plays the audio data, the audio playing data can be obtained based on the application program installed in the system, and the data is often encoded data. At this time, the mobile terminal can decode the audio playing data, and obtain the raw stream data in the pulse code modulation (PCM) format, that is, the original audio data. The original audio data in the PCM encoding format is the highest fidelity level of the encoding format that can be achieved at present, and can maximize the characteristics of the original audio in nature.

[0049] Step S250: Process the original audio data based on the audio processing capability of the audio playing device, and obtain first audio data matched with the audio processing capability.

[0050] In the embodiments of the present application, after the mobile terminal acquires the original audio data, the mobile terminal can process the original audio data so that the original audio data can adapt to the audio processing capability of the audio playback device. It can be understood that different audio playback devices can play audio data in different formats, such as FLAC, APE or AAC formats. At this time, the format of the original audio data acquired by the mobile terminal can not match the format of the audio data supported by the audio playback device. Therefore, the mobile terminal needs to perform format alignment on the original audio data based on the format supported by the audio playback device. Also, since there can be more than one software application that needs to play audio data at this time, after the mobile terminal acquires original audio data corresponding to multiple application software respectively, the mobile terminal also needs to perform mixing operation on the original audio data so that multiple different audio data can be played simultaneously in the same audio playback device.

[0051] It can be understood that the first audio data obtained by the mobile terminal at this time is adapted to the audio processing capability of the target device, but the audio processing capability of the target device can not necessarily be stronger than the audio processing capability of the local playback device of the mobile terminal.

[0052] In some embodiments, if the audio processing capability of the target device is weaker than the audio processing capability of the mobile terminal, the mobile terminal can also not create a target virtual device that matches the hardware parameters of the target device when playing audio data. In this case, the mobile terminal can first process the original audio data based on the audio processing capability of the local playback device to obtain intermediate audio data, and then perform down-sampling or compression encoding on the intermediate audio data to obtain the first audio data so that the first audio data can adapt to the audio processing capability of the target device.

[0053] Step S260: sending the first audio data to the target device for playing.

[0054] In the embodiments of the present application, the first audio data obtained by the mobile terminal after processing the original audio data can directly adapt to the audio playback device for playing, that is, the first audio data can be directly played in the target device. Therefore, the mobile terminal can send the first audio data to the target device, and the target device converts the digital signal of the first audio data into an analog signal and plays the analog signal through an amplifier, thereby realizing adaptive cross-end playing of the audio data. Specifically, the mobile terminal writes the processed first audio data into the audio playback device for playing. However, in the audio playing method provided in the present application, the audio playback device of the mobile terminal has been updated to a target virtual device in advance. The target virtual device is not a real hardware device, but a fixed-size buffer interval in the system of the mobile terminal. Therefore, the first audio data can be written into the buffer interval, and the data in the buffer interval can be transmitted to the target device, so as to achieve the effect of playing the audio data in the target device.

[0055] The audio playing method provided by the embodiments of the present application updates the audio playing device of the mobile terminal to the target virtual device by creating the target virtual device matching the hardware parameters of the target device, processes the obtained original audio data based on the audio processing capability of the audio playing device to obtain the first audio data matching the audio processing capability, and sends the first audio data to the target device for playing, thereby realizing the processing of the original audio data based on the audio processing capability of the target device and playing the audio data on the target device, and achieving the effect of adaptive cross-terminal playing of the audio data.

[0056] Please refer to Figure 4 , Figure 4 The flowchart of the audio playing method provided by another embodiment of the present application is shown, and the following will be described in detail with respect to the flowchart shown in Figure 4 The audio playing method can specifically include the following steps:

[0057] Step S310: Obtain the hardware parameters of the target device, which are used to indicate the audio processing capability of the target device.

[0058] Step S320: Create a target virtual device matching the hardware parameters.

[0059] Step S330: Update the audio playing device of the mobile terminal to the target virtual device.

[0060] Step S340: Obtain the original audio data.

[0061] In the embodiments of the present application, steps S310 to S340 can refer to the content of other embodiments, which will not be described here.

[0062] The audio processing capability includes the processing capability of high-resolution audio, and the original audio data is audio data of high-resolution audio type.

[0063] Step S350: Obtain the communication quality parameters between the mobile terminal and the target device.

[0064] In the embodiments of the present application, the communication quality parameter between the mobile terminal and the target device is used to represent the communication quality of the audio data between the mobile terminal and the target device, and the greater the parameter value of the communication quality parameter is, the higher the communication quality of the audio data between the mobile terminal and the target device is. The communication quality parameter can be the signal strength, the packet loss rate, the data transmission speed, etc. of the wireless communication between the mobile terminal and the target device, and the specific communication quality parameter is not limited. It can be understood that, since the original audio data to be processed is high-resolution audio data, and the target device supports the processing capability of high-resolution audio, the data amount of the audio data to be sent to the target device obtained through subsequent processing is large, and the communication quality parameter between the mobile terminal and the target device is obtained to process the original audio data according to the communication quality parameter, so as to ensure the audio playing effect.

[0065] Step S360: If the parameter value of the communication quality parameter is greater than the preset threshold, the original audio data is processed in a lossless coding manner based on the processing capability of the audio playing device for high-resolution audio, to obtain first audio data of high-resolution audio type.

[0066] In the embodiments of the present application, since the original audio data to be processed is high-resolution audio data, and the target device supports the processing capability of high-resolution audio, if the high-resolution audio data is losslessly encoded and transmitted according to the updated audio processing capability of the audio playing device, the data transmission amount is large, and the playing is prone to freezing. Therefore, after the mobile terminal obtains the communication quality parameter, the parameter value of the communication quality parameter is compared with the preset threshold. If the parameter value of the communication quality parameter is greater than the preset threshold, it indicates that the current communication quality can ensure the stable transmission of the high-resolution audio data. Therefore, the mobile terminal can process the original audio data in a lossless coding manner based on the processing capability of the audio playing device for high-resolution audio, to obtain first audio data of high-resolution audio type. The lossless coding means that the mobile terminal does not perform down-sampling or compression on the original audio data after obtaining the original audio data from the application software, so as to ensure that the original audio data does not lose any audio data.

[0067] Step S370: The first audio data is sent to the target device in a lossless transmission manner for playing.

[0068] In the embodiments of the present application, after the mobile terminal processes the original audio data in a lossless coding manner to obtain the first audio data, the mobile terminal can send the first audio data to the target device in a lossless transmission manner for playing. The lossless transmission manner for sending the first audio data needs to ensure that the mobile terminal and the target device have sufficient bandwidth, and optionally, the mobile terminal and the target device can be connected in a wireless network manner.

[0069] Step S380: If the parameter value of the communication quality parameter is less than or equal to the preset threshold, the original audio data is processed in a lossy coding manner based on the processing capability of the audio playback device for high-resolution audio to obtain second audio data.

[0070] In the embodiments of the present application, if the communication quality parameter between the mobile terminal and the target device is less than or equal to the preset threshold, it indicates that the current communication quality cannot guarantee the stable transmission of the high-resolution audio type of audio data. At this time, even if the mobile terminal sends the first audio data to the target device, the target device will have a playback lag due to the untimely reception of data, affecting the user experience. Therefore, in the case where the communication quality parameter is less than or equal to the preset threshold, the mobile terminal can process the original audio data in a lossy coding manner to obtain second audio data. At this time, since the lossy coding manner is used for processing, the data size of the second audio data will be smaller than the size of the first audio data obtained by the lossless coding manner, but under the current communication quality parameter, the second audio data can be smoothly transmitted to the target device for playing, which can effectively avoid the playback lag of the target device when playing the audio data. The lossy coding manner can be a processing manner such as downsampling or lossy compression of the original audio data to obtain second audio data with a smaller data size than the original audio data.

[0071] In some embodiments, the mobile terminal can obtain the communication quality parameter between the mobile terminal and the target device in real time, and when the communication quality parameter value is less than or equal to the preset threshold, the system can automatically reduce the audio playback quality of the target device or reduce the audio playback quality of the target device to the gear selected by the user under the selection operation of the user.

[0072] Step S390: The second audio data is sent to the target device for playing.

[0073] In the embodiment of the present application, the mobile terminal can send the second audio data to the target device for playing after obtaining the second audio data. Since the data amount of the second audio data is small, the second audio data can be transmitted by Bluetooth or wireless network, which is not limited here.

[0074] The audio playing method provided by the embodiment of the present application can update the audio playing device of the mobile terminal to the target virtual device by creating the target virtual device matched with the hardware parameters of the target device. After obtaining the original audio data, the communication quality parameter between the mobile terminal and the target device is obtained. If the parameter value of the communication quality parameter is greater than the preset threshold, the original audio data is processed into the first audio data of high resolution audio type. If the parameter value of the communication quality parameter is less than or equal to the preset threshold, the original audio data is processed into the second audio data with a smaller size. The first audio data or the second audio data is sent to the target device for playing. Based on the communication quality parameter between the mobile terminal and the target device and the audio processing capability of the target device, the high resolution audio is transmitted to the target device for playing when the current communication quality parameter is greater than the preset threshold. When the communication quality parameter is less than or equal to the preset threshold, the high resolution audio is processed by downsampling to reduce the size of the audio data to avoid playing lag. The high resolution audio data is played based on the audio processing capability of the target device, and the smooth effect of playing the audio data by the target device is ensured.

[0075] Please refer to Figure 5 , Figure 5 The flowchart of the audio playing method provided by another embodiment of the present application is shown. The audio playing method will be described in detail below with respect to the flowchart shown in Figure 5 The audio playing method can specifically include the following steps:

[0076] Step S410: Obtain the hardware parameters of the target device, which are used to indicate the audio processing capability of the target device.

[0077] In the embodiment of the present application, step S410 can refer to the content of other embodiments, which will not be described here

[0078] Step S420: Display the audio data type matched with the audio processing capability indicated by the hardware parameters.

[0079] In the embodiments of the present application, the target device can play at least one type of audio data, the audio data size corresponding to each type of audio data can be different, and the playing effect can also be different. Therefore, after the mobile terminal obtains the hardware parameters of the target device, it can determine all the types of audio data matched with the audio processing capability of the target device indicated by the hardware parameters, that is, it can determine all the types of audio data supported by the target device for playing. At this time, the mobile terminal can display all the types of audio data supported by the target device, so as to obtain the selection operation of the user and determine the type of audio data finally played on the target device.

[0080] In some embodiments, the types of audio data of the target device can include high-resolution audio quality, surround sound quality, ultra-clear sound quality, standard sound quality and the like. The playing effect of each type of audio data is different, and the size of the audio data is also different. The user can select to play different types of audio data based on his own needs or the current network condition.

[0081] In some embodiments, the mobile terminal can also obtain the communication quality parameter between the mobile terminal and the target device in real time. In some cases, if the communication quality parameter is less than a preset threshold, even if the target device can support the playing of high-resolution audio data with a large data volume, it is very likely that the playing process will be interrupted. In this case, when the mobile terminal displays the types of audio data matched with the audio processing capability of the target device, it can not display the high-resolution audio type. That is, the types of audio data displayed by the mobile terminal can include all the types of audio data that can be supported by the target device for playing and can be supported by the current communication quality parameter for playing.

[0082] Step S430: In response to the selection operation based on the type of audio data, the selected type of audio data is obtained as the target type of audio data to be played.

[0083] In the embodiments of the present application, the user can select any type of audio data as the target type of audio data finally played by the target device based on all the types of audio data supported by the target device displayed by the mobile terminal.

[0084] In some embodiments, the types of audio data matched with the audio processing capability indicated by the hardware parameters of the target device can be displayed on the display screen of the mobile terminal or on the display screen of the target device. That is, the user can select any type of audio data as the target type of audio data to be played on the display screen of the mobile terminal, or can select the target type of audio data on the display screen of the target device and transmit the target type of audio data to the mobile terminal, so that the mobile terminal can process the original audio data based on the target type of audio data.

[0085] Step S440: If the audio processing capability of the local playback device of the mobile terminal does not match the target data type, a target virtual device matching the hardware parameters is created.

[0086] In the embodiments of the present application, since the user can autonomously select the type of audio data to be played by the target device, and the local playback device of the mobile terminal can also support playing multiple types of audio data, the types of audio data supported by the target device and the types of audio data supported by the local playback device of the mobile terminal are likely to have some overlap. After the user selects the target data type of the audio data to be played, the target data type can be matched with the audio processing capability of the local playback device of the mobile terminal, and then based on the matching result, different processing manners are determined. Specifically, if they do not match, it indicates that the audio data of the target data type cannot be played on the local playback device, and at this time the mobile terminal can create a target virtual device matching the hardware parameters of the target device, to process the original audio data based on the audio processing capability of the target virtual device, to obtain the audio data of the target data type.

[0087] Step S450: The audio playback device of the mobile terminal is updated to the target virtual device

[0088] Step S460: Based on the audio playback device, the audio data matching the audio processing capability is sent to the target device for playing.

[0089] In the embodiments of the present application, steps S450 and S460 can refer to the content of other embodiments, which will not be described here.

[0090] Step S470: If the audio processing capability of the local playback device of the mobile terminal matches the target data type, the audio data of the target data type is sent to the target device for playing based on the local playback device.

[0091] In the embodiments of the present application, if the target data type autonomously selected by the user matches the audio processing capability of the local playback device of the mobile terminal, it indicates that the mobile terminal can meet the user's requirement for the type of audio data at this time, and the mobile terminal only needs to process the original audio data based on the audio processing capability of the local playback device to obtain the audio data of the target data type. Thereafter, the mobile terminal sends the audio data of the target data type to the target device for playing, without having to create a target virtual device matching the audio processing capability based on the hardware parameters of the target device.

[0092] The audio playing method provided in the embodiments of the present application displays an audio data type matched with the audio processing capability indicated by the hardware parameter of the target device, acquires a target data type of audio data to be played in response to a selection operation of a user, and matches the target data type with the audio processing capability of the local playing device. If the target data type is not matched with the audio processing capability of the local playing device, a target virtual device matched with the hardware parameter of the target device is created, and the audio playing device is updated to the target virtual device. The audio data is sent to the target device for playing based on the audio playing device. If the target data type is matched with the audio processing capability of the local playing device, the audio data of the target data type is sent to the target device for playing based on the local playing device. The type of the audio data to be played is determined based on the audio processing capability of the target device and the autonomous selection of the user, so that the audio data played by the target device can meet the user demand and adapt to the audio processing capability of the target device, and the audio data adaptive cross-terminal playing is realized.

[0093] Referring to Figure 6 which shows a structural block diagram of an audio playing apparatus 200 provided in the embodiments of the present application, applied to a mobile terminal. The audio playing apparatus 200 comprises a parameter acquisition module 210, a device creation module 220, a device updating module 230, and an audio playing module 240. The parameter acquisition module 210 is configured to acquire a hardware parameter of a target device, the hardware parameter being used to indicate an audio processing capability of the target device. The device creation module 220 is configured to create a target virtual device matched with the hardware parameter. The device updating module 230 is configured to update an audio playing device of the mobile terminal to the target virtual device. The audio playing module 240 is configured to send audio data matched with the audio processing capability to the target device for playing based on the audio playing device.

[0094] As a possible implementation, the audio playing module 240 comprises a data acquisition unit, a data processing unit, and a data sending unit. The data acquisition unit is configured to acquire original audio data. The data processing unit is configured to process the original audio data based on the audio processing capability of the audio playing device to obtain first audio data matched with the audio processing capability. The data sending unit is configured to send the first audio data to the target device for playing.

[0095] As a possible implementation, the audio processing capability comprises a processing capability of high-resolution audio, and the original audio data is audio data of a high-resolution audio type. The data processing unit is further configured to process the original audio data in a lossless coding manner based on the processing capability of the audio playing device for high-resolution audio to obtain first audio data of the high-resolution audio type. The data sending unit is further configured to send the first audio data to the target device for playing in a lossless transmission manner.

[0096] As a possible implementation, the audio playing module 240 further comprises a parameter obtaining unit and a first audio processing unit. The parameter obtaining unit is configured to obtain a communication quality parameter between the mobile terminal and the target device; and the first audio processing unit is configured to perform the action of the data processing unit if the parameter value of the communication quality parameter is greater than a preset threshold.

[0097] As a possible implementation, the audio playing module 240 further comprises a second audio processing unit and an audio playing unit. The second audio processing unit is configured to, if the parameter value of the communication quality parameter is less than or equal to the preset threshold, process the original audio data in a lossy coding manner based on the processing capability of the audio playing device for high-resolution audio to obtain second audio data; and the audio playing unit is configured to send the second audio data to the target device for playing.

[0098] As a possible implementation, the audio playing apparatus 200 further comprises a type display module, a selection obtaining module and a first matching module. The type display module is configured to display an audio data type matched by the audio processing capability indicated by the hardware parameter; the selection obtaining module is configured to, in response to a selection operation based on the audio data type, obtain the selected audio data type as a target data type of the audio data to be played; and the first matching module is configured to, if the audio processing capability of the local playing device of the mobile terminal does not match the target data type, perform the action of the device creating module 220.

[0099] As a possible implementation, the audio playing apparatus 200 further comprises a second matching module, configured to, if the audio processing capability of the local playing device of the mobile terminal matches the target data type, send the audio data of the target data type to the target device for playing based on the local playing device.

[0100] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described apparatuses and modules can refer to the corresponding process in the foregoing method embodiments, which will not be described herein.

[0101] In several embodiments provided in the present application, the coupling between the modules can be electrical, mechanical or other forms of coupling.

[0102] In addition, each functional module in each embodiment of the present application can be integrated in one processing module, or each module can exist physically independently, or two or more modules can be integrated in one module. The integrated module can be realized in the form of hardware or in the form of a software functional module.

[0103] To sum up, the scheme provided in the application, the mobile terminal acquires the hardware parameter for indicating the audio processing capability of the target device, creates a target virtual device matched with the hardware parameter, updates the audio playing device of the mobile terminal to the target virtual device, and sends the audio data matched with the audio processing capability to the target device for playing based on the audio playing device. Thus, the audio data of the mobile terminal can be matched with the audio processing capability of the target device by creating the target virtual device, and the audio data is played by the target device, realizing the adaptive cross-terminal playing of the audio data.

[0104] Please refer to Figure 7 which shows a structure block diagram of a mobile terminal 300 provided by an embodiment of the application. The mobile terminal 300 in the application can include one or more of the following components: a processor 310, a memory 320, and one or more application programs, wherein the one or more application programs can be stored in the memory 320 and configured to be executed by the one or more processors 310, and the one or more programs are configured to execute the method as described in the foregoing method embodiment.

[0105] The processor 310 can include one or more processing cores. The processor 310 connects various parts in the entire computer device by various interfaces and lines, executes various functions of the computer device and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 320, and calling data stored in the memory 320. Optionally, the processor 310 can be realized in at least one of the following hardware forms: digital signal processing (DSP), field programmable gate array (FPGA), and programmable logic array (PLA). The processor 310 can integrate a combination of one or several of the following: central processing unit (CPU), graphics processing unit (GPU), and modem. Among them, the CPU mainly processes operating systems, user interfaces, and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used for processing wireless communication. It can be understood that the above-mentioned modem can also not be integrated into the processor 310, but be realized by a separate communication chip.

[0106] The memory 320 can include a random access memory (RAM) and can also include a read-only memory (ROM). The memory 320 can be used to store instructions, programs, codes, code sets, or instruction sets. The memory 320 can include a program storage area and a data storage area, where the program storage area can store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing each of the following method embodiments, etc. The data storage area can also store data created by the computer device in use (such as a phone book, audio and video data, chat record data, etc.).

[0107] Reference is made to Figure 8 which shows a structural block diagram of a computer readable storage medium provided by an embodiment of the present application. The computer readable medium 800 stores program codes therein, which can be invoked by a processor to execute the methods described in the above method embodiments.

[0108] The computer readable storage medium 800 can be an electronic storage such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Alternatively, the computer readable storage medium 800 includes a non-transitory computer readable medium. The computer readable storage medium 800 has a storage space for program codes 810 to execute any of the above methods. These program codes can be read from or written to one or more computer program products. The program codes 810 can be compressed in an appropriate form, for example.

[0109] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than limit them. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements to some technical features thereof, without departing from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. An audio playback method, characterized by, The method is applied to a mobile terminal and comprises the following steps: obtaining a hardware parameter of a target device and a target data type supported by the target device, wherein the hardware parameter is used to indicate an audio processing capability of the target device; if the audio processing capability of a local playback device of the mobile terminal does not match the target data type, creating a target virtual device that matches the hardware parameter; updating an audio playback device of the mobile terminal to the target virtual device; based on the audio playback device, sending audio data that matches the audio processing capability to the target device for playback; if the audio processing capability of the local playback device of the mobile terminal matches the target data type, based on the local playback device, sending the audio data of the target data type to the target device for playback.

2. The method of claim 1, wherein, The step of based on the audio playback device, sending audio data that matches the audio processing capability to the target device for playback comprises the following steps: obtaining original audio data; based on the audio processing capability of the audio playback device, processing the original audio data to obtain first audio data that matches the audio processing capability; sending the first audio data to the target device for playback.

3. The method of claim 2, wherein, The audio processing capability comprises a processing capability for high-resolution audio, the original audio data is audio data of a high-resolution audio type, and the step of based on the audio processing capability of the audio playback device, processing the original audio data to obtain first audio data that matches the audio processing capability comprises the following step: based on the processing capability of the audio playback device for high-resolution audio, processing the original audio data in a lossless manner to obtain first audio data of a high-resolution audio type. The step of sending the first audio data to the target device for playback comprises the following step: sending the first audio data to the target device for playback in a lossless transmission manner.

4. The method of claim 3, wherein, Before the step of based on the processing capability of the audio playback device for high-resolution audio, processing the original audio data in a lossless manner to obtain first audio data of a high-resolution audio type, the method further comprises the following steps: obtaining a communication quality parameter between the mobile terminal and the target device; if a parameter value of the communication quality parameter is greater than a preset threshold, performing the step of based on the audio processing capability of the audio playback device, processing the original audio data to obtain first audio data of a high-resolution audio type.

5. The method of claim 4, wherein, After the step of obtaining the communication quality parameter between the mobile terminal and the target device, the method further comprises the following steps: if the parameter value of the communication quality parameter is less than or equal to the preset threshold, based on the processing capability of the audio playback device for high-resolution audio, processing the original audio data in a lossy manner to obtain second audio data; sending the second audio data to the target device for playback.

6. The method according to any one of claims 1 to 5, characterized in that, Before the step of obtaining the hardware parameter of the target device and the target data type, the method further comprises the following steps: display an audio data type matched with the audio processing capability indicated by the hardware parameter; in response to a selection operation based on the audio data type, acquire the selected audio data type as a target data type of audio data to be played.

7. An audio playback device, characterized by The apparatus is applied to a mobile terminal, and the apparatus comprises a parameter acquisition module, a device creation module, a device update module, and an audio playing module, wherein, the parameter acquisition module is configured to acquire a hardware parameter of a target device and a target data type supported by the target device, the hardware parameter being used to indicate an audio processing capability of the target device; the device creation module is configured to create a target virtual device matched with the hardware parameter if an audio processing capability of a local playing device of the mobile terminal does not match the target data type; the device update module is configured to update an audio playing device of the mobile terminal to the target virtual device; the audio playing module is configured to send audio data matched with the audio processing capability to the target device for playing based on the audio playing device, and if the audio processing capability of the local playing device of the mobile terminal matches the target data type, send audio data of the target data type to the target device for playing based on the local playing device.

8. A mobile terminal, characterized by The mobile terminal comprises: one or more processors; a memory; one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores program codes, and the program codes can be invoked by a processor to execute the method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Microphone resource access method, operating system, terminal and virtual microphone

    CN113391838A

  • Audio playing method and related equipment

    CN114398020A