Audio transmission method, vehicle-mounted audio device, electronic device, and vehicle

By processing and encoding audio data in electronic devices and sending it to in-vehicle audio equipment, the problem of low bandwidth utilization is solved, enabling independent playback and adjustment of different types of audio data, thus improving the user experience.

CN120108407BActive Publication Date: 2025-12-12HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311655867.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-30
Publication Date
2025-12-12
Estimated Expiration
2043-11-30

AI Technical Summary

Technical Problem

In audio transmission and playback scenarios, the bandwidth utilization between the mobile phone and the vehicle's infotainment system is low, resulting in reduced transmission speed. This makes it impossible to independently play and adjust different types of audio data, thus reducing the user experience.

Method used

In electronic devices, multiple audio data are processed into sub-audio data, which are then encoded by corresponding encoders to form encoded audio, which is then sent to the in-vehicle audio equipment. The in-vehicle audio equipment decodes the audio into independent audio data for playback and adjustment.

Benefits of technology

It improved bandwidth utilization, enabled independent playback and adjustment of different types of audio data, and enhanced the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120108407B_ABST
    Figure CN120108407B_ABST
Patent Text Reader

Abstract

The application provides an audio transmission method, a vehicle-mounted audio device, an electronic device and a vehicle, and relates to the technical field of audio processing. The method comprises the following steps: acquiring a plurality of encoded audios; each encoded audio corresponds to a data packet; performing packet combining processing on the plurality of encoded audios to obtain packet combining data; the packet combining data corresponds to one data packet; sending the packet combining data to the vehicle-mounted audio device through a preset transmission channel; and the packet combining data is used to trigger the vehicle-mounted audio device to perform packet splitting processing on the packet combining data to obtain the plurality of encoded audios. The audio transmission method greatly compresses the data volume of the encoded audios, enables more data volume of encoded audios to be transmitted at one time through the transmission channel, improves the bandwidth utilization rate, and improves the transmission speed of the encoded audios.
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, in particular to an audio transmission method, a vehicle-mounted audio device, an electronic device and a vehicle. BACKGROUND

[0002] With the rapid development of electronic technology, the interaction scenarios between electronic devices (such as mobile phones) and vehicle information systems (referred to as car machines) are becoming more and more rich. At present, a variety of application programs support service access, audio and video transmission and playing operations between mobile phones and car machines.

[0003] Generally, in the scenario of audio transmission and playing, when the mobile phone transmits audio data to the car machine, a transmission channel is multiplexed, resulting in low utilization of bandwidth and reducing the transmission speed. SUMMARY

[0004] The present application provides an audio transmission method, a vehicle-mounted audio device, an electronic device and a vehicle, which can transmit more data volume of encoded audio through a transmission channel at a time, improve the bandwidth utilization, and improve the transmission speed of the encoded audio.

[0005] In a first aspect, the present application provides an audio transmission method applied to an application program framework layer of an electronic device, the electronic device being connected with a vehicle-mounted audio device, the method comprising: obtaining a plurality of encoded audios; performing packet combining processing on the plurality of encoded audios to obtain packet combined data; the packet combined data corresponding to one data packet; sending the packet combined data to the vehicle-mounted audio device through a preset transmission channel; and the packet combined data being used to trigger the vehicle-mounted audio device to perform packet splitting processing on the packet combined data to obtain the plurality of encoded audios.

[0006] The audio transmission method provided by the present application performs packet combining processing on the encoded audio, greatly compresses the data volume of the encoded audio, enables more data volume of encoded audio to be transmitted through a transmission channel at a time, improves the bandwidth utilization, and improves the transmission speed of the encoded audio.

[0007] Optionally, the plurality of encoded audios in the vehicle-mounted audio device are used to trigger the vehicle-mounted audio device to perform decoding processing on the plurality of encoded audios through a decoder created for the plurality of encoded audios to obtain a plurality of decoded audios; and the plurality of decoded audios are used for the vehicle-mounted audio device to play the plurality of decoded audios according to a playing strategy.

[0008] Optionally, the playing strategy comprises independently adjusting the playing volume of each decoded audio corresponding to the decoded audio, and / or playing the decoded audio corresponding to a specified speaker through the specified speaker.

[0009] In this implementation, the vehicle-mounted audio device decodes the encoded audio through the decoder created for the encoded audio, and the decoded audio obtained after the decoding is a single audio (or each decoded audio obtained is an audio of a different type). Therefore, the vehicle-mounted audio device can independently play, adjust, and the like each audio, for example, can adjust the volume of music, navigation sound, and call sound respectively, and can specify different speakers to play different types of audio. In this way, many optimization scenarios for improving user experience between the electronic device and the vehicle can be implemented, the personalized needs of vehicle audio playback can be met, and the driving and riding experience of the driver and passengers of the vehicle is improved.

[0010] With reference to the first aspect, in some implementations of the first aspect, the audio transmission method provided by the embodiments of the present application further includes: receiving audio data generated by a plurality of application programs; processing the audio data into sub-audio data; and encoding the sub-audio data through a corresponding number of encoders created for the sub-audio data to obtain a plurality of encoded audios.

[0011] Optionally, the audio data can include at least one of media audio data, navigation audio data, call audio data, notification audio data, warning audio data, prompt audio data, and ringtone audio data.

[0012] Optionally, the sub-audio data can include at least one of media sub-audio data, navigation sub-audio data, call sub-audio data, and mixed sub-audio data.

[0013] The mixed sub-audio data is obtained by mixing other sub-audio data except the media sub-audio data, the navigation sub-audio data, and the call sub-audio data.

[0014] Optionally, the other sub-audio data can include at least one of notification sub-audio data, warning sub-audio data, prompt sub-audio data, and ringtone sub-audio data.

[0015] In this implementation, the electronic device processes the audio data into individual audio track data, which is conducive to subsequent independent playing, adjusting, and the like of each audio by the vehicle-mounted audio device.

[0016] With reference to the first aspect, in some implementations of the first aspect, the audio transmission method provided by the embodiments of the present application further includes: creating a corresponding input buffer for each encoder, and the input buffer corresponding to each encoder is used to store the encoded audio corresponding to each encoder.

[0017] The obtaining of the plurality of encoded audios includes: reading the encoded audio from each input buffer in each preset period to obtain the plurality of encoded audios.

[0018] Optionally, the preset period is the same as the storage duration of each encoded audio in each input buffer.

[0019] In this implementation, a respective input buffer is created for each encoder, so that one buffer only needs to store encoded audio of one type of audio, and the reading, storage and other operations of encoded audio between different types of audio can be ensured not to be disturbed.

[0020] In combination with the first aspect, in some implementations of the first aspect, the multiple encoded audios are subjected to packet combining processing to obtain packet combined data, including: setting a data header for each encoded audio; and splicing the data header corresponding to each encoded audio and the data packet corresponding to each encoded audio to obtain the packet combined data.

[0021] In this implementation, the encoded audio is subjected to packet combining processing, which greatly compresses the data volume of the encoded audio, is conducive to subsequent transmission of more data volume of encoded audio at one time through the transmission channel, thereby improving the bandwidth utilization and the transmission speed of the encoded audio.

[0022] In combination with the first aspect, in some implementations of the first aspect, the packet combined data is sent to the vehicle-mounted audio device through a preset transmission channel, including: after detecting successful acquisition of the packet combined data within a preset period, the packet combined data is sent to the vehicle-mounted audio device through the preset transmission channel.

[0023] In this implementation, the packet combined data is transmitted after successful acquisition of the packet combined data, which ensures the success rate of transmission of the packet combined data.

[0024] In combination with the first aspect, in some implementations of the first aspect, the audio transmission method provided by the embodiments of the present application further includes: receiving an instruction for disconnecting the electronic device from the vehicle-mounted audio device, and destroying each input buffer.

[0025] In this implementation, the created input buffer is destroyed in time, which effectively avoids long-term occupation of system resources by the input buffer, improves the resource utilization, and improves the performance of the electronic device.

[0026] Secondly, the present application provides an audio transmission method applied to an application framework layer of a vehicle-mounted audio device, the vehicle-mounted audio device being connected with an electronic device, the method including: receiving packet combined data sent through a preset transmission channel; the packet combined data corresponding to one data packet; the packet combined data being obtained by subjecting multiple encoded audios to packet combining processing by the application framework layer of the electronic device; subjecting the packet combined data to packet splitting processing to obtain multiple encoded audios; each encoded audio corresponding to one data packet.

[0027] In the implementation, since the received packaged data is obtained by the electronic device after packaging a plurality of encoded audios, the data amount of the encoded audios is greatly compressed, and the vehicle-mounted audio device can receive more data amount of encoded audios at one time, the bandwidth utilization is improved, and the transmission speed of the encoded audios is improved.

[0028] With reference to the second aspect, in some implementations of the second aspect, the packaged data includes a data header corresponding to each encoded audio and a data packet corresponding to each encoded audio, and the unpackaging of the packaged data to obtain the plurality of encoded audios includes: analyzing the data header corresponding to each encoded audio in the packaged data; and analyzing the data packet corresponding to each encoded audio according to the data packet length of the encoded audio in each data header.

[0029] In the implementation, by analyzing the data header in the packaged data, each encoded audio can be accurately and quickly analyzed, which is beneficial to subsequent decoding processing of the encoded audio by the vehicle-mounted audio device, so as to independently play, adjust, and the like, each audio.

[0030] With reference to the second aspect, in some implementations of the second aspect, the audio transmission method provided by the embodiments of the present application further includes: decoding each encoded audio by a decoder created for each encoded audio to obtain a plurality of decoded audios; and playing the plurality of decoded audios according to a playing strategy, wherein the playing strategy includes independently adjusting a playing volume corresponding to each decoded audio, and / or playing a decoded audio corresponding to a specified speaker by the specified speaker.

[0031] In the implementation, the decoded audio obtained by the vehicle-mounted audio device after decoding processing of the encoded audio by the decoder created for the encoded audio is an individual audio (or each decoded audio is an audio of different type). Therefore, the vehicle-mounted audio device can independently play, adjust, and the like, each audio, for example, can respectively adjust the volume of music, navigation sound, and call sound, and can specify different speakers to play audios of different types. Thus, many optimization scenarios for improving user experience between the electronic device and the vehicle can be realized, the individualized demand of audio playing of the vehicle can be met, and the driving and riding experience of the driver and the passenger of the vehicle is improved.

[0032] In a third aspect, the present application provides an electronic device, including: one or more processors; one or more memories; a module installed with a plurality of applications; and the memory stores one or more programs, when the one or more programs are executed by the processor, the electronic device executes the method in the first aspect and any possible implementation manner thereof.

[0033] In a fourth aspect, the present application provides a vehicle-mounted audio device, comprising: one or more processors; one or more memories; a module installed with a plurality of application programs; and the memory stores one or more programs, which, when executed by the processor, cause the vehicle-mounted audio device to perform the method in the second aspect and any possible implementation manner thereof.

[0034] In a fifth aspect, the present application provides a vehicle, comprising: one or more processors; one or more memories; and the memory stores one or more programs, which, when executed by the processor, cause the vehicle to perform the method in the second aspect and any possible implementation manner thereof.

[0035] In a sixth aspect, the present application provides a chip, comprising a processor. The processor is configured to read and execute a computer program stored in a memory, so as to perform the method in the first aspect and any possible implementation manner thereof, or perform the method in the second aspect and any possible implementation manner thereof.

[0036] Optionally, the chip further comprises a memory, which is connected to the processor through a circuit or a wire.

[0037] Optionally, the chip further comprises a communication interface.

[0038] In a seventh aspect, the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor performs the method in the first aspect and any possible implementation manner thereof, or performs the method in the second aspect and any possible implementation manner thereof.

[0039] In an eighth aspect, the present application provides a computer program product, comprising: computer program code, which, when running on an electronic device, causes the electronic device to perform the method in the first aspect and any possible implementation manner thereof. Or, when running on a vehicle-mounted audio device, causes the vehicle-mounted audio device to perform the method in the second aspect and any possible implementation manner thereof.

[0040] The technical effects obtained by the above-mentioned second aspect, third aspect, fourth aspect, fifth aspect, sixth aspect, seventh aspect and eighth aspect can refer to the technical effects obtained by the corresponding technical means in the first aspect and the second aspect, which will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS

[0041] Figure 1 An application scenario diagram of the audio processing method shown in the embodiments of the present application;

[0042] Figure 2Another application scenario of the audio processing method shown in the embodiments of the present application is illustrated;

[0043] Figure 3 A display interface shown in an embodiment of the present application is illustrated;

[0044] Figure 4 A software structure diagram of an electronic device shown in an example embodiment of the present application is illustrated;

[0045] Figure 5 A system architecture diagram shown in an example embodiment of the present application is illustrated;

[0046] Figure 6 A flowchart of an audio processing method shown in an embodiment of the present application is illustrated;

[0047] Figure 7 A flowchart of another audio processing method shown in an embodiment of the present application is illustrated;

[0048] Figure 8 Another system architecture diagram shown in an embodiment of the present application is illustrated;

[0049] Figure 9 A flowchart of another audio processing method shown in an embodiment of the present application is illustrated;

[0050] Figure 10 A flowchart of another audio processing method shown in an embodiment of the present application is illustrated;

[0051] Figure 11 Another system architecture diagram shown in an example embodiment of the present application is illustrated;

[0052] Figure 12 A package combining process shown in an example embodiment of the present application is illustrated;

[0053] Figure 13 A sending period shown in an example embodiment of the present application is illustrated;

[0054] Figure 14 Package data shown in an example embodiment of the present application is illustrated;

[0055] Figure 15 Another system architecture diagram shown in an example embodiment of the present application is illustrated;

[0056] Figure 16 A package dividing process shown in an example embodiment of the present application is illustrated;

[0057] Figure 17 A flowchart of an audio transmission method shown in an embodiment of the present application is illustrated;

[0058] Figure 18 A flowchart of another audio transmission method according to an embodiment of the present application;

[0059] Figure 19 A flowchart of another audio transmission method according to an embodiment of the present application;

[0060] Figure 20 A flowchart of another audio transmission method according to an embodiment of the present application;

[0061] Figure 21 A schematic diagram of a hardware structure of an electronic device according to an example embodiment of the present application;

[0062] Figure 22 A schematic diagram of a structure of a chip according to an embodiment of the present application. DETAILED DESCRIPTION

[0063] The technical solutions in the present application will be described below with reference to the drawings.

[0064] In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" herein only describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which means that there are three cases of A alone, A and B together, and B alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0065] Hereinafter, the terms "first", "second" are only for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Therefore, the features defined with "first", "second" can explicitly or implicitly include one or more features. In the description of the embodiments, unless otherwise specified, the meaning of "multiple" is two or more than two.

[0066] In the present application, the reference "one embodiment" or "some embodiments" and the like means that in one or more embodiments of the present application, the specific features, structures or characteristics described in connection with the embodiment are included. Therefore, the statements "in one embodiment", "in some embodiments", "in other some embodiments", "in other some embodiments" and the like appearing in different places in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized. The terms "include", "contain", "have" and their variants mean "include but not limited to", unless otherwise specifically emphasized.

[0067] In order to better understand the audio processing method and the audio transmission method provided by the embodiments of the present application, the following first explains some terms involved in the embodiments of the present application, so as to facilitate the understanding of those skilled in the art.

[0068] 1. Vehicle information system

[0069] The vehicle information system is also called the car information system, and is referred to as a car machine in the embodiments of the present application.

[0070] The vehicle information system is a device that enables a driver to timely understand vehicle operation information and external information during driving.

[0071] 2. Input buffer

[0072] Also referred to as inBuffer in the embodiments of the present application, it can be regarded as a memory area for temporarily storing data.

[0073] In the embodiments of the present application, one encoder corresponds to one inBuffer, and each inBuffer is used to receive and store the encoded audio sent by the encoder corresponding thereto.

[0074] The above is a brief introduction to the terms involved in the embodiments of the present application, which will not be described again below.

[0075] In the interaction scenario between an electronic device (such as a mobile phone) and a car machine, for example, in the scenario of audio transmission and playback, the mobile phone and the car machine are in a connected state (or an interconnected state). When different types of audio data (such as media audio data, navigation audio data, call audio data, notification audio data, etc.) are to be sent from the mobile phone to the car machine, the mobile phone will perform audio mixing processing on these different types of audio data to obtain mixed audio data, and then send the mixed audio data to the car machine.

[0076] Since the audio mixing processing is an irreversible process, after the car machine receives the mixed audio data, it cannot perform splitting on the mixed audio data, that is, it cannot split the different types of audio data from the mixed audio data. For example, the car machine cannot split the individual media audio data, navigation audio data, call audio data, notification audio data, etc. from the mixed audio data.

[0077] Based on the above reasons, the car machine can only perform unified playback, adjustment, etc. on the mixed audio data, and cannot perform individual playback, adjustment, etc. on the different types of audio data, which leads to the fact that many optimization scenarios for improving user experience between the mobile phone and the car machine cannot be implemented, and the driving experience of the user is reduced. Among them, the optimization scenarios for improving user experience include but are not limited to the car machine controlling the playback volume of different types of audio data respectively, the car machine controlling the navigation audio data to be played on the driver's seat speaker alone, the car machine controlling the navigation audio data to be played on the driver's seat speaker and the copilot's seat speaker, etc.

[0078] Therefore, the application provides an audio processing method, which is applied to an application framework layer of an electronic device connected with a vehicle-mounted audio device. The application framework layer of the electronic device receives audio data generated by multiple applications, processes the audio data into sub-audio data, encodes each sub-audio data through a corresponding number of encoders created for the sub-audio data, obtains encoded audio, and sends the encoded audio to the vehicle-mounted audio device through a preset transmission channel.

[0079] Since the data contained in the sub-audio data is single track data (or each data contained in the sub-audio data is audio data of different types), the single track data is encoded and sent to the vehicle-mounted audio device. The vehicle-mounted audio device decodes the encoded audio through a decoder created for the encoded audio and obtains single audio (or each decoded audio is audio of different types). Therefore, the vehicle-mounted audio device can independently play, adjust, and the like each audio, for example, can adjust the volume of music, navigation sound, and call sound respectively, and can specify different loudspeakers to play different types of audio. Thus, the audio processing method provided by the application can realize many optimization scenarios between the electronic device and the vehicle for improving user experience, can meet the personalized needs of vehicle audio playback, and improves the driving and riding experience of the driver and passengers of the vehicle.

[0080] The application scenarios of the audio processing method provided by the application are described below in combination with the drawings.

[0081] It should be noted that, in some embodiments of the application, the electronic device can be a mobile phone, a smart screen, a tablet computer, a wearable device (such as a smart watch, smart glasses, a smart bracelet, a smart necklace, and the like), a television, an augmented reality (AR) / virtual reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a projector, and the like, or can be other devices or apparatuses capable of audio processing. The specific type of the electronic device is not limited in the embodiments of the application.

[0082] Please refer to Figure 1 , Figure 1An application scenario of the audio processing method shown in the embodiments of the present application is illustrated. As shown in Figure 1 The application scenario includes an electronic device 100 and a vehicle 200. It should be understood that the electronic device 100 is taken as a mobile phone for example in the embodiments of the present application.

[0083] The vehicle 200 can be any type of vehicle that carries people and / or objects and moves through a power system such as a transmitter and a battery, including but not limited to a car, a sedan, a truck, a bus, an electric vehicle, a motorcycle, a motor home, a train, a multiple-unit train, a high-speed multiple-unit passenger train, and the like.

[0084] In one possible implementation manner, the vehicle 200 can be a vehicle driven by a driver. Alternatively, in another possible implementation manner, the vehicle 200 can also be a vehicle with a certain automatic driving capability.

[0085] The vehicle 200 can include an in-vehicle audio device 210. The in-vehicle audio device 210 and the electronic device 100 can be connected through communication to realize information interaction between the in-vehicle audio device 210 and the electronic device 100.

[0086] The communication connection can include wired communication connection and short-distance wireless communication connection. The wired communication connection can include Universal Serial Bus (USB) connection, and the short-distance wireless communication connection can include but is not limited to Bluetooth connection, WIreless Fidelity (Wi-Fi) connection, Wi-Fi Peer-to-Peer (P2P) connection, Zigbee connection, Near Field Communication (NFC) connection, and the like.

[0087] In one possible implementation manner, the in-vehicle audio device 210 can be carried in a hardware device of the vehicle 200 in the form of software, and the hardware device can be used to access, store, and play content in an application program of the electronic device 100. In another possible implementation manner, the in-vehicle audio device 210 can also be implemented as another independent hardware device capable of being connected with the vehicle 200.

[0088] The above Figure 1 corresponding embodiments mainly show the application scenario of the audio processing method from the perspective of the outside of the vehicle 200. The application scenario of the audio processing method is shown from the perspective of the inside of the vehicle 200.

[0089] Please refer to Figure 2 , Figure 2 Another application scenario of the audio processing method shown in the embodiments of the present application is illustrated. As shown inFigure 2 As shown, when the in-vehicle audio device 210 is implemented as other independent hardware device capable of being connected with the vehicle 200, the in-vehicle audio device 210 can be arranged at the right side of the steering wheel of the vehicle 200. Herein, only for example, the in-vehicle audio device 210 can also be arranged in front of the driver, in front of the co-driver, etc., and no limitation is made thereto.

[0090] For example, before the driver or the passenger wants to transmit the content in the application program of the electronic device 100 to the in-vehicle audio device 210, or wants to access, access, play, etc. the content in the application program of the electronic device 100 by using the in-vehicle audio device 210, it is necessary to first establish the communication connection between the in-vehicle audio device 210 and the electronic device 100.

[0091] For example, a USB line can be used to establish a wired communication connection between the in-vehicle audio device 210 and the electronic device 100. It should be understood that whether it is the first time to establish a wired communication connection or not, it is to connect one end of the flat interface of the USB line to the in-vehicle audio device 210 and the other end of the micro interface of the USB line to the electronic device 100. Then, according to the display interface of the in-vehicle audio device 210, and / or the prompt information for establishing a wired communication connection popped up on the display interface of the electronic device 100, the operation is performed, so as to establish a wired communication connection between the in-vehicle audio device 210 and the electronic device 100.

[0092] For another example, Bluetooth can be used to establish a short-distance wireless communication connection between the in-vehicle audio device 210 and the electronic device 100. For example, when the Bluetooth is used to establish a short-distance wireless communication connection between the in-vehicle audio device 210 and the electronic device 100 for the first time, the driver or the passenger needs to manually perform a pairing operation for the in-vehicle audio device 210 and the electronic device 100. For example, the driver or the passenger can perform a Bluetooth opening operation on the in-vehicle audio device 210 and the electronic device 100, so that the in-vehicle audio device 210 opens the in-vehicle Bluetooth, the electronic device 100 opens the Bluetooth, and it is ensured that the in-vehicle Bluetooth of the in-vehicle audio device 210 and the Bluetooth of the electronic device 100 are in a discoverable state.

[0093] Afterwards, click search device in the Bluetooth interface displayed by the electronic device 100, so that the electronic device 100 can search the vehicle Bluetooth. Select the vehicle Bluetooth displayed by the electronic device 100, and click the vehicle Bluetooth, Bluetooth setting, and pairing in sequence. At this time, the display interface of the electronic device 100 will pop up a prompt box for inputting the pairing code. Enter the pairing code in the prompt box and click connect, and click pairing in the Bluetooth interface displayed by the vehicle audio device 210. If the pairing code is input correctly, the Bluetooth interface displayed by the vehicle audio device 210 will display that the connection is established, so that the short-distance wireless communication connection between the vehicle audio device 210 and the electronic device 100 is established.

[0094] It should be noted that when the Bluetooth is used for the first time to establish the short-distance wireless communication connection between the vehicle audio device 210 and the electronic device 100, if the vehicle Bluetooth of the vehicle audio device 210 and the Bluetooth of the electronic device 100 are both in the open state, and the distance between the vehicle audio device 210 and the electronic device 100 satisfies the preset connection threshold, the vehicle Bluetooth of the vehicle audio device 210 and the Bluetooth of the electronic device 100 automatically establish the short-distance wireless communication connection.

[0095] It can be understood that the "preset connection threshold" refers to the maximum transmission distance for Bluetooth communication between the vehicle audio device 210 and the electronic device 100, such as within 8 meters, within 10 meters, within 15 meters, and the like.

[0096] After the communication connection between the vehicle audio device 210 and the electronic device 100 is established, the content in the application program of the electronic device 100 can be transmitted to the vehicle audio device, and the transmitted content can also be displayed in the display interface of the vehicle audio device 210. Alternatively, the content in the application program of the electronic device 100 can be accessed, accessed, played, and the like by using the vehicle audio device 210, and the operation result can also be displayed in the display interface of the vehicle audio device 210.

[0097] The display interface of the vehicle audio device 210 will be described below with reference to the accompanying drawings. It can be understood that the display interface of the vehicle audio device 210 can also independently display the related information of the vehicle 200 without establishing the communication connection between the vehicle audio device 210 and the electronic device 100. The related information includes but is not limited to navigation information, driving information, audio information, video information, call information, power information, time information, volume information, and the like.

[0098] In the embodiments of the present application, the content displayed by the display interface of the vehicle audio device 210 in the case where the communication connection between the vehicle audio device 210 and the electronic device 100 is established will be described as an example. Please refer to Figure 3 , Figure 3A display interface schematic diagram is shown for the embodiments of the present application. For example, a media application (such as a music application) in the electronic device 100 sends music to the vehicle audio device 210, and the display interface of the vehicle audio device 210 displays relevant content of the music, such as Figure 3 As shown, the display interface of the vehicle audio device 210 displays the song name, the singer name, the classification of the song (such as My Favorites, Local Songs, and Car Radio, etc.), and can also display the previous song, pause, next song, and other controls. Meanwhile, the music is played through the loudspeaker of the vehicle 200, realizing the interactive scenario of playing the music in the music application of the electronic device 100 through the loudspeaker of the vehicle 200.

[0099] For another example, a navigation application (such as a navigation application) in the electronic device 100 sends navigation data to the vehicle audio device 210, and the display interface of the vehicle audio device 210 displays relevant content of the navigation data, such as Figure 3 As shown, the display interface of the vehicle audio device 210 displays route information, such as "50km left turn, enter XX Road", and can also display the driving time (Time), the distance to the destination (Distance), the arrival time (Arrival), the "end navigation" control, and the like. Meanwhile, the navigation audio is played through the loudspeaker of the vehicle 200, realizing the interactive scenario of playing the navigation sound in the navigation application of the electronic device 100 through the loudspeaker of the vehicle 200.

[0100] For another example, a call application (such as a telephone application) in the electronic device 100 sends call data to the vehicle audio device 210, and the display interface of the vehicle audio device 210 displays relevant controls for controlling the call data, such as Figure 3 As shown, the display interface of the vehicle audio device 210 displays the "answer", "hang up", "mute", and other controls, and the vehicle 200 takes different responses according to the click operation of the driver or passenger on different controls. For example, when the driver or passenger clicks the "answer" control, the call sound is played through the loudspeaker of the vehicle 200, and meanwhile, the driver or passenger can input his own voice through the microphone of the vehicle 200, realizing the interactive scenario of answering the phone in the electronic device 100 through the loudspeaker and the microphone of the vehicle 200.

[0101] As shown, Figure 3 The display interface of the vehicle audio device 210 can also display power information, time information, alarm information, main menu information, earphone information, and the like, which are only exemplary and the actual display is subject to the actual display, and the display is not limited.

[0102] In the related art, when an electronic device sends different types of audio data such as music, navigation data, and call data to a vehicle audio device, the electronic device performs mixing processing on the different types of audio data to obtain mixed audio data, and then sends the mixed audio data to the vehicle audio device. Since the mixing processing is an irreversible process, the vehicle audio device cannot split the mixed audio data after receiving the mixed audio data, that is, cannot separately split the music, navigation data, and call data from the mixed audio data.

[0103] Therefore, the vehicle audio device can only uniformly play, adjust, and the like the mixed audio data, and cannot separately adjust the different types of audio data. For example, the mixed audio data can only be uniformly increased or decreased in volume, which causes the volumes of the music, navigation sound, and call sound to be uniformly increased or decreased, and the volumes of the music, navigation sound, and call sound cannot be independently adjusted. For another example, the mixed audio data can only be played on a uniform loudspeaker, and different loudspeakers cannot be specified to play different audio data.

[0104] In the audio processing method provided by the embodiments of the present application, the electronic device processes audio data generated by a plurality of application programs into sub-audio data, the sub-audio data including at least one of media sub-audio data, navigation sub-audio data, call sub-audio data, and mixed sub-audio data, encodes each sub-audio data through a corresponding number of encoders created for the sub-audio data to obtain encoded audio, and sends the encoded audio to the vehicle audio device through a preset transmission channel.

[0105] Since the data contained in the sub-audio data is a single audio track data (or each data contained in the sub-audio data is different types of audio data), the single audio track data is separately encoded and sent to the vehicle audio device, and the vehicle audio device decodes the encoded audio through a decoder created for the encoded audio to obtain decoded audio, which is also a single audio (or each decoded audio is different types of audio). Therefore, the vehicle audio device can independently play, adjust, and the like each audio, for example, can separately adjust the volumes of the music, navigation sound, and call sound, and can specify different loudspeakers to play different types of audio. Thus, the audio processing method provided by the present application can realize many optimization scenarios between the electronic device and the vehicle for improving user experience, can meet the personalized needs of vehicle audio playback, and improves the driving and riding experience of the driver and passengers of the vehicle.

[0106] The audio processing method provided by the embodiments of the present application will be described below in combination with a software structure. Please refer to Figure 4 , Figure 4This is a software architecture block diagram of an electronic device illustrated in an exemplary embodiment of this application. The layered architecture divides the software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, taking an electronic device 100 running an Android system as an example, the Android system is divided into three layers: from top to bottom, the application layer, the application framework layer, and the virtual hardware abstraction layer.

[0107] The application layer may include a series of application packages. In this embodiment, the application layer may include media applications, navigation applications, calling applications, shopping applications, utility applications, and other applications.

[0108] Media applications can include, but are not limited to, various music applications, various video applications, various short video applications, various social applications, various game applications, and various news applications.

[0109] Navigation applications can include, but are not limited to, various map applications, various travel applications, various ride-hailing applications, and various location applications.

[0110] Calling applications can include, but are not limited to, phone applications and various VoIP applications.

[0111] Shopping applications can include a wide variety of shopping apps.

[0112] Utility applications can include, but are not limited to, various browser applications, various learning applications, various weather applications, various office applications, and various information applications.

[0113] Other applications refer to applications other than media applications, navigation applications, calling applications, shopping applications, and utility applications. For example, other applications can include notification applications, text messaging applications, and applications that provide safety alerts while driving.

[0114] It is worth noting that, in the embodiments of this application, audio data can be generated during use regardless of the application.

[0115] like Figure 4 As shown, the application package may include media applications, navigation applications, other applications, and calling applications. Media applications may include music applications, video applications, and short video applications; navigation applications may include map applications, travel applications, and location applications; other applications may include notification applications and SMS applications; and calling applications may include telephone applications.

[0116] It should be understood that different applications can generate different types of audio data, for example, a media application can generate media audio data, a navigation application can generate navigation audio data, a call application can generate call audio data, and other applications can generate notification audio data, warning audio data, ringtone audio data, etc. These different types of audio data will be transmitted to the audio framework in the application framework layer, and after being processed by the audio framework, the virtual hardware abstraction layer and the device virtualization service in turn, they will be finally sent to the vehicle audio device.

[0117] Optionally, the application layer can also include a car application. The car application is built in the application layer of the electronic device, and when it is detected that the electronic device and the vehicle audio device establish a communication connection, the car application sends an audio shunting instruction to the audio framework in the application framework layer, and sends a cross-device audio stream conversion capability starting instruction to the device virtualization service in the application framework layer.

[0118] The audio shunting instruction is used to instruct the audio framework to process the audio data generated by the multiple applications into sub-audio data. It can be understood that the audio shunting instruction is used to instruct the audio framework to not perform audio mixing processing on media audio data, navigation audio data and call audio data, and to perform audio mixing processing on other audio data (such as notification audio data, warning audio data, ringtone audio data, etc.).

[0119] The cross-device audio stream conversion capability starting instruction is used to instruct the device virtualization service to create corresponding encoders for different types of sub-audio data, and to perform encoding processing on the sub-audio data to obtain encoded audio.

[0120] Optionally, in one possible implementation, the car application does not have a corresponding application display interface and is invisible to the user.

[0121] The application framework layer can include an audio framework and a device virtualization service. First, the audio framework will be introduced.

[0122] The audio framework is used to receive the audio shunting instruction sent by the car application, and to receive different types of audio data sent by each application in the application layer. It should be understood that the audio shunting instruction is sent by the car application immediately when it is perceived that the electronic device and the vehicle audio device establish a communication connection. Therefore, for the audio framework, it first receives the audio shunting instruction sent by the car application, and then receives different types of audio data sent by each application in the application layer according to the user's use of each application.

[0123] Optionally, in one possible implementation, when the audio framework receives the audio shunting instruction sent by the car application, the received media audio data, navigation audio data, call audio data, and other audio data (such as notification audio data, warning audio data, ringtone audio data, etc.) are no longer subjected to the mixing processing.

[0124] Optionally, in another possible implementation, when the audio framework receives the audio shunting instruction sent by the car application, the received media audio data, navigation audio data, and call audio data are no longer subjected to the mixing processing, while the received other audio data (such as notification audio data, warning audio data, ringtone audio data, etc.) are subjected to the mixing processing.

[0125] The audio framework is further configured to identify the audio type of each audio data. The audio type can include a media audio type, a navigation audio type, a call audio type, and other audio types. The other audio types can include a notification audio type, a warning audio type, a ringtone audio type, etc.

[0126] Generally, the system of the electronic device identifies the audio data generated by each application in the application layer, and the audio framework identifies the audio type of each audio data according to the audio type identification in the audio data.

[0127] For example, the system identifies the audio data generated by the music application as "media-music" information, and the audio framework identifies the audio type identification in the audio data as "media-music" when receiving the audio data, and determines that the audio type of the audio data is the media audio type.

[0128] For another example, the system identifies the audio data generated by the navigation application as "navigation" information, and the audio framework identifies the audio type identification in the audio data as "navigation" when receiving the audio data, and determines that the audio type of the audio data is the navigation audio type.

[0129] Optionally, in one possible implementation, an application white list is set in the audio framework in advance, and the package name of the navigation application can be recorded in the application white list. When the audio framework receives the audio data, the package name of the application sending the audio data is determined, and if the package name is detected in the application white list, it is determined that the audio type of the audio data is the navigation audio type. In this implementation, the audio type of the audio data generated by the navigation application can be identified by the application white list in the audio framework without the identification of the system.

[0130] The audio framework is further configured to process the audio data generated by the plurality of applications into sub-audio data after identifying the audio types of the audio data. The sub-audio data includes at least one of media sub-audio data, navigation sub-audio data, call sub-audio data, and mixed sub-audio data.

[0131] The mixed sub-audio data is obtained by mixing other sub-audio data than the media sub-audio data, the navigation sub-audio data, and the call sub-audio data.

[0132] For example, the audio data generated by the plurality of applications can include media audio data, navigation audio data, call audio data, notification audio data, alarm audio data, and ring audio data. The number and types of the audio data generated are related to the applications used by the user, and are not limited.

[0133] The audio framework identifies that the audio type of the media audio data is a media audio type, the audio type of the navigation audio data is a navigation audio type, the audio type of the call audio data is a call audio type, and the audio types of the notification audio data, the alarm audio data, and the ring audio data are other audio types.

[0134] The audio framework does not mix the audio data of the media audio type, the navigation audio type, and the call audio type. In one possible implementation, the audio framework directly sends the media audio data, the navigation audio data, and the call audio data to the virtual hardware abstraction layer after identifying the audio types of the media audio data, the navigation audio data, and the call audio data.

[0135] In another possible implementation, the audio framework identifies the media audio data as media sub-audio data, the navigation audio data as navigation sub-audio data, and the call audio data as call sub-audio data after identifying the audio types of the media audio data, the navigation audio data, and the call audio data, and then sends the media sub-audio data, the navigation sub-audio data, and the call sub-audio data to the virtual hardware abstraction layer.

[0136] The audio framework mixes the audio data of the other audio types. For example, the audio framework mixes the notification audio data, the alarm audio data, and the ring audio data to obtain mixed sub-audio data, and then sends the mixed sub-audio data to the virtual hardware abstraction layer.

[0137] The virtual hardware abstraction layer creates a corresponding number of audio routes for the sub-audio data, or in other words, the virtual hardware abstraction layer creates a corresponding audio route for each type of sub-audio data, so that the created audio routes match the audio types of the sub-audio data.

[0138] The virtual hardware abstraction layer creates an audio route for forwarding the sub-audio data corresponding to the audio route to the encoder matching the sub-audio data. The encoder is created by the device virtualization service in the application framework layer, which will be described in detail below.

[0139] Compared with forwarding mixed audio data (data obtained after the mobile phone mixes different types of audio) through one audio route in the related art, in the implementation mode, the audio routes corresponding to different audio types are created for the sub-audio data of different audio types, so that the audio route of one type only needs to forward the sub-audio data of one type of audio, which not only helps the device virtualization service to quickly distinguish the audio types of the received sub-audio data, but also improves the forwarding efficiency.

[0140] Optionally, in a possible implementation mode, if the audio framework does not mix the received audio data, but determines the media audio data as media sub-audio data, the navigation audio data as navigation sub-audio data, the call audio data as call sub-audio data, the notification audio data as notification sub-audio data, the warning audio data as warning sub-audio data, and the ringtone audio data as ringtone sub-audio data, the virtual hardware abstraction layer creates the audio route corresponding to each type of sub-audio data.

[0141] For example, the virtual hardware abstraction layer creates a first audio route for the media sub-audio data, a second audio route for the navigation sub-audio data, a third audio route for the call sub-audio data, a fourth audio route for the notification sub-audio data, a fifth audio route for the warning sub-audio data, and a sixth audio route for the ringtone sub-audio data.

[0142] Optionally, in another possible implementation mode, if the audio framework mixes the audio data of other audio types, the virtual hardware abstraction layer creates a first audio route for the media sub-audio data, a second audio route for the navigation sub-audio data, and a third audio route for the mixed sub-audio data.

[0143] Optionally, when creating the audio route, the virtual hardware abstraction layer identifies the created audio route according to the audio type of the sub-audio data, which is helpful to distinguish the created audio routes, and is also helpful to the subsequent audio framework to quickly forward the sub-audio data matching each audio route to each audio route, and is also helpful to the device virtualization service to quickly distinguish the audio types of the received sub-audio data (which can be popularly understood as the sub-audio data forwarded from a certain audio route, and the audio type of the sub-audio data can be quickly determined according to the identification of the audio route).

[0144] It should be understood that the manner of identifying the created audio route is not limited. Illustratively, it can be identified by different audio route names, such as a media audio route, a navigation audio route, a mix audio route, a call audio route, etc. For another example, a first audio route, a second audio route, a third audio route, a fourth audio route, etc. For another example, route 1, route 2, route 3, etc.

[0145] Optionally, different audio types can also be set for different audio routes by the audio framework. For example, the audio type corresponding to the first audio route is set to a media audio type by the audio framework, the audio type corresponding to the second audio route is set to a navigation audio type, the audio type corresponding to the third audio route is set to a mix audio type, and the audio type corresponding to the call audio route is set to a call audio type.

[0146] Optionally, in one possible implementation, the virtual hardware abstraction layer creates the audio route, which can be pre-created for each sub-audio data of each audio type and stored in the virtual hardware abstraction layer for a long time, facilitating the forwarding of each sub-audio data to the encoder through the created audio route later.

[0147] Optionally, in another possible implementation, a period starts from the establishment of the connection between the electronic device and the vehicle-mounted audio device and ends when the connection between the electronic device and the vehicle-mounted audio device is disconnected. In each period, the virtual hardware abstraction layer creates an audio route corresponding to each sub-audio data of each audio type. For example, the virtual hardware abstraction layer creates an audio route corresponding to a certain audio type when it first receives the sub-audio data of the audio type sent by the audio framework. Thereafter, in the period, the sub-audio data corresponding to the audio route can be directly forwarded to the encoder through the audio route.

[0148] Optionally, when it is detected that the electronic device is disconnected from the vehicle-mounted audio device, the virtual hardware abstraction layer destroys the created audio route. This implementation destroys the created audio route at the end of a period, effectively avoiding the long-term occupation of system resources by the audio route, improving the resource utilization rate, and improving the performance of the electronic device.

[0149] It can be understood that if the virtual hardware abstraction layer never receives the sub-audio data of a certain audio type sent by the audio framework in a period, the audio route corresponding to the audio type can not be created in the period. This implementation creates the corresponding audio route when there is a demand, which can effectively reduce the consumption of resources and improve the resource utilization rate.

[0150] The device virtualization service can include a virtual audio service, a virtual call service, and a transmission channel.

[0151] The virtual audio service is configured to receive each non-call sub-audio data forwarded by the virtual hardware abstraction layer through each audio route, and send each non-call sub-audio data to a corresponding encoder. The non-call sub-audio data can include media sub-audio data, navigation sub-audio data, mixed audio sub-audio data, etc.

[0152] The virtual call service is configured to receive call sub-audio data, and send the call sub-audio data to a corresponding call encoder.

[0153] The application framework layer creates a corresponding number of encoders for sub-audio data, or in other words, the application framework layer creates a corresponding encoder for each type of sub-audio data, so that the created encoders match the audio types of each sub-audio data.

[0154] The encoder created by the application framework layer is configured to encode the sub-audio data transmitted to the encoder to obtain corresponding encoded audio. Then, the encoded audio is sent to the in-vehicle audio device through the transmission channel in the device virtualization service.

[0155] Optionally, in one possible implementation, if the audio framework does not perform mixed audio processing on the received audio data, and the virtual hardware abstraction layer creates a corresponding audio route for each type of sub-audio data, the device virtualization service creates a corresponding encoder for each type of sub-audio data forwarded to the device virtualization service through the audio route. For example, a first encoder is created for media sub-audio data forwarded to the device virtualization service through a first audio route, the first encoder is configured to encode the media sub-audio data to obtain encoded audio corresponding to the media sub-audio data; a second encoder is created for navigation sub-audio data forwarded to the device virtualization service through a second audio route, the second encoder is configured to encode the navigation sub-audio data to obtain encoded audio corresponding to the navigation sub-audio data; a third encoder is created for call sub-audio data forwarded to the device virtualization service through a third audio route, the third encoder is configured to encode the call sub-audio data to obtain encoded audio corresponding to the call sub-audio data; a fourth encoder is created for notification sub-audio data forwarded to the device virtualization service through a fourth audio route, the fourth encoder is configured to encode the notification sub-audio data to obtain encoded audio corresponding to the notification sub-audio data; a fifth encoder is created for warning sub-audio data forwarded to the device virtualization service through a fifth audio route, the fifth encoder is configured to encode the warning sub-audio data to obtain encoded audio corresponding to the warning sub-audio data; and a sixth encoder is created for ringtone sub-audio data forwarded to the device virtualization service through a sixth audio route, the sixth encoder is configured to encode the ringtone sub-audio data to obtain encoded audio corresponding to the ringtone sub-audio data.

[0156] Optionally, in another possible implementation, if the audio framework performs mixing processing on the audio data of other audio types, the virtual hardware abstraction layer creates a first audio route for the media sub-audio data, a second audio route for the navigation sub-audio data, a third audio route for the mixing sub-audio data, and a call audio route for the call sub-audio data. The device virtualization service creates a corresponding encoder for each type of sub-audio data forwarded to the device virtualization service through the audio routes.

[0157] For example, a third encoder is created for the mixing sub-audio data forwarded to the device virtualization service through the third audio route, and the third encoder is used to perform encoding processing on the mixing sub-audio data to obtain encoded audio corresponding to the mixing sub-audio data. A call encoder is created for the call sub-audio data forwarded to the device virtualization service through the call audio route, and the call encoder is used to perform encoding processing on the call sub-audio data to obtain encoded audio corresponding to the call sub-audio data.

[0158] In this implementation, a corresponding encoder is created for each type of sub-audio data, so that an encoder of one type only needs to perform encoding processing on sub-audio data of one type, which can improve encoding efficiency and effectively avoid encoding lag, so that the audio played on the in-vehicle audio device is smoother. The encoding lag is caused by an encoder of one type performing encoding processing on sub-audio data of multiple types, resulting in an increase in the waiting time for encoding each sub-audio data.

[0159] Optionally, when creating the encoders, the device virtualization service identifies the created encoders according to the audio types of the received sub-audio data or the identifiers of the audio routes, which is beneficial to distinguishing the created encoders and also beneficial to the subsequent transmission channel for quickly sending the encoded audio of each encoder to the corresponding decoder of the in-vehicle audio device according to the identifier.

[0160] It should be understood that the manner of identifying the created encoders is not limited. For example, different encoder names can be used for identification, such as a first encoder, a second encoder, a third encoder, a call encoder, etc. For another example, a route 1 encoder, a route 2 encoder, a route 3 encoder, etc.

[0161] Optionally, in one possible implementation, the device virtualization service can create encoders in advance for each type of sub-audio data and store the encoders in the device virtualization service for a long time, so as to facilitate subsequent encoding processing of each type of sub-audio data through the created encoders.

[0162] Optionally, in another possible implementation, a cycle starts from the electronic device establishing a connection with the in-vehicle audio device and ends when the electronic device disconnects from the in-vehicle audio device. In each cycle, the device virtualization service creates a corresponding encoder for each type of audio sub-audio data. For example, the device virtualization service creates an encoder corresponding to a certain type of audio sub-audio data when it first receives the audio sub-audio data forwarded by a certain audio route. Thereafter, in the cycle, the audio sub-audio data of this type can be directly encoded by the encoder.

[0163] Optionally, when it is detected that the electronic device disconnects from the in-vehicle audio device, the device virtualization service destroys the created encoder. This implementation destroys the created encoder at the end of a cycle, effectively avoiding long-term occupation of system resources by the encoder, improving resource utilization, and improving the performance of the electronic device.

[0164] It can be understood that if the device virtualization service never receives a certain type of audio sub-audio data sent by a certain audio route in a cycle, the encoder corresponding to the audio type can not be created in the cycle. This implementation creates a corresponding encoder when needed, which can effectively reduce resource consumption and improve resource utilization.

[0165] In the foregoing implementation, the virtual hardware abstraction layer creates a call audio route for call sub-audio data, and the call sub-audio data can be forwarded to the encoder of the device virtualization service through the call audio route. Optionally, in one possible implementation, the electronic device can include an adaptive data signal processing (ADSP) framework, and the call audio data generated by the call application can be directly transmitted to the virtual hardware abstraction layer through the ADSP framework. The virtual hardware abstraction layer can also include a pre-established call channel through which the call audio data is transmitted to the virtual call service of the device virtualization service. The virtual call service sends the call audio data to the corresponding call encoder. In this implementation, a separate call channel and call encoder are established for the call audio data, which can ensure that the transmission and encoding processes of the call audio data are not disturbed, effectively improving the call quality.

[0166] The device virtualization service includes a preset transmission channel for sending encoded audio obtained by encoding by each encoder to the in-vehicle audio device. For example, the transmission channel can include multiple sending units, each of which is used to send a type of encoded audio.

[0167] For example, the transmission channel can include a first sending unit, a second sending unit, a third sending unit, and a fourth sending unit. The first sending unit is configured to send the encoded audio corresponding to the media sub-audio data to the vehicle-mounted audio device; the second sending unit is configured to send the encoded audio corresponding to the navigation sub-audio data to the vehicle-mounted audio device; the third sending unit is configured to send the encoded audio corresponding to the mixed sub-audio data to the vehicle-mounted audio device; and the fourth sending unit is configured to send the encoded audio corresponding to the call sub-audio data to the vehicle-mounted audio device.

[0168] In this implementation, each encoded audio is transmitted through one transmission channel, which reduces resource consumption and effectively saves resources of the electronic device.

[0169] Optionally, in a possible implementation, the transmission channel can include a first transmission channel and a second transmission channel, the first transmission channel is configured to transmit the encoded audio corresponding to the non-call audio sub-data, and the second transmission channel is configured to transmit the encoded audio corresponding to the call sub-audio data.

[0170] The first transmission channel can include a plurality of sending units, and each sending unit is configured to send one type of encoded audio. The non-call audio sub-data can include media sub-audio data, navigation sub-audio data, and mixed sub-audio data.

[0171] In this implementation, a separate transmission channel is established for the call sub-audio data, which can ensure that the encoded audio corresponding to the call sub-audio data is not disturbed during transmission, and effectively improves the call quality.

[0172] The audio processing method provided by the embodiments of the present application is applied to an application program framework layer of an electronic device, the electronic device is connected with a vehicle-mounted audio device, the application program framework layer of the electronic device receives audio data generated by a plurality of application programs, processes the audio data into sub-audio data, the sub-audio data includes at least one of media sub-audio data, navigation sub-audio data, call sub-audio data, and mixed sub-audio data, encodes each sub-audio data through a corresponding number of encoders created for the sub-audio data to obtain encoded audio, and sends the encoded audio to the vehicle-mounted audio device through a preset transmission channel.

[0173] Since the sub-audio data contains individual audio tracks (or each piece of data within the sub-audio data is of a different type), these individual audio tracks are encoded and sent to the in-vehicle audio device. The in-vehicle audio device then decodes the encoded audio using a decoder created for the encoded audio, resulting in individual audio files (or each decoded audio file is of a different type). Therefore, the in-vehicle audio device can independently play and adjust each audio file. For example, it can adjust the volume of music, navigation sounds, and call sounds separately, and can assign different speakers to play different types of audio. Thus, the audio processing method provided in this application enables many optimization scenarios between electronic devices and vehicles to enhance user experience, meets the personalized needs of vehicle audio playback, and improves the driving and riding experience for drivers and passengers.

[0174] The audio processing method provided in the embodiments of this application has been described above in conjunction with the software structure. The audio processing method provided in the embodiments of this application will now be described below in conjunction with the system architecture. Please refer to... Figure 5 , Figure 5 This is a system architecture block diagram illustrating an exemplary embodiment of this application. Figure 5 As shown, the system architecture block diagram is in Figure 4 Based on the corresponding electronic device software architecture diagram, the software architecture of in-vehicle audio equipment has been added. About Figure 4 The software structure of the corresponding electronic devices will not be elaborated here. The software structure of the in-vehicle audio device will be described in detail below.

[0175] In this embodiment, the in-vehicle audio device system is divided into two layers: an application layer and an application framework layer. The application layer and the application framework layer communicate with each other through a software interface.

[0176] The application layer of the in-vehicle audio device may include a vehicle-mounted application that can be used to sense when electronic devices and in-vehicle audio devices establish a communication connection, as well as to sense when electronic devices and in-vehicle audio devices disconnect.

[0177] The application framework layer of an in-vehicle audio device can include device virtualization services and an audio framework.

[0178] Device virtualization services may include transmission channels, decoders, and audio playback modules.

[0179] The device virtualization service comprises a transmission channel for transmitting each encoded audio transmitted by the electronic device to a corresponding decoder. For example, the transmission channel can comprise a plurality of receiving units, each receiving unit being configured to receive one type of encoded audio transmitted by the electronic device and transmit the one type of encoded audio to a corresponding decoder.

[0180] For example, the transmission channel can comprise a first receiving unit, a second receiving unit, a third receiving unit and a fourth receiving unit. The first receiving unit is configured to transmit encoded audio corresponding to media sub-audio data, the second receiving unit is configured to transmit encoded audio corresponding to navigation sub-audio data, the third receiving unit is configured to transmit encoded audio corresponding to mix sub-audio data, and the fourth receiving unit is configured to transmit encoded audio corresponding to talk sub-audio data.

[0181] In this implementation, each encoded audio is transmitted through one transmission channel, which reduces resource consumption and effectively saves resources of the electronic device.

[0182] Optionally, in a possible implementation, the transmission channel can comprise a third transmission channel and a fourth transmission channel. The third transmission channel is configured to transmit encoded audio corresponding to non-talk sub-audio data transmitted by the electronic device, and the fourth transmission channel is configured to transmit encoded audio corresponding to talk sub-audio data transmitted by the electronic device.

[0183] The third transmission channel can comprise a plurality of receiving units, each receiving unit being configured to receive one type of encoded audio and transmit the one type of encoded audio to a corresponding decoder. The non-talk sub-audio data can comprise media sub-audio data, navigation sub-audio data and mix sub-audio data.

[0184] In this implementation, a separate transmission channel is established for encoded audio corresponding to talk sub-audio data, which can ensure that encoded audio corresponding to talk sub-audio data is not disturbed during transmission, effectively improving the quality of the talk.

[0185] The application framework layer creates a corresponding number of decoders for the encoded audio, or in other words, the application framework layer creates a corresponding decoder for each type of encoded audio, so that the created decoders match the audio types of the encoded audio. It should be understood that the audio type of the encoded audio is the audio type corresponding to the sub-audio data encoded into the encoded audio.

[0186] The decoder created by the application framework layer is configured to decode the encoded audio transmitted to the decoder to obtain decoded audio. Then, the decoded audio is transmitted to the audio framework of the vehicle-mounted audio device.

[0187] Optionally, in one possible implementation, if none of the audio frameworks of the electronic device performs mixing on the received audio data, so that the electronic device side finally creates multiple encoders, such as the first encoder, the second encoder, the third encoder, the fourth encoder, the fifth encoder and the sixth encoder as described above.

[0188] Correspondingly, the application framework layer of the in-vehicle audio device creates a first decoder for the encoded audio corresponding to the media sub-audio data, the first decoder being configured to perform decoding processing on the encoded audio corresponding to the media sub-audio data to obtain decoded audio corresponding to the media sub-audio data; a second decoder for the encoded audio corresponding to the navigation sub-audio data, the second decoder being configured to perform decoding processing on the encoded audio corresponding to the navigation sub-audio data to obtain decoded audio corresponding to the navigation sub-audio data; a third decoder for the encoded audio corresponding to the call sub-audio data, the third decoder being configured to perform decoding processing on the encoded audio corresponding to the call sub-audio data to obtain decoded audio corresponding to the call sub-audio data; a fourth decoder for the encoded audio corresponding to the notification sub-audio data, the fourth decoder being configured to perform decoding processing on the encoded audio corresponding to the notification sub-audio data to obtain decoded audio corresponding to the notification sub-audio data; a fifth decoder for the encoded audio corresponding to the warning sub-audio data, the fifth decoder being configured to perform decoding processing on the encoded audio corresponding to the warning sub-audio data to obtain decoded audio corresponding to the warning sub-audio data; and a sixth decoder for the encoded audio corresponding to the ringtone sub-audio data, the sixth decoder being configured to perform decoding processing on the encoded audio corresponding to the ringtone sub-audio data to obtain decoded audio corresponding to the ringtone sub-audio data.

[0189] Optionally, in another possible implementation, if the audio framework of the electronic device performs mixing on the audio data of other audio types, so that the electronic device side finally creates the first encoder, the second encoder, the third encoder and the call encoder. Correspondingly, the application framework layer of the in-vehicle audio device creates a corresponding decoder for the encoded audio transmitted by each encoder.

[0190] For example, the electronic device side creates the third encoder for the mixing sub-audio data, and the application framework layer of the in-vehicle audio device creates a third decoder for the encoded audio corresponding to the mixing sub-audio data, the third decoder being configured to perform decoding processing on the encoded audio corresponding to the mixing sub-audio data to obtain decoded audio corresponding to the mixing sub-audio data; and the electronic device side creates the call encoder for the call sub-audio data, and the application framework layer of the in-vehicle audio device creates a call decoder for the encoded audio corresponding to the call sub-audio data, the call decoder being configured to perform decoding processing on the encoded audio corresponding to the call sub-audio data to obtain decoded audio corresponding to the call sub-audio data.

[0191] In this implementation, a corresponding decoder is created for the encoded audio of different audio types, so that a type of decoder only needs to decode the encoded audio of one type of audio, effectively avoiding the occurrence of audio lag phenomenon, thereby improving the fluency of the finally played audio, and further improving the user experience. The audio lag phenomenon is caused by a type of decoder decoding multiple types of encoded audio, resulting in an increase in the decoding waiting time of each encoded audio.

[0192] Optionally, the device virtualization service identifies the created decoder according to the audio type of the received encoded audio when creating the decoder, which is conducive to distinguishing between the created decoders and also conducive to subsequent audio playing module for separately adjusting and playing the decoded audio transmitted by each decoder.

[0193] It should be understood that the manner of identifying the created decoder is not limited. For example, different decoder names can be used for identification, such as a first decoder, a second decoder, a third decoder, a call decoder, etc. For another example, a route 1 decoder, a route 2 decoder, a route 3 decoder, etc.

[0194] Optionally, in one possible implementation, the device virtualization service creates a decoder, which can be a corresponding decoder created in advance for each type of encoded audio and stored in the device virtualization service for a long time, so as to facilitate subsequent quick decoding of each type of encoded audio by using the created decoder.

[0195] Optionally, in another possible implementation, a period starts from the establishment of a connection between the electronic device and the vehicle-mounted audio device and ends when the connection between the electronic device and the vehicle-mounted audio device is disconnected. In each period, the device virtualization service creates a corresponding decoder for each type of encoded audio. For example, the device virtualization service creates a decoder corresponding to a certain type of audio when it first receives the encoded audio of this type sent by the electronic device. Thereafter, in this period, the encoded audio of this type can be directly decoded by using the decoder.

[0196] Optionally, when it is detected that the electronic device is disconnected from the vehicle-mounted audio device, the device virtualization service destroys the created decoder. In this implementation, the created decoder is destroyed at the end of a period, effectively avoiding the long-term occupation of system resources by the decoder, improving the resource utilization rate, and improving the performance of the vehicle-mounted audio device.

[0197] It can be understood that if the device virtualization service does not receive the encoded audio of a certain audio type sent by the electronic device in a period, the decoder corresponding to the audio type can not be created in the period. This implementation creates the corresponding decoder when needed, which can effectively reduce the consumption of resources and improve the utilization of resources.

[0198] The audio playing module is an interface encapsulated by the in-vehicle audio device, which is used to temporarily store the decoded audios and send the decoded audios to the audio framework. For example, the decoder sends the decoded audio obtained after the decoding process to the audio playing module, the audio playing module temporarily stores the decoded audio, and every interval of a preset time length, the audio playing module sends the temporarily stored decoded audio to the audio framework.

[0199] It can be understood that the "preset time length" can be set and adjusted according to actual conditions, for example, the preset time length can be 10 milliseconds, 20 milliseconds, 30 milliseconds, etc.

[0200] The audio framework obtains a playing strategy, and after receiving the decoded audio sent by the audio playing module, plays and / or adjusts the decoded audio according to the playing strategy. The playing strategy can include independently adjusting the playing volume of the decoded audio, and / or playing the decoded audio corresponding to the specified speaker through the specified speaker.

[0201] For example, the playing strategy specifically includes increasing the playing volume of the media audio (such as music audio), and the audio framework increases the playing volume of the decoded audio corresponding to the media sub-audio data, so that the volume of the media audio played by the final speaker is increased.

[0202] For another example, the playing strategy specifically includes playing the navigation audio through the driver seat speaker, and the audio framework specifies the driver seat speaker to play the decoded audio corresponding to the navigation sub-audio data, and finally the decoded audio corresponding to the navigation sub-audio data is played by the driver seat speaker.

[0203] Optionally, in a possible implementation, the car machine application of the in-vehicle audio device generates a playing strategy according to the needs of the driver or the passenger, and sends the playing strategy to the audio framework.

[0204] The audio processing method provided in the embodiments of the present application can realize many optimization scenarios for improving user experience between the electronic device and the vehicle, can meet the personalized needs of vehicle audio playback, and improves the driving and riding experience of the driver and passengers of the vehicle.

[0205] The audio processing method provided in the embodiments of the present application is described in combination with the flowchart.

[0206] Please refer to Figure 6 , Figure 6 The flowchart of an audio processing method provided in the embodiments of the present application is shown. The method comprises the following steps.

[0207] S101, an audio shunting instruction and a cross-device audio stream conversion capability starting instruction are sent.

[0208] The application program layer of the electronic device can include a car application. The car application can perceive that a communication connection is established between the electronic device and the vehicle audio device, or the connection is disconnected. When it is perceived that the communication connection is established between the electronic device and the vehicle audio device, the car application sends an audio shunting instruction to the audio framework of the application program framework layer, and sends a cross-device audio stream conversion capability starting instruction to the device virtualization service of the application program framework layer.

[0209] The audio shunting instruction is used to instruct the audio framework to process the audio data generated by the plurality of application programs into sub-audio data. It can be understood in a simple way that the audio shunting instruction is used to instruct the audio framework to not perform mixing processing on the media audio data, the navigation audio data and the call audio data, and to perform mixing processing on other audio data (such as notification audio data, warning audio data, ringtone audio data, etc.).

[0210] The cross-device audio stream conversion capability starting instruction is used to instruct the device virtualization service to create a corresponding encoder for the sub-audio data of different audio types, and to perform encoding processing on the sub-audio data, so as to obtain the encoded audio.

[0211] The sub-audio data includes at least one of media sub-audio data, navigation sub-audio data, call sub-audio data, and mixed sub-audio data. The mixed sub-audio data is obtained by mixing other sub-audio data besides media sub-audio data, navigation sub-audio data, and call sub-audio data.

[0212] S102. Enable audio splitting and cross-device audio streaming functions.

[0213] After receiving an audio splitting command, the audio framework in the electronic device activates the audio splitting function.

[0214] The audio splitting function refers to the audio framework's ability to process audio data generated by multiple applications into sub-audio data. In simpler terms, the audio splitting function means that the audio framework does not mix media audio data, navigation audio data, and call audio data, but mixes other audio data (such as notification audio data, alert audio data, ringtone audio data, etc.).

[0215] This can be understood as follows: after enabling the audio splitting function, the audio framework does not perform audio mixing processing on the media audio data, navigation audio data, and call audio data it receives. However, it does perform audio mixing processing on the notification audio data, warning audio data, and ringtone audio data it receives.

[0216] Alternatively, in one possible implementation, the audio splitting function can also refer to the function of the audio framework not mixing any audio data, which is beneficial for subsequent in-vehicle audio equipment to independently adjust and play decoded audio of any audio type.

[0217] After receiving the command to start the cross-device audio streaming capability, the device virtualization service in the electronic device enables the cross-device audio streaming function.

[0218] The cross-device audio streaming function refers to the function of the device virtualization service in creating encoders and using the encoders for encoding processing. Specifically, the cross-device audio streaming function refers to the function of the device virtualization service in creating corresponding encoders for sub-audio data of different audio types, and using the encoders to encode the sub-audio data that matches the encoder.

[0219] S103, User triggers input operation.

[0220] Exemplarily, a plurality of application programs are pre-installed in the electronic device. In the embodiments of the present application, the plurality of application programs can be one or more of media application programs, navigation application programs, call application programs, shopping application programs, tool application programs, other application programs, and the like.

[0221] In the embodiments of the present application, the plurality of application programs are taken as examples of media application programs (such as music application programs), navigation application programs (such as map application programs), call application programs (such as telephone application programs), and other application programs (such as short message application programs).

[0222] It is worth noting that in the embodiments of the present application, no matter which application program, audio data can be generated in the use process.

[0223] The input operation can be a click operation. For example, the user clicks the icon corresponding to the application program in the electronic device.

[0224] Alternatively, in the embodiments of the present application, the input operation can also be an operation of starting the application program by voice indication, the input operation can also be an operation of starting the application program by gesture indication, the input operation can also be an operation of starting the application program by eye indication, and the like, which are not limited in the present application.

[0225] Exemplarily, after the electronic device detects the input operation of the user on the icon corresponding to the application program, the electronic device starts and runs the application program in response to the input operation triggered by the user. For example, the user can click the icon of the music application program to instruct the electronic device to start and run the music application program. Then, the music application program starts playing music.

[0226] S104, receiving audio data generated by the plurality of application programs.

[0227] Exemplarily, different application programs generate different types of audio data when running. The audio data can include media audio data, navigation audio data, call audio data, notification audio data, warning audio data, ringtone audio data, prompt audio data, and the like.

[0228] For example, the media application program can generate media audio data, the navigation application program can generate navigation audio data, the call application program can generate call audio data, and the other application program can generate notification audio data, warning audio data, ringtone audio data, prompt audio data, and the like.

[0229] For example, the media application program can generate media audio data, the navigation application program can generate navigation audio data, the call application program can generate call audio data, and the other application program can generate notification audio data, warning audio data, ringtone audio data, prompt audio data, and the like.

[0230] The navigation audio data can include, but is not limited to, audio data generated by various map applications, various travel applications, various taxi-hailing applications, and various positioning applications.

[0231] The call audio data can include, but is not limited to, audio data generated by telephone applications and various network telephone applications.

[0232] After the multiple applications in the application layer generate the audio data, the audio data is sent to an audio framework in the application framework layer, and the audio framework receives the audio data generated by the multiple applications. It should be understood that the number and types of the actually generated audio data are related to the applications used by the user, and are not limited.

[0233] S105, processing the audio data into sub-audio data.

[0234] In the related art, after the audio framework receives the audio data generated by the multiple applications, regardless of the audio types of the received audio data, the audio framework performs mixing processing on all the received audio data, and finally sends the mixed data to the vehicle-mounted audio device. Since the mixing processing is an irreversible process, the vehicle-mounted audio device cannot split the mixed data after receiving the mixed data, that is, cannot split the audio data of various types from the mixed data. Only unified playing, adjusting, and the like can be performed on the mixed data, and individual playing, adjusting, and the like cannot be performed on the audio data of various types, which leads to the fact that many optimization scenarios for improving the user experience between the electronic device and the vehicle cannot be implemented, and the driving and riding experience of the user is reduced.

[0235] In the audio processing method provided by the embodiments of the present application, when the audio framework receives the audio data generated by the multiple applications, the audio types of the audio data are identified.

[0236] The audio types can include a media audio type, a navigation audio type, a call audio type, and other audio types. The other audio types can include a notification audio type, a warning audio type, a ringtone audio type, a prompt audio type, and the like.

[0237] In a possible implementation manner, the audio framework does not perform mixing processing on the audio data of the media audio type, the navigation audio type, the call audio type, and the other audio types.

[0238] In another possible implementation manner, the audio framework does not perform mixing processing on the audio data of the media audio type, the navigation audio type, and the call audio type, and performs mixing processing on the audio data of the other audio types (such as the notification audio type, the warning audio type, the ringtone audio type, the prompt audio type, and the like).

[0239] Exemplarily, in identifying the audio types of the audio data, generally, the system of the electronic device identifies the audio data generated by each application in the application layer, and the audio framework identifies the audio types of the audio data according to the audio type identifiers carried by the audio data.

[0240] It should be understood that the audio type of each audio data is consistent with the audio type of the sub-audio data. Therefore, at least two of the media sub-audio data, the navigation sub-audio data, the call sub-audio data and the other sub-audio data can also be identified from the audio data according to different audio type identifiers carried by the audio data.

[0241] For example, after determining the audio types of the media audio data, the navigation audio data and the call audio data, the audio framework determines the media audio data as the media sub-audio data, determines the navigation audio data as the navigation sub-audio data, and determines the call audio data as the call sub-audio data.

[0242] Exemplarily, if the other sub-audio data is identified, the other sub-audio data is mixed to obtain mixed sub-audio data.

[0243] For example, after determining the audio types of the notification audio data, the warning audio data, the ringtone audio data and the prompt audio data, the audio framework determines the notification audio data as the notification sub-audio data, determines the warning audio data as the warning sub-audio data, determines the ringtone audio data as the ringtone sub-audio data, and determines the prompt audio data as the prompt sub-audio data. The notification sub-audio data, the warning sub-audio data, the ringtone sub-audio data and the prompt sub-audio data are mixed to obtain mixed sub-audio data.

[0244] S106, forwarding the sub-audio data through the audio route.

[0245] The audio processing method provided by the embodiment of the present application further includes creating an audio route through a virtual hardware abstraction layer.

[0246] Exemplarily, the virtual hardware abstraction layer creates a corresponding number of audio routes for the sub-audio data, or in other words, the virtual hardware abstraction layer creates a corresponding audio route for each type of sub-audio data, so that the created audio route matches the audio type of each sub-audio data.

[0247] Optionally, in a possible implementation manner, the audio framework does not mix the received audio data, and the virtual hardware abstraction layer creates one audio route corresponding to each type of sub-audio data.

[0248] Optionally, in another possible implementation, the audio framework performs mixing processing on the audio data of the other audio type, the virtual hardware abstraction layer creates a first audio route for the media sub-audio data, a second audio route for the navigation sub-audio data, a third audio route for the mixing sub-audio data, and a call audio route for the call sub-audio data.

[0249] It can be understood that, in some implementations of the present application, the call audio data is consistent with the information represented by the call sub-audio data, only the names are different.

[0250] S107, forwarding the sub-audio data through the virtual audio service.

[0251] The device virtualization service can include a virtual audio service and a virtual call service. Illustratively, the audio route of the virtual hardware abstraction layer first transmits the non-call sub-audio data to the virtual audio service of the device virtualization service, and transmits the call sub-audio data to the virtual call service of the device virtualization service.

[0252] The non-call sub-audio data can include media sub-audio data, navigation sub-audio data, and mixing sub-audio data.

[0253] The virtual audio service transmits the non-call sub-audio data to the corresponding encoder, and the virtual call service transmits the call sub-audio data to the corresponding call encoder.

[0254] The audio processing method provided by the embodiment of the present application further includes creating an encoder through a device virtualization service in an application framework layer.

[0255] Illustratively, the device virtualization service in the application framework layer creates a corresponding number of encoders for the sub-audio data, or in other words, the device virtualization service in the application framework layer creates a corresponding encoder for the sub-audio data of each audio type, so that the created encoders match the audio types of the sub-audio data.

[0256] S108, encoding processing is performed on the sub-audio data, and the encoded audio is sent.

[0257] In the embodiment of the present application, the encoding processing refers to compressing the sub-audio data, which can reduce the data amount of the sub-audio data and is conducive to reducing the bandwidth when transmitting the encoded audio subsequently.

[0258] Optionally, the encoding processing can also be converting the sub-audio data into network signals.

[0259] Illustratively, the encoder created for the sub-audio data is used to perform encoding processing on the sub-audio data matching the encoder, to obtain the encoded audio. Then, the encoded audio is sent to a transmission channel.

[0260] S109, sending the encoded audio through a transmission channel.

[0261] The device virtualization service includes a preset transmission channel for sending the encoded audio obtained after the encoding processing of each encoder to the in-vehicle audio device. Exemplarily, the transmission channel can include a plurality of sending units, each of which is configured to send one type of encoded audio.

[0262] In this implementation, the encoded audio is transmitted through one transmission channel, which reduces resource consumption and effectively saves the resources of the electronic device under the premise of ensuring performance.

[0263] Optionally, in a possible implementation, different transmission channels are established for encoded audio of different audio types, and each transmission channel is configured to transmit encoded audio of one audio type. In this implementation, encoded audio of multiple different audio types can be transmitted at the same time, which improves the transmission rate, and each transmission channel is configured to transmit encoded audio of one audio type, which effectively avoids interference between the encoded audio during transmission.

[0264] Optionally, in a possible implementation, the transmission channel can include a first transmission channel and a second transmission channel, the first transmission channel is configured to transmit encoded audio corresponding to non-conversation sub-audio data, and the second transmission channel is configured to transmit encoded audio corresponding to conversation sub-audio data.

[0265] The first transmission channel can include a plurality of sending units, each of which is configured to send one type of encoded audio. The non-conversation sub-audio data can include media sub-audio data, navigation sub-audio data, and mixed sub-audio data.

[0266] In this implementation, a separate transmission channel is established for the conversation sub-audio data, which can ensure that the encoded audio corresponding to the conversation sub-audio data is not disturbed during transmission, effectively improving the conversation quality.

[0267] Optionally, when the encoded audio is sent through the transmission channel, a data header can be added to each encoded audio, which is configured to identify the audio type of the encoded audio (i.e., the audio type of the sub-audio data corresponding to the encoded audio). This is conducive to the transmission channel of the in-vehicle audio device receiving the encoded audio, which can quickly determine the audio type of the encoded audio by identifying the data header of the encoded audio, so as to quickly send the encoded audio to the corresponding decoder.

[0268] The audio processing method provided by the embodiment of the application is applied to an application program framework layer of an electronic device connected with a vehicle-mounted audio device. The application program framework layer of the electronic device receives audio data generated by a plurality of application programs, processes the audio data into sub-audio data, the sub-audio data including at least one of media sub-audio data, navigation sub-audio data, call sub-audio data and mixed sound sub-audio data, encodes each sub-audio data through a corresponding number of encoders created for the sub-audio data to obtain encoded audio, and sends the encoded audio to the vehicle-mounted audio device through a preset transmission channel.

[0269] Since the data contained in the sub-audio data is single track data (or each data contained in the sub-audio data is audio data of different types), the single track data is encoded and sent to the vehicle-mounted audio device, and the vehicle-mounted audio device decodes the encoded audio through a decoder created for the encoded audio to obtain single audio (or each decoded audio is audio of different types). Therefore, the vehicle-mounted audio device can independently play, adjust and the like each audio, for example, can adjust the volume of music, navigation sound and call sound respectively, and can specify different loudspeakers to play different types of audio. Thus, the audio processing method provided by the application can realize many optimization scenarios for improving user experience between the electronic device and the vehicle, can meet the personalized needs of vehicle audio playing, and improves the driving and riding experience of the driver and passengers of the vehicle.

[0270] Please refer to Figure 7 , Figure 7 Another flowchart of an audio processing method provided by the embodiment of the application is shown. The method includes the following steps.

[0271] S201, sending an audio shunting instruction and a cross-device audio stream transfer capability starting instruction.

[0272] S202, starting an audio shunting function and a cross-device audio stream transfer function.

[0273] S203, triggering an input operation by a user.

[0274] S204, receiving audio data generated by a plurality of application programs.

[0275] S205, processing the audio data into sub-audio data.

[0276] S206, forwarding the sub-audio data through an audio routing.

[0277] S207, forwarding the sub-audio data through a virtual audio service.

[0278] S208, encode the sub-audio data and send the encoded audio.

[0279] S209, send the encoded audio through the transmission channel.

[0280] The specific content of steps S201 to S209 can refer to the method described in the foregoing steps S101 to S109, which will not be described here again.

[0281] S210, receive and send the encoded audio.

[0282] The application framework layer of the in-vehicle audio device can include a device virtualization service and an audio framework. The device virtualization service can include a transmission channel, a decoder, and an audio playback module.

[0283] For example, the transmission channel of the electronic device sends each encoded audio to the transmission channel of the in-vehicle audio device, and the transmission channel of the in-vehicle audio device transmits each encoded audio to the corresponding decoder after receiving each encoded audio.

[0284] S211, decode the encoded audio to obtain decoded audio.

[0285] In the embodiment of the application, the decoding process refers to decompressing the encoded audio, which can restore the data volume of the sub-audio data and facilitate smooth playback of the decoded audio.

[0286] Alternatively, the decoding process can also be converting the network signal into an audio signal.

[0287] For example, the device virtualization service of the in-vehicle audio device creates a corresponding number of decoders for the encoded audio, decodes the encoded audio transmitted to the decoder through the created decoder to obtain decoded audio, and then sends the decoded audio to the audio playback module of the in-vehicle audio device.

[0288] S212, send the decoded audio.

[0289] For example, the audio playback module temporarily stores each decoded audio sent by the decoder, and sends each temporarily stored decoded audio to the audio framework at a preset interval.

[0290] S213, play the decoded audio according to the playback strategy.

[0291] For example, the audio framework obtains the playback strategy, and plays and / or adjusts the decoded audio according to the playback strategy after receiving each decoded audio sent by the audio playback module. The playback strategy can include independently adjusting the playback volume of the decoded audio, and / or playing the decoded audio corresponding to the specified speaker through the specified speaker.

[0292] For example, the playing strategy specifically includes increasing the playing volume of the navigation audio at the intersection and decreasing the playing volume of the music audio. For another example, the playing strategy specifically includes playing the navigation audio through the driver seat speaker and the co-driver seat speaker. For yet another example, the playing strategy specifically includes playing the music audio through all the speakers in the vehicle, and the like.

[0293] Optionally, in a possible implementation manner, the playing strategy can be determined according to the distribution state of the personnel in the vehicle. For example, when it is detected that there is only the driver in the vehicle, the playing strategy can include playing the navigation audio through the driver seat speaker and playing the media music. For another example, when it is detected that there are the driver and the co-driver passenger in the vehicle, the playing strategy can include playing the navigation audio and the media music through the driver seat speaker and the co-driver seat speaker together. For yet another example, when it is detected that there are people in the driver seat, the co-driver seat and the back seat in the vehicle, the playing strategy can include playing the navigation audio through the driver seat speaker and playing the music audio through all the speakers in the vehicle, and the like. Here, only exemplary descriptions are given, and the playing strategy is not limited thereto.

[0294] In the audio processing method provided by the embodiments of the present application, the vehicle-mounted audio device receives not the mixed audio data but the individual encoded audios, and the decoded audios obtained after the decoding processing of the encoded audios are also individual audios (or each decoded audio obtained after the decoding is an audio of different audio type). Therefore, the vehicle-mounted audio device can independently play, adjust and the like each audio, for example, can respectively adjust the volume of the music, the navigation sound and the call sound, can specify different speakers to play different types of audios, and the like. Thus, the audio processing method provided by the present application can realize many optimization scenarios between the electronic device and the vehicle for improving the user experience, can meet the personalized requirements of the vehicle audio playing, and improves the driving and riding experience of the driver and the passenger in the vehicle.

[0295] Please refer to Figure 8 , Figure 8 Another system structure block diagram shown in the embodiments of the present application. As Figure 8 shown, the electronic device can include an audio framework, a virtual hardware abstraction layer and a device virtualization service, and the vehicle-mounted audio device can include the device virtualization service and the audio framework.

[0296] In the embodiments of the present application, the application program is taken as an example of a music application and a navigation application. The user performs input operations on the music application and the navigation application, the music application generates music audio data, the navigation application generates navigation audio data, and the audio framework identifies the audio types of the music audio data and the navigation audio data, and then processes the music audio data and the navigation audio data into music sub-audio data and navigation sub-audio data respectively. The audio framework sends the music sub-audio data and the navigation sub-audio data to the virtual hardware abstraction layer, which forwards the music sub-audio data and the navigation sub-audio data to the device virtualization service through the audio routes created for the music sub-audio data and the navigation sub-audio data respectively.

[0297] The device virtualization service encodes the music sub-audio data through a first encoder created for the music sub-audio data to obtain first encoded audio, and sends the first encoded audio to the transmission channel. The device virtualization service encodes the navigation sub-audio data through a second encoder created for the navigation sub-audio data to obtain second encoded audio, and sends the second encoded audio to the transmission channel.

[0298] In this implementation, the sub-audio data of different audio types is encoded by different encoders, which can improve the encoding efficiency and effectively avoid encoding lag, so that the audio played on the in-vehicle audio device is smoother.

[0299] The first encoded audio and the second encoded audio are sent to the transmission channel of the in-vehicle audio device through the transmission channel in the device virtualization service. In this implementation, the transmission channel transmits encoded audio of different audio types, realizes multiplexing of the transmission channel, reduces resource consumption under the premise of ensuring performance, and effectively saves the resources of the electronic device.

[0300] The transmission channel of the in-vehicle audio device receives the first encoded audio and the second encoded audio sent by the electronic device, and sends the first encoded audio to the first decoder and the second encoded audio to the second decoder. The first decoder is a decoder created by the device virtualization service of the in-vehicle audio device for media audio type encoded audio, and the second decoder is a decoder created by the device virtualization service of the in-vehicle audio device for navigation audio type encoded audio.

[0301] In this implementation, the transmission channel of the in-vehicle audio device transmits encoded audio of different audio types through one transmission channel, realizes multiplexing of the transmission channel, reduces resource consumption under the premise of ensuring performance, and effectively saves the resources of the in-vehicle audio device.

[0302] The first encoded audio is decoded by a first decoder to obtain first decoded audio, and the first decoded audio is sent to an audio framework of the vehicle-mounted audio device.

[0303] In this implementation, the encoded audio of different audio types is decoded by different decoders, effectively avoiding the occurrence of audio lag, thereby improving the fluency of the finally played audio, and further improving the user experience.

[0304] The audio framework of the vehicle-mounted audio device plays the first decoded audio and the second decoded audio according to a playing strategy. For example, the first decoded audio is played by a first player (such as a sub-driver seat loudspeaker), and the second decoded audio is played by a first player (such as a driver seat loudspeaker).

[0305] Since the vehicle-mounted audio device receives not mixed audio data but individual encoded audio, the decoded audio obtained by decoding the encoded audio is also individual audio (or each decoded audio obtained by decoding is audio of a different audio type). Therefore, the vehicle-mounted audio device can independently play, adjust, etc. each audio, for example, can adjust the volume of music, navigation sound, and call sound respectively, can specify different loudspeakers to play different types of audio, etc. Thus, the audio processing method provided in this application can realize many optimization scenarios between the electronic device and the vehicle for improving user experience, can meet the personalized needs of vehicle audio playing, and improves the driving and riding experience of the driver and passengers of the vehicle.

[0306] Compared with the related art, the application differs greatly in the way of transmitting data and the design of audio routing, realizes multiplexing of transmission channels, reduces resource consumption under the premise of ensuring performance, effectively saves the resources of the electronic device and the vehicle-mounted audio device, and improves the interactive experience between the electronic device and the vehicle.

[0307] The audio processing method provided in this application is described below mainly from the perspective of the electronic device. Please refer to Figure 9 , Figure 9 is another flowchart of an audio processing method provided in an embodiment of this application. The method comprises:

[0308] S301, receiving audio data generated by a plurality of application programs.

[0309] S302, processing the audio data into sub-audio data.

[0310] S303, encode the sub-audio data through the corresponding number of encoders created for the sub-audio data to obtain encoded audio.

[0311] S304, send the encoded audio to the vehicle-mounted audio device through the preset transmission channel.

[0312] The specific content of steps S301 to S304 can be referred to the foregoing description, which will not be repeated here.

[0313] The audio processing method provided by the embodiment of the application is applied to an application framework layer of an electronic device connected with a vehicle-mounted audio device. The application framework layer of the electronic device receives audio data generated by a plurality of applications, processes the audio data into sub-audio data, encodes each sub-audio data through a corresponding number of encoders created for the sub-audio data to obtain encoded audio, and sends the encoded audio to the vehicle-mounted audio device through a preset transmission channel.

[0314] Since the data contained in the sub-audio data is a single audio track data (or each data contained in the sub-audio data is different type of audio data), after the single audio track data is encoded and sent to the vehicle-mounted audio device, the vehicle-mounted audio device obtains a single audio (or each decoded audio obtained after decoding the encoded audio is different type of audio) through a decoder created for the encoded audio. Therefore, the vehicle-mounted audio device can independently play, adjust, etc. each audio, for example, can adjust the volume of music, navigation sound and call sound respectively, and can specify different speakers to play different types of audio. Thus, the audio processing method provided by the application can realize many optimization scenarios between the electronic device and the vehicle for improving user experience, can meet the personalized needs of vehicle audio playing, and improves the driving and riding experience of the driver and passengers of the vehicle.

[0315] The audio processing method provided by the application is described below mainly from the vehicle-mounted audio device side. Please refer to Figure 10 , Figure 10 Another flowchart of an audio processing method provided by an embodiment of the application is shown. The method comprises:

[0316] S401, receive encoded audio sent through a preset transmission channel.

[0317] S402, decode the encoded audio through a decoder created for the encoded audio to obtain decoded audio.

[0318] S403, playing the decoded audio according to the playing policy.

[0319] The specific content of steps S401 to S403 can be referred to the foregoing description, which will not be repeated here.

[0320] The audio processing method provided in the embodiments of the present application can meet the personalized needs of audio playing of electronic devices and improve the driving and riding experience of vehicle drivers and passengers.

[0321] Optionally, the audio processing method provided in the embodiments of the present application can also be applied to an interactive scenario of cross-device audio stream transfer between electronic devices. For example, the interactive scenario between a mobile phone and a tablet computer, a mobile phone and a smart screen, a mobile phone and a computer, a tablet computer and a smart screen, a tablet computer and a computer, etc.

[0322] For example, the mobile phone and the tablet computer establish a communication connection through Bluetooth, and the mobile phone and the tablet computer perform audio data transmission and audio data processing. For specific how to perform audio data transmission and audio data processing, the description in steps S201 to S213 can be referred to, which will not be repeated here.

[0323] It is worth noting that the tablet computer itself has a loudspeaker and can be connected with a wired earphone or a wireless earphone as a loudspeaker. The playing policy corresponding to the tablet computer can be to independently adjust the volume of the decoded audio played by different loudspeakers. For example, when the call audio is played through the wireless earphone, the call volume is increased.

[0324] The playing policy corresponding to the tablet computer can also be to play the decoded audio corresponding to the specified loudspeaker through the specified loudspeaker. For example, the call audio is played through the wireless earphone, and the music audio is played through the loudspeaker of the tablet computer itself.

[0325] The audio processing method provided in the embodiments of the present application can meet the personalized needs of audio playing of electronic devices and improve the driving and riding experience of vehicle drivers and passengers.

[0326] In the foregoing audio processing method, one transmission channel is multiplexed, that is, the electronic device end sends the encoded audios of different audio types to the vehicle-mounted audio device end through one transmission channel. In this case, one encoded audio is usually sent through the transmission channel every time an encoded audio is obtained, resulting in low bandwidth utilization. In order to improve the bandwidth utilization, the present application further provides an audio transmission method, which can effectively improve the bandwidth utilization and improve the transmission speed of the encoded audio.

[0327] The audio transmission method provided by the embodiment of the present application will be described below in combination with the software structure. Please refer to Figure 11 , Figure 11 The software structure block diagram of another electronic device shown in an exemplary embodiment of the present application.

[0328] Figure 11 The software structure block diagram of the electronic device shown is based on Figure 4 The software structure block diagram of the electronic device shown is based on Figure 11 As shown, the device virtualization service of the electronic device can further include a packet combining module. The packet combining module will be mainly described below, and the other software structures can refer to the foregoing description of Figure 4 , which will not be described here again.

[0329] Exemplarily, each encoder in the device virtualization service encodes the sub-audio data to obtain a plurality of encoded audios; the packet combining module performs packet combining processing on the plurality of encoded audios to obtain packet combining data; and the packet combining module sends the packet combining data to the transmission channel, and the transmission channel sends the packet combining data to the vehicle-mounted audio device.

[0330] The packet combining processing refers to splicing / combining the plurality of encoded audios, and the data obtained by splicing / combining is the packet combining data. It can be understood in a simple way that a plurality of data packets (each encoded audio corresponds to one data packet) are spliced / combined into one data packet (the packet combining data corresponds to one data packet).

[0331] If the plurality of encoded audios are not subjected to packet combining processing, one encoded audio is sent through the transmission channel every time an encoded audio is obtained, which will result in low bandwidth utilization. For example, the data amount of one encoded audio is 400 bytes, and then 400 bytes of data can be transmitted through the transmission channel at a time, and the next encoded audio needs to wait for the transmission of the previous encoded audio to be completed before being transmitted. However, in the audio transmission method provided by the present application, the plurality of encoded audios are subjected to packet combining processing every time, and then the packet combining data obtained by the packet combining processing is sent to the vehicle-mounted audio device through the transmission channel at a time, which increases the data amount transmitted every time, improves the bandwidth utilization, and improves the transmission speed of the encoded audio.

[0332] Optionally, in one possible implementation, all the encoders (including the talk encoders) send the encoded audio obtained after respective encoding processing to the packetizing module; the packetizing module packetizes all the received encoded audio to obtain packetized data; and the packetizing module sends the packetized data to the transmission channel, and the transmission channel sends the packetized data to the vehicle-mounted audio device.

[0333] In this implementation, the packetizing module packetizes the encoded audio of all audio types, greatly compresses the data volume of the encoded audio, enables more data volume of encoded audio to be transmitted at one time through the transmission channel, improves the bandwidth utilization rate, and increases the transmission speed of the encoded audio.

[0334] Optionally, in one possible implementation, all the encoders (including the talk encoders) send the encoded audio obtained after respective encoding processing to the packetizing module; the packetizing module packetizes all the received encoded audio to obtain packetized data; and the packetizing module sends the packetized data to the transmission channel, and the transmission channel sends the packetized data to the vehicle-mounted audio device.

[0335] In this implementation, a separate transmission channel is established for the encoded audio corresponding to the talk audio data, which can ensure that the encoded audio corresponding to the talk audio data is not disturbed in the transmission process, thereby improving the talk quality. Meanwhile, the packetizing module packetizes the encoded audio sent by the encoders other than the talk encoders, compresses the data volume of the encoded audio, enables more data volume of encoded audio to be transmitted at one time through the transmission channel, improves the bandwidth utilization rate, and increases the transmission speed of the encoded audio.

[0336] The packetizing process will be described in detail below with reference to the accompanying drawings. Figure 12 Figure 12 A packetizing process diagram is shown in an exemplary embodiment of the present application.

[0337] Exemplarily, the packetizing module creates an input buffer (inBuffer) for each encoder, i.e., one inBuffer for one encoder, and the inBuffer is used to receive and store the encoded audio sent by the corresponding encoder. The respective inBuffers are created for different encoders, so that one buffer only needs to store encoded audio of one audio type, which can ensure that the reading, storage, etc. of encoded audio of different audio types are not disturbed.

[0338] For example, the packetizing module creates a first inBuffer for the first encoder and a second inBuffer for the second encoder. ​

[0339] In one example, the packing module creates an input buffer, which can be a corresponding input buffer created in advance for an encoder of different audio types and stored in the packing module for a long time, so as to facilitate the later quick reception and storage of encoded audio through the created input buffer.

[0340] In another example, a period starts from the establishment of a connection between the electronic device and the vehicle-mounted audio device and ends when the connection between the electronic device and the vehicle-mounted audio device is disconnected. In each period, the packing module creates a corresponding input buffer for each encoder created by the device virtualization service. For example, when the packing module initially receives encoded audio of a certain audio type sent by a certain encoder, it creates an input buffer corresponding to the encoder. Thereafter, in the period, the encoded audio sent by the encoder corresponding to the input buffer can be directly received and stored through the input buffer.

[0341] Optionally, when it is detected that the electronic device is disconnected from the vehicle-mounted audio device, the packing module destroys the created input buffer. This implementation destroys the created input buffer at the end of a period, effectively avoiding long-term occupation of system resources by the input buffer, improving resource utilization, and improving the performance of the electronic device.

[0342] It can be understood that if the packing module does not receive encoded audio sent by an encoder of a certain audio type in a period, the input buffer corresponding to the encoder can not be created in the period. This implementation creates a corresponding input buffer when needed, which can effectively reduce resource consumption and improve resource utilization.

[0343] Optionally, the packing module can also establish a thread for each encoder. The thread is used to improve the smoothness of the process corresponding to the thread and to ensure that the process corresponding to the thread is not disturbed by the processes corresponding to other threads.

[0344] For example, the packing module establishes a first thread for a first encoder and a second thread for a second encoder. The process corresponding to the first thread is that the first encoder sends (or writes) the first encoded audio to the first input buffer, and the process corresponding to the second thread is that the second encoder sends (or writes) the second encoded audio to the second input buffer. With the existence of the first thread and the second thread, the process of sending the first encoded audio by the first encoder to the first input buffer does not interfere with the process of sending the second encoded audio by the second encoder to the second input buffer, improving the smoothness of sending encoded audio.

[0345] Optionally, the packet assembling module can further comprise a packet sender. The packet sender is configured to read the encoded audios from the input buffers, splice / combine the read encoded audios to obtain the packet data, and send the packet data to the transmission channel.

[0346] It is worth mentioning that the packet sender works periodically, for example, every time a sending period (i.e., a preset period) arrives, the packet sender reads the encoded audios from the input buffers, reads all the encoded audios in the current input buffers, splices / combines the read encoded audios to obtain the packet data, and sends the packet data to the transmission channel. Then, the packet sender continues to wait for the arrival of the next sending period, and repeats the process of reading the encoded audios, splicing / combining the encoded audios, and sending the packet data until the electronic device is disconnected from the vehicle audio device.

[0347] The sending period can be set / adjusted according to the encoding period of the encoders. For example, the encoding period can be 10 ms, 20 ms, 30 ms, 40 ms, etc., and the sending period can be 10 ms, 20 ms, 30 ms, 40 ms, etc.

[0348] It is worth mentioning that if the encoding periods of the encoders are different, the sending period can be set according to the smallest encoding period to ensure that the audio does not freeze. For example, if the encoding period of the first encoder is 10 ms and the encoding period of the second encoder is 20 ms, the sending period is 10 ms.

[0349] It can be understood that since the packet sender reads the encoded audios from the input buffers every time a sending period arrives, the storage duration of the encoded audios temporarily stored in the input buffers is the same as the sending period. For example, when the sending period is 20 ms, the storage duration of the encoded audios temporarily stored in the input buffers is also 20 ms. This is only an example and is not limited in this regard.

[0350] Optionally, the packet assembling module can further establish a thread for the packet sender, which is configured to improve the smoothness of the process to be performed by the packet sender (such as the process of reading the encoded audios, splicing / combining the encoded audios, and sending the packet data) and ensure that the process to be performed by the packet sender is not disturbed by the processes corresponding to other threads. For example, the packet assembling module establishes a third thread for the packet sender.

[0351] Optionally, in one possible implementation, the packet sender obtains the packet data after splicing / combining the read encoded audios. If the packet data is successfully obtained, the packet data is sent to the transmission channel. Then, the packet sender performs a sending interval waiting, or in other words, the packet sender continues to wait for the arrival of the next sending period.

[0352] If the combined package data is not obtained, the step of obtaining the combined package data is performed. It should be understood that the packet sender may not read the encoded audio in a certain sending period due to jitter of the encoder, network lag, etc., and thus the combined package data is not obtained.

[0353] In this implementation, the encoded audio in a sending period can be spliced / combined by the packet sender and sent to the vehicle-mounted audio device through the transmission channel, so that a large amount of encoded audio is sent in a sending period, the bandwidth utilization is improved, and the transmission speed of the encoded audio is improved.

[0354] Please refer to Figure 13 , Figure 13 The sending period diagram shown in an example embodiment of the present application is shown. As shown in Figure 13 , the period between two sending points is a sending period. For example, the period between the first sending point and the second sending point is a sending period, denoted as the first sending period; the period between the second sending point and the third sending point is a sending period, denoted as the second sending period; the period between the third sending point and the fourth sending point is a sending period, denoted as the third sending period; and the period between the fourth sending point and the fifth sending point is a sending period, denoted as the fourth sending period.

[0355] For example, three encoded audios are received in the first sending period, which are the encoded audios of the media audio type in the first row, the encoded audios of the navigation audio type in the second row, and the encoded audios of the mixed audio type in the third row. The three encoded audios are combined to obtain combined package data, which is sent to the transmission channel at the second sending point. One encoded audio is received in the second sending period, which is combined to obtain combined package data, which is sent to the transmission channel at the third sending point. Five encoded audios are received in the third sending period, which are combined to obtain combined package data, which is sent to the transmission channel at the fourth sending point.

[0356] It should be understood that the encoded audios with the cross symbol received in the third sending period should have been received in the second sending period, and they may be received in the third sending period due to jitter of the encoder, network lag, etc.

[0357] It is worth mentioning that the data amount of the packetized data is not limited. The more the encoded audios received in a sending period, the larger the packetized data generated; correspondingly, the less the encoded audios received in a sending period, the smaller the packetized data generated. For example, the data amount of an encoded audio is 400 bytes, and three encoded audios are received in a sending period, and the data amount of the packetized data generated is 1200 bytes. For another example, the data amount of an encoded audio is 400 bytes, and five encoded audios are received in a sending period, and the data amount of the packetized data generated is 2000 bytes.

[0358] Please refer to Figure 14 , Figure 14 The packetized data shown in the example embodiment of the present application is shown in the following figure.

[0359] In an example embodiment, the packetized data obtained by packetizing the plurality of encoded audios can include: setting a transmission protocol header, splicing / combining each encoded audio (each encoded audio is a data packet), and setting a data header for each encoded audio in the process of splicing / combining the encoded audios.

[0360] The transmission protocol header is used to indicate that the packetized data is data obtained by packetizing, or that the packetized data is encapsulated data. After the vehicle-mounted audio device receives the packetized data, it can quickly determine that the packetized data is data obtained by packetizing by identifying the transmission protocol header in the packetized data, so as to perform packetizing processing on the packetized data.

[0361] The data header can include attribute information of the encoded audio. For example, the identification of the audio route corresponding to the encoded audio, the audio type corresponding to the encoded audio, the application corresponding to the encoded audio, the data packet length corresponding to the encoded audio, and the like are stored in the data header. Optionally, a reserved field can also be stored in the data header, so as to facilitate subsequent addition of identification, notes and the like to the encoded audio through the reserved field, which is conducive to improving the compatibility of the electronic device.

[0362] It is worth mentioning that the order of splicing / combining each encoded audio can be determined according to the order of reading each encoded audio. For example, the first encoded audio is read from the first input buffer in sequence, and the second encoded audio is read from the second input buffer. The transmission protocol header is set, the first data header is set for the first encoded audio, and the first data header and the first data packet (the data packet corresponding to the first encoded audio) are spliced / combined; the second data header is set for the second encoded audio, and the second data header and the second data packet (the data packet corresponding to the second encoded audio) are spliced / combined to obtain the packetized data. As shown in Figure 14 The packetized data includes the transmission protocol header, the first data header, the first data packet, the second data header, and the second data packet.

[0363] This implementation adds a data header to the encoded audio during the splicing / combining of encoded audio, making it easier for the in-vehicle audio equipment to quickly repackage the combined data based on the data header and quickly obtain the attribute information of each encoded audio.

[0364] In another example, multiple encoded audio files are combined into a single packet to obtain combined data. This may include setting a transport protocol header and sequentially concatenating / combining each encoded audio file (each encoded audio file corresponds to a data packet).

[0365] This implementation method directly splices / combines encoded audio without adding a data header to the encoded audio, which improves the speed of packet processing and thus the speed of generating packet data.

[0366] The audio transmission method provided in the embodiments of this application has been described above in conjunction with the software structure. The audio transmission method provided in the embodiments of this application will now be described below in conjunction with the system architecture. Please refer to... Figure 15 , Figure 15 This is another system architecture block diagram illustrated for an exemplary embodiment of this application. (See diagram below.) Figure 15 As shown, the system architecture block diagram is in Figure 5 Based on the corresponding system architecture diagram, a package merging module and a package sub-package module have been added. The following mainly describes the package sub-package module for in-vehicle audio equipment; other software structures can be found in the previous sections. Figure 5 as well as Figure 11 The description will not be repeated here.

[0367] For example, the transmission channel of the electronic device sends the bundled data to the transmission channel of the in-vehicle audio device. The transmission channel of the electronic device may include a sending unit, through which the bundled data is sent to the transmission channel of the in-vehicle audio device.

[0368] In this implementation, because multiple encoded audio files are packetized, the packetized data is ultimately sent to the transmission channel of the in-vehicle audio device, rather than sending the multiple encoded audio files directly to the transmission channel of the in-vehicle audio device. Therefore, the number of sending units is greatly reduced (for example, where three encoded audio files would normally require three sending units, only one sending unit is needed here), effectively improving the efficiency of sending packetized data and increasing the bandwidth utilization between the electronic device and the in-vehicle audio device.

[0369] Exemplarily, after the transmission channel of the in-vehicle audio device receives the packetized data, the packetized data is processed by a packet splitting module in the device virtualization service to obtain a plurality of encoded audios; each decoder in the device virtualization service decodes each encoded audio to obtain a plurality of decoded audios. Each decoder sends the decoded audio obtained after decoding to an audio playing module, and the audio playing module temporarily stores each decoded audio. Every interval of a preset time length, the audio playing module sends the temporarily stored decoded audios to the audio framework.

[0370] The audio framework obtains a playing strategy, and after receiving each decoded audio sent by the audio playing module, plays and / or adjusts the decoded audio according to the playing strategy. The playing strategy can include independently adjusting the playing volume of the decoded audio, and / or playing the decoded audio corresponding to a specified speaker through the specified speaker.

[0371] In this implementation, the packet splitting processing refers to splitting the packetized data into one or more encoded audios.

[0372] For the in-vehicle audio device, a large amount of data can be received at one time when the in-vehicle audio device receives the packetized data through the transmission channel, thereby improving the data transmission rate and improving the bandwidth utilization.

[0373] Optionally, in a possible implementation, if all the encoders (including the call encoder) send the encoded audios obtained after respective encoding processing to the packetizing module at the electronic device end; the packetizing module packetizes all the received encoded audios to obtain packetized data; and the packetizing module sends the packetized data to the transmission channel, and the transmission channel sends the packetized data to the in-vehicle audio device. Correspondingly, the transmission channel of the in-vehicle audio device receives the packetized data in this scenario.

[0374] In this implementation, since the packetizing module at the electronic device end packetizes encoded audios of all audio types, the data amount of the encoded audios is greatly compressed, so that more data amount of encoded audios can be transmitted at one time through the transmission channel of the electronic device, thereby enabling the transmission channel of the in-vehicle audio device to receive more data amount of encoded audios at one time, improving the bandwidth utilization between the electronic device and the in-vehicle audio device, and improving the transmission speed of the encoded audios.

[0375] Optionally, in a possible implementation manner, if, at the electronic device end, the encoding audio obtained after the respective encoding processing of the other encoders except the call encoder is sent to the packet combining module; the packet combining module performs packet combining processing on the received encoding audio to obtain packet combining data; the packet combining module sends the packet combining data to the transmission channel, and the transmission channel sends the packet combining data to the vehicle-mounted audio device. Correspondingly, the transmission channel of the vehicle-mounted audio device receives the packet combining data in this scenario. The call encoder at the electronic device end sends the encoding audio corresponding to the call audio data to the transmission channel, and the transmission channel sends the encoding audio corresponding to the call audio data to the vehicle-mounted audio device. Correspondingly, the transmission channel of the vehicle-mounted audio device separately receives the encoding audio corresponding to the call audio data.

[0376] In this implementation manner, a separate transmission channel is established for the encoding audio corresponding to the call audio data, which can ensure that the encoding audio corresponding to the call audio data is not disturbed in the transmission process, thereby improving the call quality. Meanwhile, since the packet combining module at the electronic device end performs packet combining processing on the encoding audio sent by the other encoders except the call encoder, the data amount of the encoding audio is compressed, so that more data amount of encoding audio can be transmitted at one time through the transmission channel of the electronic device, thereby enabling the transmission channel of the vehicle-mounted audio device to receive more data amount of encoding audio at one time, improving the bandwidth utilization between the electronic device and the vehicle-mounted audio device, and improving the transmission speed of the encoding audio.

[0377] The packet combining processing process is described in detail below with reference to the accompanying drawings. Figure 16 Figure 16 A packet combining processing schematic diagram of an example embodiment of the present application is shown.

[0378] For example, the packet combining module creates an input buffer for each decoder, that is, one inBuffer corresponds to one decoder, and the inBuffer is used to receive and store the encoding audio split from the packet combining data.

[0379] For example, the packet combining module creates a first input buffer for the first decoder and a second input buffer for the second decoder.

[0380] In an example, the packet combining module creates the input buffer, which can be a corresponding input buffer created in advance for the decoder of different audio types and stored in the packet combining module for a long time, so as to facilitate the reception and storage of the encoding audio through the created input buffer later.

[0381] ​In another example, a cycle starts from the electronic device establishing a connection with the in-vehicle audio device and ends when the electronic device disconnects from the in-vehicle audio device. In each cycle, the packet splitting module creates an input buffer corresponding to each decoder created by the device virtualization service. For example, when the packet splitting module splits the encoded audio of a certain audio type for the first time, the packet splitting module creates an input buffer corresponding to the decoder of the audio type. Then, in the cycle, the encoded audio corresponding to the input buffer can be directly received and stored through the input buffer.

[0382] Optionally, when it is detected that the electronic device disconnects from the in-vehicle audio device, the packet splitting module destroys the created input buffer. In this implementation, the created input buffer is destroyed at the end of a cycle, which effectively avoids long-term occupation of system resources by the input buffer, improves resource utilization, and improves the performance of the electronic device.

[0383] It can be understood that if the packet splitting module never splits the encoded audio of a certain audio type in a cycle, the packet splitting module can not create an input buffer corresponding to the decoder of the audio type in the cycle. In this implementation, the corresponding input buffer is created only when needed, which can effectively reduce resource consumption and improve resource utilization.

[0384] Optionally, the packet splitting module can also establish a thread for each decoder. The thread is used to improve the smoothness of the process corresponding to the thread and to ensure that the process corresponding to the thread is not disturbed by the processes corresponding to other threads.

[0385] For example, the packet splitting module establishes a first thread for a first decoder and a second thread for a second decoder. The process corresponding to the first thread is that the first decoder reads the first encoded audio from the first input buffer, and the process corresponding to the second thread is that the second decoder reads the second encoded audio from the second input buffer. With the existence of the first thread and the second thread, the process of the first decoder reading the first encoded audio from the first input buffer is not disturbed by the process of the second decoder reading the second encoded audio from the second input buffer, and the smoothness of reading the encoded audio is improved.

[0386] Optionally, the packet splitting module can also establish a thread, such as a third thread, for splitting the packetized data. The third thread is used to ensure that the process of splitting the packetized data is not disturbed by the processes corresponding to other threads.

[0387] For example, after each decoder reads the encoded audio, the decoder decodes the encoded audio to obtain decoded audio. Each decoder sends the decoded audio obtained after decoding to the audio playback module. The audio playback module temporarily stores each decoded audio, and sends the temporarily stored decoded audio to the audio framework every preset time interval.

[0388] Optionally, the audio playing module can further include a plurality of playing interfaces, through which the audio framework can be accessed. Illustratively, each decoder sends the decoded audio obtained after decoding processing to the audio framework through a playing interface. For example, the first decoder sends the decoded audio obtained after decoding processing to the audio framework through a first playing interface; the second decoder sends the decoded audio obtained after decoding processing to the audio framework through a second playing interface.

[0389] The audio framework obtains a playing strategy, and after receiving each decoded audio sent by the audio playing module, plays and / or adjusts the decoded audio according to the playing strategy. In this way, the vehicle-mounted audio device can independently play, adjust, etc. each audio, can realize many optimization scenarios between the electronic device and the vehicle for improving user experience, can meet the personalized needs of vehicle audio playing, and improves the driving and riding experience of the vehicle driver and vehicle passengers.

[0390] In one example, the packetizing processing of the packetized data to obtain the encoded audio can include: identifying a transmission protocol header, parsing a data header corresponding to each encoded audio in the packetized data, and according to the data packet length of the encoded audio in each data header, sequentially splitting out each encoded audio (each encoded audio is one data packet).

[0391] Illustratively, after the vehicle-mounted audio device receives the packetized data, the transmission protocol header in the packetized data is identified, it is quickly determined that the packetized data is data obtained after packetizing processing, and thus the packetized data is parsed.

[0392] For each encoded audio, the attribute information in the data header is parsed to determine the identifier of the audio route corresponding to the encoded audio, the audio type corresponding to the encoded audio, the application program corresponding to the encoded audio, and the data packet length corresponding to the encoded audio, etc.

[0393] The encoded audio is then accurately extracted from the packetized data according to the data packet length corresponding to the encoded audio. For example, the end position of the data header is obtained, the start position of the encoded audio is determined according to the end position of the data header, and the encoded audio is extracted from the packetized data according to the start position of the encoded audio and the data packet length.

[0394] In this implementation, by parsing the data header in the packetized data, each encoded audio can be accurately and quickly parsed, which is conducive to subsequent decoding processing of the encoded audio by the vehicle-mounted audio device, so that each audio can be independently played, adjusted, etc.

[0395] The audio transmission method provided by the embodiments of the present application is described above in combination with the system architecture, and the audio transmission method provided by the embodiments of the present application is described below in combination with the flowchart.

[0396] Please refer to Figure 17 , Figure 17 A flowchart of an audio transmission method is shown in the embodiments of the present application. The method comprises:

[0397] S501, sending an audio splitting instruction and a cross-device audio streaming capability starting instruction.

[0398] S502, starting an audio splitting function and a cross-device audio streaming function.

[0399] S503, a user triggers an input operation.

[0400] S504, receiving audio data generated by multiple application programs.

[0401] S505, processing the audio data into sub-audio data.

[0402] S506, forwarding the sub-audio data through an audio routing.

[0403] S507, forwarding the sub-audio data through a virtual audio service.

[0404] S508, encoding processing the sub-audio data, and sending encoded audio.

[0405] S509, packet processing multiple encoded audios to obtain packet data.

[0406] S510, sending the packet data through a transmission channel.

[0407] The specific content of steps S501 to S510 can be referred to the foregoing description, which will not be repeated here.

[0408] The audio transmission method provided by the embodiments of the present application, on the one hand, since the data contained in the sub-audio data processed by the electronic device is a single audio track data (or each data contained in the sub-audio data is a different type of audio data), the single audio track data is encoded and sent to the vehicle-mounted audio device, and the vehicle-mounted audio device decodes the encoded audio through the decoder created for the encoded audio to obtain decoded audio which is also a single audio (or each decoded audio obtained is a different type of audio). Therefore, the vehicle-mounted audio device can independently play, adjust, etc. each audio, for example, can adjust the volume of music, navigation sound and call sound respectively, can specify different speakers to play different types of audio, etc. Thus, many optimization scenarios for improving user experience between the electronic device and the vehicle can be realized, the individualized needs of vehicle audio playback can be met, and the driving and riding experience of the vehicle driver and passengers is improved.

[0409] On the other hand, the electronic device performs packet combining processing on the encoded audio, greatly compresses the data amount of the encoded audio, enables more data amount of encoded audio to be transmitted at one time through the transmission channel, improves the bandwidth utilization rate, and improves the transmission speed of the encoded audio.

[0410] Please refer to Figure 18 , Figure 18 The flowchart of another audio transmission method shown in the embodiments of the present application is shown. The method comprises:

[0411] S601, send audio splitting instruction and cross-device audio streaming capability start instruction.

[0412] S602, start audio splitting function and cross-device audio streaming function.

[0413] S603, the user triggers the input operation.

[0414] S604, receive audio data generated by multiple application programs.

[0415] S605, process the audio data into sub-audio data.

[0416] S606, forward the sub-audio data through the audio routing.

[0417] S607, forward the sub-audio data through the virtual audio service.

[0418] S608, encode the sub-audio data, and send the encoded audio.

[0419] S609, packet combining processing is performed on the encoded audio to obtain packet combining data.

[0420] S610, send the packet combining data through the transmission channel.

[0421] S611, receive and send the packet combining data.

[0422] S612, packet combining processing is performed on the packet combining data to obtain multiple encoded audios.

[0423] S613, decode the multiple encoded audios to obtain multiple decoded audios.

[0424] S614, send the multiple decoded audios.

[0425] S615, play the multiple decoded audios according to the playing strategy.

[0426] The specific content of steps S601 to S615 can be referred to the foregoing description, which will not be repeated here.

[0427] In this implementation, on the one hand, since the multiple encoded audios are subjected to the bundling processing, the bundled data is finally transmitted to the transmission channel of the vehicle-mounted audio device, instead of directly transmitting the multiple encoded audios to the transmission channel of the vehicle-mounted audio device. Therefore, the number of transmitting units is greatly reduced (for example, three transmitting units are originally required for transmitting three encoded audios, while only one transmitting unit is required here), which effectively improves the efficiency of transmitting the bundled data and improves the bandwidth utilization rate between the electronic device and the vehicle-mounted audio device.

[0428] On the other hand, since the vehicle-mounted audio device receives not the mixed audio data but the individual encoded audios, after the decoding processing of the encoded audios, the decoded audios obtained are also individual audios (or in other words, each decoded audio obtained by decoding is an audio of a different audio type). Therefore, the vehicle-mounted audio device can independently play, adjust, and the like each audio, for example, can respectively adjust the volume of the music, the navigation sound, and the call sound, and can specify different loudspeakers to play different types of audios. Thus, the audio processing method provided by the present application can realize many optimization scenarios between the electronic device and the vehicle for improving the user experience, can meet the personalized needs of vehicle audio playing, and improves the driving and riding experience of the driver and the passengers of the vehicle.

[0429] The audio transmission method provided by the present application is described below mainly from the perspective of the electronic device. Please refer to Figure 19 , Figure 19 Another flowchart of the audio transmission method provided by the present application is shown in the embodiment of the present application. The method comprises the following steps:

[0430] S701, obtaining multiple encoded audios.

[0431] S702, performing bundling processing on the multiple encoded audios to obtain bundled data.

[0432] S703, transmitting the bundled data to a vehicle-mounted audio device through a preset transmission channel.

[0433] The specific contents of steps S701 to S703 can be referred to the foregoing description, which will not be repeated here.

[0434] In this implementation, since the electronic device performs the bundling processing on the encoded audios, the data amount of the encoded audios is greatly compressed, more data amount of encoded audios can be transmitted at one time through the transmission channel, the bandwidth utilization rate is improved, and the transmission speed of the encoded audios is improved.

[0435] The audio transmission method provided by the present application is described below mainly from the perspective of the vehicle-mounted audio device. Please refer to Figure 20 , Figure 20A flowchart of another audio transmission method is shown in the embodiments of the present application. The method comprises:

[0436] S801, receiving the packet data sent through the preset transmission channel.

[0437] S802, packet processing the packet data to obtain a plurality of encoded audios.

[0438] The specific content of steps S801 to S802 can be referred to the foregoing description, which will not be repeated here.

[0439] In this implementation, since the plurality of encoded audios are packet processed, the packet data is finally sent to the transmission channel of the vehicle-mounted audio device, instead of directly sending the plurality of encoded audios to the transmission channel of the vehicle-mounted audio device. Therefore, the number of sending units is greatly reduced (for example, three sending units are originally required to send three encoded audios, while only one sending unit is required here), which effectively improves the efficiency of sending the packet data and improves the bandwidth utilization rate between the electronic device and the vehicle-mounted audio device.

[0440] Optionally, the audio transmission method provided by the embodiments of the present application can also be applied to an interactive scenario of cross-device audio stream transfer between electronic devices. For example, the interactive scenarios of a mobile phone and a tablet computer, a mobile phone and a smart screen, a mobile phone and a computer, a tablet computer and a smart screen, a tablet computer and a computer, etc.

[0441] Exemplarily, the interactive scenario between the mobile phone and the tablet computer is taken as an example for description. For example, the mobile phone and the tablet computer establish a communication connection through Bluetooth, and the mobile phone and the tablet computer perform audio data transmission and audio data processing. For specific how to perform audio data transmission and audio data processing, reference can be made to the description in steps S601 to S614, which will not be repeated here.

[0442] The audio transmission method provided by the present application packet processes the transmitted encoded audio, greatly compresses the data amount of the encoded audio, enables more data amount of encoded audio to be transmitted at one time through the transmission channel, improves the bandwidth utilization rate, improves the transmission speed of the encoded audio, and improves the user experience.

[0443] The hardware structure of the electronic device involved in the embodiments of the present application will be briefly introduced below in combination with the drawings.

[0444] Please refer to Figure 21 , Figure 21 The hardware structure of the electronic device shown in an exemplary embodiment of the present application is shown in the following figure.

[0445] As Figure 21As shown, the electronic device 100 can include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 can include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0446] It can be understood that the structures shown in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 can include more or fewer components than those shown, or the electronic device 100 can include a combination of some of the components shown, or the electronic device 100 can include sub-components of some of the components shown. Figure 21 It can be understood that the structures shown in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 can include more or fewer components than those shown, or the electronic device 100 can include a combination of some of the components shown, or the electronic device 100 can include sub-components of some of the components shown. Figure 21 It can be understood that the structures shown in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 can include more or fewer components than those shown, or the electronic device 100 can include a combination of some of the components shown, or the electronic device 100 can include sub-components of some of the components shown. Figure 21 It can be understood that the structures shown in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 can include more or fewer components than those shown, or the electronic device 100 can include a combination of some of the components shown, or the electronic device 100 can include sub-components of some of the components shown. Figure 21 The components shown can be implemented in hardware, software, or a combination of software and hardware.

[0447] The processor 110 can include one or more processing units, for example: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc.

[0448] The different processing units can be independent devices or can be integrated in one or more processors. The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to instruction operation codes and timing signals, and complete the control of fetching and executing instructions.

[0449] The processor 110 can also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can store instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to use the instructions or data again, it can be directly called from the memory. This avoids repeated access and reduces the waiting time of the processor 110, thereby improving the efficiency of the system.

[0450] In embodiments of the present application, the processor 110 can execute each step of the audio processing method and the audio transmission method. For example, the processor 110 can run the software code of the audio processing method and the audio transmission method provided in embodiments of the present application.

[0451] In some embodiments, the processor 110 can include one or more interfaces. The interfaces can include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI) interface, a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0452] It can be understood that the interface connection relationship between the modules shown in the embodiments is only illustrative and does not constitute a structural limitation on the electronic device 100. In other embodiments, the electronic device 100 can also use different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0453] The wireless communication function of the electronic device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor, etc.

[0454] The wireless communication module 160 can provide a wireless communication solution applied on the electronic device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive signals to be sent from the processor 110, perform frequency modulation, amplification, and convert the signals to electromagnetic wave radiation via the antenna 2.

[0455] In some embodiments, the antenna 1 and the mobile communication module 150 of the electronic device 100 are coupled, and the antenna 2 and the wireless communication module 160 are coupled, so that the electronic device 100 can communicate with the network and the vehicle audio device through the wireless communication technology.

[0456] The electronic device 100 can implement the display function through the GPU, the display screen 194, and the application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU can also be used to perform mathematical and pose calculations for graphics rendering, etc. The processor 110 can include one or more GPUs, and the execution of program instructions by the GPU can generate or change display information.

[0457] In the embodiments of the present application, the display screen 194 can be used to display the interface of each application program.

[0458] The display screen 194 in the embodiments of the present application can be a touch screen. The display screen 194 can be integrated with a touch sensor 180K. The touch sensor 180K can also be referred to as a "touch panel". That is, the display screen 194 can include a display panel and a touch panel, and the touch sensor 180K and the display screen 194 form a touch screen, also referred to as a "touch screen". The touch sensor 180K is used to detect a touch operation acting on or near it. After the touch operation detected by the touch sensor 180K, the touch operation can be transmitted to the upper layer by the driver (such as the TP driver) of the kernel layer to determine the touch event type. The visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be arranged on the surface of the electronic device 100, which is different from the position of the display screen 194.

[0459] The audio processing method and the audio transmission method provided in the embodiments of the present application can be implemented in the electronic device 100 with the above hardware structure.

[0460] The above describes the examples of the audio processing method and the audio transmission method provided in the embodiments of the present application in detail. It can be understood that the electronic device includes hardware and / or software modules corresponding to each function to implement the above functions. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of the examples described in the embodiments disclosed in the present application, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is implemented in hardware or computer software driven hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered beyond the scope of the present application.

[0461] The embodiments of the present application can divide the functional modules of the electronic device according to the above method examples. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one module. The integrated module can be implemented in the form of hardware or software functional module. It should be noted that the division of modules in the embodiments of the present application is illustrative, and is only a logical functional division. Actual implementation can have another division manner.

[0462] It should be noted that all related contents of each step involved in the above method embodiments can be cited to the function description of the corresponding functional module, which will not be described here.

[0463] The electronic device provided in the embodiments of the present application is used to execute the above audio processing method and audio transmission method, and thus can achieve the same effect as the above implementation method.

[0464] In the case of employing the integrated unit, the electronic device can further include a processing module, a storage module and a communication module. The processing module can be used to control and manage the actions of the electronic device. The storage module can be used to support the electronic device to execute the storage of program codes and data, etc. The communication module can be used to support the communication between the electronic device and other devices.

[0465] The processing module can be a processor or a controller. It can realize or execute various exemplary logical blocks, modules and circuits described in combination with the disclosure. The processor can also be a combination of computing functions, such as one or more microprocessor combinations, digital signal processing (DSP) and microprocessor combinations, etc. The storage module can be a memory. The communication module can be a device for interacting with other electronic devices, such as a radio frequency circuit, a Bluetooth chip, a WiFi chip, etc.

[0466] The embodiments of the present application also provide a vehicle-mounted audio device, which includes one or more processors, one or more memories, a module installed with a plurality of application programs, and the memory stores one or more programs. When the one or more programs are executed by the processor, the vehicle-mounted audio device executes the audio processing method and the audio transmission method in the above embodiments.

[0467] The embodiments of the present application also provide a vehicle, which includes one or more processors, one or more memories, and the memory stores one or more programs. When the one or more programs are executed by the processor, the vehicle executes the audio processing method and the audio transmission method in the above embodiments.

[0468] The embodiments of the present application also provide a computer readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor executes the audio processing method and the audio transmission method in any of the above embodiments.

[0469] The embodiments of the present application also provide a computer program product, which, when running on a computer, causes the computer to execute the above related steps to realize the audio processing method and the audio transmission method in the above embodiments.

[0470] The embodiments of the present application also provide a chip. Please refer to Figure 22 , Figure 22 The chip provided by the embodiments of the present application is a structure schematic diagram of a chip. Figure 22 The chip shown in the figure can be a general-purpose processor or a special-purpose processor. The chip includes a processor 310. The processor 310 is used to execute the audio processing method and the audio transmission method in any of the above embodiments.

[0471] Optionally, the chip further comprises a transceiver 320, which is used to accept the control of the processor and is used to support the communication device to execute the technical solutions shown in the foregoing.

[0472] Optionally, Figure 22 The chip shown can further comprise a storage medium 330.

[0473] It should be noted that Figure 22 The chip shown can be implemented using one or more of the following circuits or devices: a field programmable gate array (FPGA), a programmable logic device (PLD), a controller, a state machine, gate logic, discrete hardware components, any other suitable circuit, or any combination of circuits capable of performing the various functions described throughout this application.

[0474] The electronic device, the vehicle-mounted audio device, the computer readable storage medium, the computer program product or the chip provided in the embodiments are all used to execute the corresponding method provided above, and thus the beneficial effects that can be achieved are referable to the beneficial effects of the corresponding method provided above, which will not be described here again.

[0475] Through the above description of the embodiments, those skilled in the art can understand that, for the convenience and brevity of description, only the division of the above functional modules is taken as an example for illustration, and in actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.

[0476] In several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented by other ways. For example, the apparatus embodiments described above are only schematic, for example, the division of the modules or units is only a logical function division, and actual implementation can be another division manner, for example, a plurality of units or components can be combined or integrated into another device, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.

[0477] The units described as separate components may or may not be physically separate, and the components displayed as units may be a physical unit or multiple physical units, that is, may be located in one place, or also can be distributed to multiple different places. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.

[0478] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present alone, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.

[0479] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a readable storage medium. Based on such understanding, the technical scheme of the embodiments of the present application essentially or the part that contributes to the prior art or the whole or part of the technical scheme can be embodied in the form of a software product, which is stored in a storage medium and includes a plurality of instructions for causing an apparatus (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the method of each embodiment of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various program code storage media.

[0480] The above is only a specific embodiment of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. An audio transmission method, characterized by, The application program framework layer applied to an electronic device connected with a vehicle-mounted audio device, the method comprises: Obtaining a plurality of encoded audios; each of the encoded audios corresponds to a data packet; the plurality of encoded audios are obtained based on encoding processing of sub-audio data; the sub-audio data comprises media sub-audio data, navigation sub-audio data, call sub-audio data, and mixed sub-audio data; the mixed sub-audio data is obtained by mixing other sub-audio data except the media sub-audio data, the navigation sub-audio data, and the call sub-audio data; Packetizing the plurality of encoded audios to obtain packetized data; the packetized data corresponds to one data packet; Transmitting the packetized data to the vehicle-mounted audio device through a preset transmission channel; the packetized data is used to trigger the vehicle-mounted audio device to packetize the packetized data to obtain a plurality of encoded audios.

2. The method of claim 1, wherein, Before the step of obtaining the plurality of encoded audios, the method further comprises: Receiving audio data generated by a plurality of application programs; Processing the audio data into the sub-audio data; Encoding the sub-audio data through a corresponding number of encoders created for the sub-audio data to obtain the plurality of encoded audios.

3. The method of claim 2, wherein, The method further comprises: Creating a corresponding input buffer for each encoder; the input buffer corresponding to each encoder is used to store the encoded audio corresponding to each encoder; The step of obtaining the plurality of encoded audios comprises: reading the encoded audio from each input buffer in each preset period to obtain the plurality of encoded audios; the preset period is the same as the storage duration of each encoded audio in each input buffer.

4. The method according to any one of claims 1 to 3, characterized in that, The step of packetizing the plurality of encoded audios to obtain the packetized data comprises: Setting a data header for each encoded audio; Splicing the data header corresponding to each encoded audio and the data packet corresponding to each encoded audio to obtain the packetized data.

5. The method of claim 4, wherein, The data header corresponding to each encoded audio comprises an audio type corresponding to each encoded audio, an application program corresponding to each encoded audio, and a data packet length of each encoded audio; the audio type comprises any one of a media audio type, a navigation audio type, a call audio type, and a mixed audio type.

6. The method of claim 3, wherein, The step of transmitting the packetized data to the vehicle-mounted audio device through the preset transmission channel comprises: After successfully obtaining the packetized data in the preset period, transmitting the packetized data to the vehicle-mounted audio device through the preset transmission channel.

7. The method of claim 4, wherein, The plurality of encoded audios in the vehicle-mounted audio device are used to trigger the vehicle-mounted audio device to decode the plurality of encoded audios through a decoder created for the plurality of encoded audios to obtain a plurality of decoded audios; the plurality of decoded audios are used for the vehicle-mounted audio device to play the plurality of decoded audios according to a playing strategy; the playing strategy comprises independently adjusting a playing volume corresponding to each decoded audio, and / or playing a decoded audio corresponding to a specified speaker through the specified speaker.

8. The method of claim 2, wherein, The method further comprises: receive an instruction that the electronic device is disconnected from the vehicle audio device, and destroy each input buffer.

9. An audio transmission method, characterized by, An application framework layer applied to a vehicle audio device, the vehicle audio device being connected with an electronic device, the method comprising: receiving a combined package data sent through a preset transmission channel; the combined package data corresponding to one data package; the combined package data being obtained by performing a combined package processing on a plurality of encoded audios by an application framework layer of the electronic device; performing a package processing on the combined package data to obtain a plurality of encoded audios; each of the encoded audios corresponding to one data package; decoding each of the encoded audios through a decoder created for each of the encoded audios to obtain a plurality of decoded audios; the plurality of decoded audios including a decoded audio corresponding to media sub-audio data, a decoded audio corresponding to navigation sub-audio data, a decoded audio corresponding to call sub-audio data, and a decoded audio corresponding to mixed sub-audio data.

10. The method of claim 9, wherein, The combined package data includes a data header corresponding to each of the encoded audios and a data package corresponding to each of the encoded audios, and the performing the package processing on the combined package data to obtain the plurality of encoded audios comprises: parsing the data header corresponding to each of the encoded audios in the combined package data; parsing the data package corresponding to each of the encoded audios according to a data package length of the encoded audio in each of the data headers.

11. The method of claim 9, wherein, The method further comprises: playing the plurality of decoded audios according to a playing strategy; the playing strategy including independently adjusting a playing volume of each of the decoded audios, and / or playing a decoded audio corresponding to a specified speaker through the specified speaker.

12. An electronic device, comprising: comprise: one or more processors; one or more memories; The memory stores one or more programs, when the one or more programs are executed by the processor, causing the electronic device to perform the method in any one of claims 1 to 8.

13. A car audio apparatus characterized by comprising: comprise: one or more processors; one or more memories; The memory stores one or more programs, when the one or more programs are executed by the processor, causing the vehicle audio device to perform the method in any one of claims 9 to 11.

14. A vehicle characterized by comprising: comprise: one or more processors; one or more memories; The memory stores one or more programs, when the one or more programs are executed by the processor, causing the vehicle to perform the method in any one of claims 9 to 11.

15. A chip, characterized by comprise: a processor, configured to invoke and run a computer program from a memory, so that an electronic device installed with the chip performs the method in any one of claims 1 to 8, or so that a vehicle audio device installed with the chip performs the method in any one of claims 9 to 11.

16. A computer readable storage medium characterized by: The computer readable storage medium stores a computer program, when the computer program is executed by a processor, causing the processor to perform the method in any one of claims 1 to 8, or causing the processor to perform the method in any one of claims 9 to 11.

Citation Information

Patent Citations

  • Wireless audio system, and audio communication method and device

    CN113169915A

  • Method and equipment for enabling mobile terminal to interact with vehicle-mounted terminal

    CN115209380A