Vehicle machine media audio playing method, device, equipment and medium

Through thread management and audio stream processing technology on the vehicle terminal, the function of transmitting media audio from the vehicle terminal to the Bluetooth device is realized, solving the problem that vehicle machines in the existing technology are difficult to transmit audio to Bluetooth devices, and improving entertainment and Convenience.

CN119479711APending Publication Date: 2025-02-18BEI DOU ZHI LIAN KE JI YOU XIAN GONG SI +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411580703.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2025-02-18

Smart Images

  • Figure CN119479711A_ABST
    Figure CN119479711A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of vehicle machine control, and provides a vehicle machine media audio playing method, device, equipment and medium, which can start a first thread to mute a media stream and configure an invalid mark for the media stream when detecting that a Bluetooth device is connected to a vehicle machine end and a current audio strategy of the vehicle machine end receives a Bluetooth connection event. Therefore, the vehicle-mounted terminal is prevented from playing the media stream; starting a second thread to detect an invalid mark in real time, creating a new audio stream according to the media stream to obtain a target stream when the invalid mark is detected, querying a latest audio strategy by using the second thread, mounting the target stream to a corresponding playing thread in the latest audio strategy, and controlling the Bluetooth device to play the target stream by using the playing thread. Therefore, the media audio of the vehicle-mounted terminal can be played in a targeted manner through the Bluetooth device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of vehicle computer control technology, and in particular to a vehicle computer media audio playback method, device, equipment and medium. Background Art

[0002] In the prior art, the car computer usually acts as an a2dp sink to receive audio transmitted from the mobile phone through a2dp (Advanced Audio Distribution Profile, Bluetooth audio transmission model protocol), and rarely acts as an a2dp source to transmit audio to a Bluetooth speaker or Bluetooth headset.

[0003] Moreover, although the Android system supports using the car computer as an a2dp source, the Android system transmits all sounds to the Bluetooth speaker and does not differentiate the audio transmitted to the Bluetooth speaker or Bluetooth headset. Summary of the invention

[0004] In view of the above, it is necessary to provide a method, device, equipment and medium for playing media audio on a vehicle machine, which can play media audio on the vehicle machine end using a Bluetooth device.

[0005] A vehicle-mounted media audio playback method is applied to a vehicle-mounted terminal, and the vehicle-mounted media audio playback method includes:

[0006] When it is detected that a Bluetooth device is connected to the vehicle terminal and the current audio policy of the vehicle terminal receives a Bluetooth connection event, a first thread is started to mute the media stream and an invalid flag is configured for the media stream;

[0007] Starting a second thread to detect the invalid flag in real time, and creating a new audio stream according to the media stream when the invalid flag is detected, to obtain a target stream;

[0008] Utilize the second thread to query the latest audio strategy, and mount the target stream to the corresponding playback thread in the latest audio strategy;

[0009] The playing thread is used to control the Bluetooth device to play the target stream.

[0010] According to a preferred embodiment of the present invention, the first thread and the second thread are asynchronous threads, and the first thread and the second thread are executed in parallel.

[0011] According to a preferred embodiment of the present invention, using the playback thread to control the Bluetooth device to play the target stream includes:

[0012] The target stream is sent to the Bluetooth driver of the vehicle machine end through the audio hardware abstraction layer of the vehicle machine end to control the Bluetooth device to play the target stream.

[0013] According to a preferred embodiment of the present invention, the method further comprises:

[0014] During the playback of the target stream, detecting a volume adjustment instruction in real time;

[0015] When the volume adjustment instruction is detected, determining a target volume according to the volume adjustment instruction;

[0016] Obtaining a target adjustment coefficient corresponding to the target volume;

[0017] Calculating the product of the target adjustment coefficient and the reference audio amplitude of each frame of data in the audio hardware abstraction layer to obtain a target volume value;

[0018] The Bluetooth device is controlled to play the target stream at the target volume value.

[0019] According to a preferred embodiment of the present invention, the real-time detection of the volume adjustment instruction includes:

[0020] When a control signal for a volume adjustment virtual button is detected on the configuration interface of the vehicle terminal, or when it is detected that a vehicle adjustment physical button on the vehicle terminal is operated, it is determined that the volume adjustment instruction is received.

[0021] According to a preferred embodiment of the present invention, before obtaining the target adjustment coefficient corresponding to the target volume, the method further includes:

[0022] The reference audio amplitude is configured, and the adjustment coefficient corresponding to each volume is configured.

[0023] According to a preferred embodiment of the present invention, after using the playback thread to control the Bluetooth device to play the target stream, the method further includes:

[0024] When it is detected that the Bluetooth device is disconnected from the vehicle terminal, the target stream is paused and the current playback progress is recorded;

[0025] A confirmation prompt is sent to the designated terminal device according to the current playback progress to ask whether to continue playing the target stream.

[0026] A vehicle-mounted media audio playback device, which runs on a vehicle-mounted terminal, comprises:

[0027] A processing unit, configured to start a first thread to mute a media stream and configure an invalid flag for the media stream when it is detected that a Bluetooth device is connected to the vehicle terminal and a current audio policy of the vehicle terminal receives a Bluetooth connection event;

[0028] A creating unit, used for starting a second thread to detect the invalid flag in real time, and creating a new audio stream according to the media stream when the invalid flag is detected, to obtain a target stream;

[0029] A query unit, configured to query the latest audio policy using the second thread, and mount the target stream to a corresponding playback thread in the latest audio policy;

[0030] A control unit is used to control the Bluetooth device to play the target stream using the playback thread.

[0031] A computer device, comprising:

[0032] a memory storing at least one instruction; and

[0033] The processor executes the instructions stored in the memory to implement the vehicle-mounted media audio playback method.

[0034] A computer-readable storage medium stores at least one instruction, and the at least one instruction is executed by a processor in a computer device to implement the vehicle-mounted media audio playback method.

[0035] It can be seen from the above technical scheme that the present invention can start the first thread to mute the media stream and configure an invalid flag for the media stream to prevent the car computer from playing the media stream when it detects that a Bluetooth device is connected to the car computer and the current audio strategy of the car computer receives a Bluetooth connection event; start the second thread to detect the invalid flag in real time, and when the invalid flag is detected, create a new audio stream according to the media stream to obtain the target stream, use the second thread to query the latest audio strategy, and mount the target stream to the corresponding playback thread in the latest audio strategy, and use the playback thread to control the Bluetooth device to play the target stream, so that the media audio of the car computer can be played in a targeted manner by the Bluetooth device. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 It is a flow chart of a preferred embodiment of the vehicle media audio playback method of the present invention.

[0037] Figure 2 It is a functional module diagram of a preferred embodiment of the vehicle media audio playback device of the present invention.

[0038] Figure 3It is a structural schematic diagram of a computer device of a preferred embodiment of the vehicle-mounted media audio playback method of the present invention. DETAILED DESCRIPTION

[0039] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention is described in detail below with reference to the accompanying drawings and specific embodiments.

[0040] like Figure 1 FIG. 1 is a flow chart of a preferred embodiment of the vehicle media audio playback method of the present invention. According to different requirements, the order of the steps in the flow chart can be changed, and some steps can be omitted.

[0041] The vehicle-mounted media audio playback method is applied to one or more computer devices, wherein the computer device is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to a microprocessor, an application-specific integrated circuit (ASIC), a programmable gate array (FPGA), a digital signal processor (DSP), an embedded device, etc.

[0042] The computer device may be any electronic product that can perform human-computer interaction with a user, such as a personal computer, a tablet computer, a smart phone, a personal digital assistant (PDA), a game console, an interactive network television (IPTV), a smart wearable device, etc.

[0043] The computer device may also include a network device and / or a user device, wherein the network device includes, but is not limited to, a single network server, a server group consisting of multiple network servers, or a cloud consisting of a large number of hosts or network servers based on cloud computing.

[0044] The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), as well as big data and artificial intelligence platforms.

[0045] Among them, Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0046] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0047] The network where the computer device is located includes but is not limited to the Internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (VPN), etc.

[0048] S10, when it is detected that a Bluetooth device is connected to the vehicle terminal and the current audio policy AudioPolicy of the vehicle terminal receives a Bluetooth connection event, a first thread is started to mute the media stream and an invalid flag is configured for the media stream.

[0049] In this embodiment, the Bluetooth device may include, but is not limited to: a Bluetooth headset, a Bluetooth speaker, etc.

[0050] In this embodiment, the media stream may include, but is not limited to: music audio, audio novel audio, etc.

[0051] In this embodiment, the invalid flag can be configured by user, for example, the invalid flag can be configured as a special identifier such as "*".

[0052] This embodiment can prohibit the vehicle terminal from playing the media stream by muting the media stream, so that the speaker of the vehicle terminal only plays key sounds, navigation sounds, telephone calls and other audio.

[0053] S11, starting a second thread to detect the invalid flag in real time, and creating a new audio stream according to the media stream when the invalid flag is detected to obtain a target stream.

[0054] In this embodiment, the first thread and the second thread are asynchronous threads, and the first thread and the second thread are executed in parallel.

[0055] By executing two asynchronous threads in parallel, the waiting time is reduced, thereby reducing the waiting time of audio playback.

[0056] S12: Use the second thread to query the latest audio strategy, and mount the target stream to the corresponding playback thread playbackThread in the latest audio strategy.

[0057] In this embodiment, the playback thread playbackThread is used to process the audio playback task, so that the audio can be played through the Bluetooth device.

[0058] Through the above embodiments, the Bluetooth device can be specifically controlled to play the media stream on the vehicle side, and other audio streams are not processed.

[0059] S13, using the playback thread to control the Bluetooth device to play the target stream.

[0060] In this embodiment, using the playback thread to control the Bluetooth device to play the target stream includes:

[0061] The target stream is sent to the Bluetooth driver of the vehicle machine end through the audio hardware abstraction layer (Hardware Abstraction Layer) of the vehicle machine end to control the Bluetooth device to play the target stream.

[0062] Through the above embodiments, the media stream of the vehicle terminal can be played through the Bluetooth device. For example, when camping, the vehicle terminal media audio playback method of this embodiment can transmit the music of the vehicle terminal to the Bluetooth speaker for playback, thereby improving entertainment and convenience.

[0063] In this embodiment, the method further includes:

[0064] During the playback of the target stream, detecting a volume adjustment instruction in real time;

[0065] When the volume adjustment instruction is detected, determining a target volume according to the volume adjustment instruction;

[0066] Obtaining a target adjustment coefficient corresponding to the target volume;

[0067] Calculating the product of the target adjustment coefficient and the reference audio amplitude of each frame of data in the audio hardware abstraction layer to obtain a target volume value;

[0068] The Bluetooth device is controlled to play the target stream at the target volume value.

[0069] The real-time detection of the volume adjustment instruction includes:

[0070] When a control signal for a volume adjustment virtual button is detected on the configuration interface of the vehicle terminal, or when it is detected that a vehicle adjustment physical button on the vehicle terminal is operated, it is determined that the volume adjustment instruction is received.

[0071] Among them, the configuration interface is the user interaction interface of the vehicle terminal.

[0072] Before obtaining the target adjustment coefficient corresponding to the target volume, the method further includes:

[0073] The reference audio amplitude is configured, and the adjustment coefficient corresponding to each volume is configured.

[0074] For example: the media volume on the car side includes 40 levels, and the configured baseline audio amplitude is 40. When the highest volume of 40 is used to play audio, each frame of audio needs to be multiplied by the adjustment coefficient of 1.0, and the amplitude is not attenuated at this time; when the lowest volume of 0 is used to play audio, the amplitude of each frame of audio is 0. The human ear's perception of volume is not linear, but logarithmic, so the 40 volume levels need to be calculated logarithmically to obtain the coefficients that need to be multiplied. The unit of logarithmic form is dB, and the volume levels of 1-39 can correspond to coefficients greater than 0 and less than 1 respectively. The correspondence between each volume level and the adjustment coefficient can be recorded and stored in advance for direct call when adjusting the volume later.

[0075] Through the above embodiments, the audio playback volume in the Bluetooth device can be adjusted by adjusting the audio amplitude in the audio hardware abstraction layer of the vehicle terminal.

[0076] In this embodiment, after using the playback thread to control the Bluetooth device to play the target stream, the method further includes:

[0077] When it is detected that the Bluetooth device is disconnected from the vehicle terminal, the target stream is paused and the current playback progress is recorded;

[0078] A confirmation prompt is sent to the designated terminal device according to the current playback progress to ask whether to continue playing the target stream.

[0079] The designated terminal device may be a terminal device of a driver or the like.

[0080] Through the above embodiment, the playback can be paused when the Bluetooth is suddenly disconnected, and relevant personnel can be promptly prompted to confirm whether to continue the playback, so as to improve the user experience.

[0081] This embodiment can transmit the music on the vehicle side to a Bluetooth device such as a Bluetooth speaker or a Bluetooth headset via Bluetooth for playback, and the playback volume can be uniformly controlled by the vehicle side.

[0082] It can be seen from the above technical scheme that the present invention can start the first thread to mute the media stream and configure an invalid flag for the media stream to prevent the car computer from playing the media stream when it detects that a Bluetooth device is connected to the car computer and the current audio strategy of the car computer receives a Bluetooth connection event; start the second thread to detect the invalid flag in real time, and when the invalid flag is detected, create a new audio stream according to the media stream to obtain the target stream, use the second thread to query the latest audio strategy, and mount the target stream to the corresponding playback thread in the latest audio strategy, and use the playback thread to control the Bluetooth device to play the target stream, so that the media audio of the car computer can be played in a targeted manner by the Bluetooth device.

[0083] like Figure 2 The figure shows a functional module diagram of a preferred embodiment of the vehicle-mounted media audio playback device of the present invention. The vehicle-mounted media audio playback device 11 runs on the vehicle-mounted end, and includes a processing unit 110, a creation unit 111, a query unit 112, and a control unit 113. The module / unit referred to in the present invention refers to a series of computer program segments that can be executed by a processor and can complete fixed functions, which are stored in a memory. In this embodiment, the functions of each module / unit will be described in detail in subsequent embodiments.

[0084] The processing unit 110 is configured to start a first thread to mute the media stream and configure an invalid flag for the media stream when it is detected that a Bluetooth device is connected to the vehicle terminal and the current audio policy of the vehicle terminal receives a Bluetooth connection event;

[0085] The creation unit 111 is used to start the second thread to detect the invalid flag in real time, and to create a new audio stream according to the media stream when the invalid flag is detected to obtain a target stream;

[0086] The query unit 112 is used to query the latest audio policy using the second thread, and mount the target stream to the corresponding playback thread in the latest audio policy;

[0087] The control unit 113 is used to control the Bluetooth device to play the target stream by using the play thread.

[0088] It can be seen from the above technical scheme that the present invention can start the first thread to mute the media stream and configure an invalid flag for the media stream to prevent the car computer from playing the media stream when it detects that a Bluetooth device is connected to the car computer and the current audio strategy of the car computer receives a Bluetooth connection event; start the second thread to detect the invalid flag in real time, and when the invalid flag is detected, create a new audio stream according to the media stream to obtain the target stream, use the second thread to query the latest audio strategy, and mount the target stream to the corresponding playback thread in the latest audio strategy, and use the playback thread to control the Bluetooth device to play the target stream, so that the media audio of the car computer can be played in a targeted manner by the Bluetooth device.

[0089] like Figure 3 , which is a schematic diagram of the structure of a computer device of a preferred embodiment of the vehicle-mounted media audio playback method of the present invention.

[0090] The computer device 1 may include a memory 12 , a processor 13 , and a bus, and may also include a computer program stored in the memory 12 and executable on the processor 13 , such as a vehicle-mounted media audio playback program.

[0091] Those skilled in the art will appreciate that the schematic diagram is merely an example of the computer device 1 and does not constitute a limitation on the computer device 1. The computer device 1 may be a bus-type structure or a star-type structure. The computer device 1 may also include more or less other hardware or software than shown in the diagram, or a different arrangement of components. For example, the computer device 1 may also include input and output devices, network access devices, etc.

[0092] It should be noted that the computer device 1 is only an example, and other existing or future electronic products that are suitable for the present invention should also be included in the protection scope of the present invention and included here by reference.

[0093] Among them, the memory 12 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 12 can be an internal storage unit of the computer device 1, such as a mobile hard disk of the computer device 1. In other embodiments, the memory 12 can also be an external storage device of the computer device 1, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the computer device 1. Further, the memory 12 can also include both an internal storage unit of the computer device 1 and an external storage device. The memory 12 can not only be used to store application software and various types of data installed in the computer device 1, such as the code of the car media audio playback program, etc., but also can be used to temporarily store data that has been output or is to be output.

[0094] In some embodiments, the processor 13 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 13 is the control core (Control Unit) of the computer device 1, and uses various interfaces and lines to connect the various components of the entire computer device 1, and executes or executes programs or modules stored in the memory 12 (for example, executing a car media audio playback program, etc.), and calls data stored in the memory 12 to execute various functions of the computer device 1 and process data.

[0095] The processor 13 executes the operating system of the computer device 1 and various installed applications. The processor 13 executes the applications to implement the steps in the above-mentioned embodiments of the vehicle-mounted media audio playback method, for example Figure 1 Steps shown.

[0096] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory 12 and executed by the processor 13 to implement the present invention. The one or more modules / units may be a series of computer-readable instruction segments capable of implementing specific functions, which are used to describe the execution process of the computer program in the computer device 1. For example, the computer program may be divided into a processing unit 110, a creation unit 111, a query unit 112, and a control unit 113.

[0097] The above-mentioned integrated unit implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, and includes a number of instructions for enabling a computer device (which can be a personal computer, a computer device, or a network device, etc.) or a processor to execute the part of the vehicle-mounted media audio playback method described in each embodiment of the present invention.

[0098] If the module / unit integrated in the computer device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware devices through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of each of the above-mentioned method embodiments can be implemented.

[0099] The computer program includes computer program code, which may be in source code form, object code form, executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory, etc.

[0100] Furthermore, the computer-readable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the blockchain node, etc.

[0101] The blockchain referred to in the present invention is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the blockchain underlying platform, platform product service layer, and application service layer.

[0102] The bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 The bus is represented by only one straight line, but it does not mean that there is only one bus or one type of bus. The bus is configured to realize the connection and communication between the memory 12 and at least one processor 13, etc.

[0103] Although not shown, the computer device 1 may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 13 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include any components such as one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, etc. The computer device 1 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.

[0104] Furthermore, the computer device 1 may also include a network interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used to establish a communication connection between the computer device 1 and other computer devices.

[0105] Optionally, the computer device 1 may further include a user interface, which may be a display, an input unit (such as a keyboard), or a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touch device. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the computer device 1 and to display a visual user interface.

[0106] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.

[0107] It can be understood by those skilled in the art that Figure 3The structure shown does not constitute a limitation on the computer device 1, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0108] Combination Figure 1 The memory 12 in the computer device 1 stores a plurality of instructions to implement a vehicle-mounted media audio playback method, and the processor 13 can execute the plurality of instructions to implement:

[0109] When it is detected that a Bluetooth device is connected to the vehicle terminal and the current audio policy of the vehicle terminal receives a Bluetooth connection event, a first thread is started to mute the media stream and an invalid flag is configured for the media stream;

[0110] Starting a second thread to detect the invalid flag in real time, and creating a new audio stream according to the media stream when the invalid flag is detected, to obtain a target stream;

[0111] Utilize the second thread to query the latest audio strategy, and mount the target stream to the corresponding playback thread in the latest audio strategy;

[0112] The playing thread is used to control the Bluetooth device to play the target stream.

[0113] Specifically, the specific implementation method of the processor 13 for the above instructions can refer to Figure 1 The description of the relevant steps in the corresponding embodiments will not be repeated here.

[0114] It should be noted that the data involved in this case were all obtained legally.

[0115] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0116] The present invention can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present invention can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present invention can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0117] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0118] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0119] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0120] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.

[0121] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the present invention can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.

[0122] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims

1. A method for playing audio media in a vehicle, characterized in that: Applied to the vehicle terminal, the vehicle terminal media audio playback method includes: When it is detected that a Bluetooth device is connected to the vehicle terminal, and the current audio policy of the vehicle terminal receives a Bluetooth connection event, a first thread is started to mute the media stream, and an invalid flag is configured for the media stream; Starting a second thread to detect the invalid flag in real time, and creating a new audio stream according to the media stream when the invalid flag is detected, to obtain a target stream; Utilize the second thread to query the latest audio strategy, and mount the target stream to the corresponding playback thread in the latest audio strategy; The playing thread is used to control the Bluetooth device to play the target stream.

2. The vehicle-mounted media audio playback method according to claim 1, characterized in that: The first thread and the second thread are asynchronous threads, and the first thread and the second thread are executed in parallel.

3. The vehicle-mounted media audio playback method according to claim 1, characterized in that: The using the playback thread to control the Bluetooth device to play the target stream includes: The target stream is sent to the Bluetooth driver of the vehicle machine end through the audio hardware abstraction layer of the vehicle machine end to control the Bluetooth device to play the target stream.

4. The vehicle-mounted media audio playback method according to claim 3, characterized in that: The method further comprises: During the playback of the target stream, detecting a volume adjustment instruction in real time; When the volume adjustment instruction is detected, determining a target volume according to the volume adjustment instruction; Obtaining a target adjustment coefficient corresponding to the target volume; Calculating the product of the target adjustment coefficient and the reference audio amplitude of each frame of data in the audio hardware abstraction layer to obtain a target volume value; The Bluetooth device is controlled to play the target stream at the target volume value.

5. The vehicle-mounted media audio playback method according to claim 4, characterized in that: The real-time detection of volume adjustment instructions includes: When a control signal for a volume adjustment virtual button is detected on the configuration interface of the vehicle terminal, or when it is detected that a vehicle adjustment physical button on the vehicle terminal is operated, it is determined that the volume adjustment instruction is received.

6. The vehicle-mounted media audio playback method according to claim 4, characterized in that: Before obtaining the target adjustment coefficient corresponding to the target volume, the method further includes: The reference audio amplitude is configured, and the adjustment coefficient corresponding to each volume is configured.

7. The vehicle-mounted media audio playback method according to claim 1, characterized in that: After using the playback thread to control the Bluetooth device to play the target stream, the method further includes: When it is detected that the Bluetooth device is disconnected from the vehicle terminal, the target stream is paused and the current playback progress is recorded; A confirmation prompt is sent to the designated terminal device according to the current playback progress to ask whether to continue playing the target stream.

8. A vehicle-mounted media audio playback device, characterized in that: Running on the vehicle side, the vehicle media audio playback device includes: A processing unit, configured to start a first thread to mute a media stream and configure an invalid flag for the media stream when it is detected that a Bluetooth device is connected to the vehicle terminal and a current audio policy of the vehicle terminal receives a Bluetooth connection event; A creating unit, used for starting a second thread to detect the invalid flag in real time, and creating a new audio stream according to the media stream when the invalid flag is detected, to obtain a target stream; A query unit, configured to query the latest audio policy using the second thread, and mount the target stream to a corresponding playback thread in the latest audio policy; A control unit is used to control the Bluetooth device to play the target stream using the playback thread.

9. A computer device, characterized in that: The computer device comprises: a memory storing at least one instruction; and A processor executes instructions stored in the memory to implement the vehicle-mounted media audio playback method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction, and the at least one instruction is executed by a processor in a computer device to implement the vehicle-mounted media audio playback method as described in any one of claims 1 to 7.