A method and terminal device for global exclusive audio playback
By setting the direct-through identifier and the coordinated work of the management module, the problem of the inability to release the audio playback hardware is solved, and orderly management and lossless audio output are realized for multiple applications to play simultaneously.
Patent Information
- Application Number
- CN202211681791.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-21
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2042-12-21
AI Technical Summary
The prior art cannot realize the problem that multiple audio playback applications can play sound normally at the same time, and the audio playback hardware cannot be used to release it, resulting in failure or no sound for other applications to play.
Through the technical solution of setting the pass-through identifier, the management module occupies hardware during application use, releases hardware during use, and realizes audio output through the pass-through playback channel, ensuring orderly management and lossless playback of audio output when multiple applications play at the same time.
It realizes that multiple audio applications play sound normally at the same time, avoiding the failure or soundless problem caused by hardware occupation, and ensuring the lossless effect of audio playback.
Smart Images

Figure CN115862688B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of audio playback, and in particular to a method for global exclusive audio playback and a terminal device for playing audio using the method. Background Art
[0002] Android is an open source system. It was originally designed for robot projects, and later mobile phone projects were added. Whether it was the initial robots or the later mobile phones, there were not many requirements for the audio playback quality. However, because Android is open source, in addition to mobile phones, more and more media playback devices have begun to use Android, including high-quality audio playback devices. At the same time, many high-quality audio playback applications have also been produced. These devices and applications have put forward higher requirements for Android's high-quality audio playback.
[0003] Anyone who knows about the Android audio system knows that SRC is an unavoidable topic for Android audio playback. SRC stands for Sample Rate Converter, which means sampling frequency conversion in Chinese. SRC is designed by the Android audio playback system to solve the problem of playing audio output data with different sampling rates on the same audio playback hardware. It converts the audio data to be output into a 48KHZ sampling rate, 16-bit PCM data format, and mixes them so that different audio playback applications can output sound at the same time. However, due to the conversion of sampling rate, data format, and bit depth, the sound quality will be lost. If an audio is recorded at a sampling rate of 44.1KHZ, it will not produce the original effect when played back on Android.
[0004] Unfortunately, the Android SDK does not provide an interface for upper-level applications to bypass SRC. There is no guarantee that upper-level applications can output their audio data to the audio playback hardware in the desired format, sampling rate, number of channels, etc.
[0005] The main methods to bypass Android SRC are as follows:
[0006] 1. Audio playback device manufacturers have complete Android system source code. They develop their own audio playback applications, directly call the Android underlying AudioTrack interface in the audio output part, pass in the pass-through flag, and let AudioFlinger use the pass-through playback channel. In this way, the output data of the device developer's audio playback application can be transmitted to the audio playback hardware without passing through Android SRC. This method is only applicable to audio playback device manufacturers. For third-party audio playback application developers who do not have the device Android source code, this method does not work.
[0007] 2. Audio playback device manufacturers have complete Android system source code. They develop audio playback applications by themselves. Unlike the first method, their audio applications directly operate the audio hardware, that is, directly use the tinyalsa interface to output audio, without going through the Android audio playback framework, and can also achieve the purpose of audio direct playback. Similarly, third-party audio playback application developers cannot achieve audio direct playback through this method.
[0008] 3. Third-party audio playback application developers can use libusb to directly operate USBDAC through Android's USB exclusive mode, so that their audio output data can be directly transmitted to USB DAC hardware to achieve the purpose of audio direct playback. This method requires developers to have a deep understanding of UAC (USB Audio Class) and be very familiar with the use of 1ibusb interfaces before using this method. Therefore, this method has a high technical threshold, and most third-party audio application developers will not use this method. Moreover, this method can only be used for USB audio playback devices, and is not applicable to other audio playback devices.
[0009] In addition to the lack of versatility, the above three methods all have a common disadvantage, that is, after using each method, the audio playback application using the method will occupy the audio playback hardware, and other audio playback applications will not be able to output sound through the audio playback hardware. After the user uses the audio playback application of the device manufacturer or the audio playback application using the USB exclusive mode to play audio, and then uses other audio playback applications to play audio, the playback will fail or there will be no sound, which will cause confusion to the user and affect the user experience.
[0010] In summary, the disadvantage of the above three methods is that after the audio playback application occupies the audio playback hardware, the hardware is no longer released, and other audio playback software cannot use the hardware, causing the sound playback to stop. Summary of the invention
[0011] The main technical problem solved by the present invention is to provide an audio global exclusive playback method and device. By adopting the technical solution of setting a through-mark, the current application occupies the playback hardware when in use and releases the hardware when not in use, and the audio playback directly goes through the through-playback channel, thereby improving the sound quality of the audio playback to achieve the purpose of lossless playback, and there will be no sound stopping when multiple audio playback applications are used at the same time.
[0012] In the first aspect, an embodiment of the present application provides a method for global exclusive audio playback, including: when a terminal device is playing audio through a current application, a first management module receives a playback request sent by the first application, the first management module is used for audio channel management, the first management module sets a through-flag for the first application, and the first management module sends a through-play request to the second management module; the second management module is used for through-play management, and the second management module sends a stop notification to the third management module after receiving the through-play request; the third management module is used for application management, the third management module receives the stop notification to close the current application, and the second management module closes the through-play channel of the current application; the second management module releases the audio playback hardware, the second management module obtains the through-flag of the first application, and the first application uses the audio playback hardware to play sound through the second management module.
[0013] Optionally, the current application includes third-party audio playback applications and self-built audio playback applications. Third-party audio applications refer to audio playback applications developed using the Android SDK and using the AudioTrack or MediaPlayer Java interface. Self-built audio playback applications refer to self-built audio playback applications that use the Android source code AudioTrack C++ interface.
[0014] The first management module, the second management module, and the third management module are all modules in the application framework layer. For example, the first management module may be an audio mixing management module such as AudioFlinger, the second management module may be an audio output policy management module such as AudioPolicy, and the third management module may be an APP management module.
[0015] The method provided in this aspect realizes orderly management of audio output when multiple audio application software are used at the same time. Each audio application software can play sound normally when in use. The stop management of the application by the third module avoids the situation that the audio playback hardware is occupied by a certain audio application software for a long time and cannot be used, resulting in unsuccessful playback or no sound. At the same time, the first management module sets a direct-through flag for the first application, so that the first application can play audio through the direct-through channel, thereby realizing truly lossless audio playback.
[0016] In combination with the first aspect, in a possible implementation method of the first aspect, the first management module also includes checking the channel identifier of the first application. When the channel identifier of the first application is set to other output identifiers, the output identifier is deleted, and a pass-through identifier is set for the first application; when the channel identifier of the first application is set to the pass-through identifier, no deletion processing is performed.
[0017] In this implementation, when the second management module receives a new play request, the first management module sets a direct-through flag for the first application that sends the request, and the first management module sends a direct-through play request to the second management module. Specifically, when the first management module establishes a play channel through the AudioTrack interface, it checks the incoming request parameters and modifies them as needed. For example, the AUDIO_OUTPUT_FLAG_DEEP_BUFFER output flag is set in the parameters passed in by the third-party audio playback application, and this output flag will force the use of the mixing channel in the Android audio system, so the first management module needs to clear it. At the same time, the first management module sets the AUDIO_OUTPUT_FLAG_DIRECT output flag, that is, the direct-through flag, for the first application, thereby indicating to the Android audio system that a direct-through play channel is to be used. If the self-built audio playback application has passed in the direct-through flag, it no longer needs to be set. The above settings can effectively manage the application that issues the play request, avoiding the problem that the audio played by the application goes through the mixing channel and reduces the sound quality.
[0018] In combination with the first aspect, in another possible implementation of the first aspect, the second management module records the ID information of each application requested to be played when receiving a direct playback request. When the first application requests direct playback, the second management module sends the ID information of the current application to the third management module, and the third management module stops the current application based on the ID information.
[0019] In this implementation, the third management module closes the current application according to the stop notification sent by the second management module, and the second management module closes the direct playback channel of the current application. Specifically, the second management module records the pid, uid, package name and other information of each application requesting playback, and when the first application requests direct playback, the information of the current application is sent to the third management module to request the stop of the current application. After the second management module obtains the feedback information sent by the third management module that the previous application has stopped, the second management module closes the direct playback channel used by the current application, thereby releasing the audio playback hardware and establishing a direct playback channel for the direct playback request of the first application.
[0020] In combination with the first aspect, in another possible implementation of the first aspect, the third management module receives the ID information of the current application sent by the second management module, and stops the current application through the forceStopPackage interface of the Android ActivityManager.
[0021] In this implementation, the third management module closes the current application according to the request. Specifically, according to the playback request, the pid, uid, package name and other information of the current application recorded by the second management module, the forceStopPackage interface of Android ActivityManager is used to pass in the currently referenced package name parameter to completely stop the current application. This can prevent the AudioTrack of the current application from trying to rebuild the playback channel and falling into a cycle of grabbing the direct playback channel between applications.
[0022] In this implementation, the first application obtains the direct playback channel to play audio. Only the first application is playing audio. The direct playback channel and the audio playback hardware are both in an available state. The audio output data played by the first application can be transmitted to the audio playback hardware intact to achieve lossless playback.
[0023] In combination with the first aspect, in another possible implementation of the first aspect, the abstract layer of the audio playback hardware adds the audio output format of AUDIO_FORMAT_PCM_FLOAT. The audio playback hardware cannot directly support the floating-point data format, and the audio playback hardware DAC only supports the shaped PCM and DSD data formats, so most DAC drivers and their hardware abstraction layers do not receive floating-point data formats, and the floating-point data needs to be converted to shaped data before reaching the driver and the hardware abstraction layer. In the Android system, audio data needs to be converted through SRC, so in this implementation, the conversion is placed in the hardware abstraction layer, avoiding the loss of sound quality caused by the conversion of the audio data through SRC (sampling frequency converter) due to the conversion of the middle layer.
[0024] In this implementation, the abstract layer of the audio playback hardware adds audio formats supported by the direct playback application layer to achieve a completely direct playback path. In the specific implementation, in addition to adding support for AUDIO_FORMAT_PCM_16_BIT, which is generally supported by upper-layer applications, it also implements support for direct playback of a variety of widely used audio output formats based on the support of audio playback hardware: AUDIO_FORMAT_PCM_32_BIT, AUDIO_FORMAT_PCM_8_24_BIT, AUDIO_FORMAT_PCM_24BIT_PACKED, AUDIO_FORMAT_DSD. Self-built audio playback applications can have more output format options, and add support for MQA music and DOP (DSD Over PCM) transmission.
[0025] In combination with the first aspect, in another possible implementation of the first aspect, the direct flag is an AUDIO_OUTPUT_FLAG_DIRECT output flag, which forces the audio channel to be a direct channel, thereby ensuring that the audio can be broadcast with lossless sound quality through the direct channel.
[0026] In a second aspect, the present application also provides a terminal device, comprising: at least one processor and a memory, wherein the memory is used to store computer program instructions and / or data; and the at least one processor is used to execute the instructions to implement the methods in the various implementation modes of the aforementioned first aspect.
[0027] Optionally, the terminal device further includes an interface circuit, and the interface circuit is used to obtain computer program instructions and / or data in the memory.
[0028] Optionally, the at least one processor, the memory and the interface circuit may be integrated into a processing chip or a chip circuit.
[0029] Optionally, the terminal device includes but is not limited to a mobile phone, a PC, a tablet computer, and a phone watch.
[0030] In a third aspect, the present application also provides a computer-readable storage medium having instructions stored therein, so that when the instructions are executed on a computer or a processor, the medium can be used to execute the methods in the aforementioned first aspect and various implementations of the first aspect, and the methods in various implementations of the aforementioned second aspect.
[0031] In addition, the present application also provides a computer program product, which includes computer instructions. When the instructions are executed by a computer or a processor, it can implement the methods in the aforementioned first aspect and various implementations of the first aspect, the aforementioned second aspect and various implementations of the second aspect, and the aforementioned third aspect and various implementations of the third aspect.
[0032] It should be noted that the beneficial effects corresponding to the technical solutions of the various implementation methods of the second to third aspects are the same as the beneficial effects of the aforementioned first aspect and the various implementation methods of the first aspect. Please refer to the description of the beneficial effects in the aforementioned first aspect and the various implementation methods of the first aspect for details, and no further details will be given. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 is a schematic diagram of the overall structure of an embodiment of the present invention;
[0034] Figure 2 is a method flow chart of an embodiment of the present invention;
[0035] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0036] In order to further illustrate the technical solution content of the present invention, the following is described in conjunction with the accompanying drawings. At the same time, it should be noted that the technical solution content and technical features of the present invention can be used in combination with each other without conflict.
[0037] The technical terms involved in the present invention are explained as follows:
[0038] In the present invention, the terms “first” and “second” have no order of precedence and are not used to indicate specific positions. They are only used for distinction.
[0039] The playback method involved in this application can be applied to the audio playback of mobile devices, based on the exclusive playback of Android audio applications. It mainly includes a first management module, that is, an audio channel management module for audio channel management; a second management module, that is, a direct playback management module for direct playback management; and a third management module, that is, an application management module for application management.
[0040] like Figure 1 As shown, this embodiment provides an audio playback method, including:
[0041] 101: When the terminal device is playing audio through the current application, the first management module receives a play request sent by the first application, the first management module is used for audio channel management, the first management module sets a direct flag for the first application, and the first management module sends a direct play request to the second management module.
[0042] 102: The second management module is used for direct play management. After receiving a direct play request, the second management module sends a stop notification to the third management module.
[0043] 103: The third management module is used for application management. The third management module receives the stop notification and closes the current application. The second management module closes the direct playback channel of the current application.
[0044] 104: The second management module releases the audio playback hardware, the second management module obtains the direct identification of the first application, and the first application uses the audio playback hardware to play sound through the second management module.
[0045] like Figure 1 The step 101 shown also includes the following steps:
[0046] 10101: The first management module checks the channel identifier of the first application, where the through identifier includes the channel identifier of the first application checked by the first management module. When the channel identifier of the first application is set to another output identifier, the output identifier is deleted, and a through identifier is set for the first application.
[0047] 10102: When the channel ID of the first application is set to the through ID, no deletion is performed.
[0048] Furthermore, the first management module records the channel identifier of the first application and determines whether the channel identifier is a pass-through identifier. If so, a correspondence between the first application and the pass-through channel is established. Otherwise, the non-pass-through identifier of the first application is first deleted. After the pass-through identifier is established for the first application, a correspondence between the first application and the pass-through channel is established, so that the first application can be forced to play audio through the pass-through channel.
[0049] Among them, the first application has a music playback function, such as music, Music APP, Music and other audio playback apps.
[0050] Specifically, when the second management module receives a direct playback request, it records the ID information of each application requested to be played. When the first application requests direct playback, the second management module sends the ID information of the current application to the third management module, and the third management module stops the current application according to the ID information.
[0051] The third management module receives the ID information of the current application sent by the second management module, and stops the current application through the forceStopPackage interface of Android ActivityManager.
[0052] In the abstract layer of audio playback hardware, add the audio format supported by the application layer for direct playback. Specifically, the abstract layer of audio playback hardware adds
[0053] The audio output format of AUDIO_FORMAT_PCM_FLOAT is added, and a variety of widely used audio output formats are added, such as AUDIO_FORMAT_PCM_32_BIT, AUDIO_FORMAT_PCM_8_24_BIT,
[0054] AUDIO_FORMAT_PCM_24_BIT_PACKED and AUDIO_FORMAT_DSD improve the compatibility and adaptability of the method and play a complementary role.
[0055] AudioTrack Native API output flag: AUDIO_OUTPUT_FLAG_DIRECT indicates that the audio stream is directly output to the audio device without the need for software mixing. It is generally used for sound output of HDMI devices. The pass-through flag is set to AUDIO_OUTPUT_FLAG_DIRECT output flag to improve the sound quality of the audio playback application output.
[0056] In a second aspect, a terminal device includes: at least one processor and a memory, the memory being used to store computer program instructions; and at least one processor being used to execute the instructions to implement the described method.
[0057] In a third aspect, a computer-readable storage medium stores computer program instructions; when the computer program instructions are executed, the method described is implemented.
[0058] The method provided in this embodiment can ensure that when multiple audio playback applications are running on the terminal device, only one application is playing audio at the same time. The first management module sets a through flag for the first application waiting to be opened, closes the current application that is running through the third management module, and closes the through playback channel of the current application through the second management module, so that the first application can play audio through the through channel, and ensures that the current application can be closed and does not occupy the through channel. In addition, the abstract layer of the audio playback hardware is optimized so that it can realize the direct playback function of all formats supported by the last application, further ensuring that the through playback channel is completely opened. Therefore, the significance of global exclusive audio playback is that all audio playback applications used can directly transmit to the audio playback hardware in the audio format they output, so that the audio data can be transmitted in its original form, achieving true lossless playback.
[0059] In one embodiment, exclusive playback management of all Android audio applications is implemented, wherein the current application and the first application are examples of audio playback software that are opened successively, the current application is the application being used, the first application is the application that is opened and used next, and the opening of the applications is queued in chronological order, and it does not specifically mean that there are only two types, and there can be multiple applications.
[0060] Specifically, the playback method includes:
[0061] Reference Figure 2 On the terminal device, the second management module sends the ID information of the current application to the third management module to request to stop the current application. At the same time, the second management module closes the direct playback channel occupied by the current application, and the third management module closes the current application according to the request. After receiving the playback request of the first application, the first management module sets the direct identification and requests the direct playback channel from the second management module. In addition, the abstract layer of the audio playback hardware adds the audio format supported by the direct playback application layer to realize a completely direct playback path.
[0062] 1. The first management module (audio playback channel management), after receiving the playback request from the first application, sets the direct identification, and sends a direct request to the second management module (direct playback management) to apply for a direct playback channel. After receiving the direct playback request from the first application, the second management module (direct playback management) notifies the third management module (App management) to stop the current application. At the same time, the second management module (direct playback management) closes the current direct playback channel and releases the audio playback hardware for the first application to use. After the third management module (App management) obtains the ID information of the current application, it stops the current application to ensure that only one application is playing audio at the same time. The abstract layer of the audio playback hardware implements the direct playback function of all formats supported by the upper-layer applications, so that the direct playback channel is completely opened, and each audio application can achieve true lossless playback.
[0063] 2. After the audio playback request of the first application is sent to the first management module (audio playback channel management), a pass-through flag is set to make it clear that the required channel needs to be passed through, and it is hoped that the audio data in the channel will not be modified during the transmission process, such as format conversion, resampling, downmix, etc.
[0064] 3. The first application can monopolize the direct playback channel. The current application must stop playing audio to prevent the current application from applying for playback again and snatching the direct playback channel of the first application. At the same time, the direct playback channel occupied by the current application must be closed to release the audio playback hardware to the first application.
[0065] Fourth, after receiving a new direct playback request, the first management module (audio playback channel management) notifies the third management module (App management) to stop the current application. The first management module (audio playback channel management) records the pid, uid, package name and other information of each requested application. When a new application requests direct playback, the information of the current direct playback application is sent to the third management module (App management). The third management module (App management) stops the current application based on this information.
[0066] After the third management module (App management) obtains the information of the current application, it stops the current application to ensure that only one application is playing audio at the same time. In the Android AduioTrack implementation, after the current application loses the audio playback channel, the current application will try to rebuild the playback channel. Therefore, if the third management module (App management) does not stop the current application, the AudioTrack of the current application will try to rebuild the playback channel, and the request will reach the purpose of through-play management through the first management module (audio playback channel management). The through-play channel of the current application is snatched away, and then the AudioTrack of the current application will try to rebuild the playback channel again, which will cause the two applications to fall into a cycle of constantly grabbing the through-play channel, so it is necessary for the second management module to close the through-play channel of the current application.
[0067] Fifth, after receiving a new direct play request, the first management module (audio play channel management) closes the direct play channel occupied by the current application. Closing the direct play channel occupied by the current application can immediately release the audio play hardware, allowing the current application to start playing quickly, thereby improving the user experience.
[0068] Sixth, the abstract layer of the audio playback hardware directly supports the playback of the format decoded and output by the upper-layer application. If the hardware abstract layer does not support the format decoded and output by the upper-layer application, the pass-through channel cannot be used on the Android system, and the audio data may be resampled or downmixed, and the sound quality cannot be guaranteed.
[0069] The audio playback hardware abstraction layer implements the direct playback function of all formats supported by upper-layer applications, making the direct playback channel completely open. Android declares the audio output formats supported by the Android system in AudioFormat.java, which do not require additional codec or dsp support. These formats are ENCODING_PCM_16BIT, ENCODING_PCM_8BIT, and ENCODING_PCM_FLOAT. Among them, ENCODING_PCM_8BIT is rarely used and can be ignored. ENCODING_PCM_16BIT and ENCODING_PCM_FLOAT are the most widely used. Most audio playback applications will use these two formats as audio output formats.
[0070] Android's audio hardware abstraction layer implements support for direct playback of the ENCODING_PCM_16BIT format, but does not implement support for direct playback of the ENCODING_PCM_FLOAT format.
[0071] For example, if an audio playback application uses ENCODING_PCM_FLOAT as the audio output format, it cannot use Android's direct playback channel, but uses Android's mixing channel. Android's SRC will act on the audio data, resulting in a loss of sound quality.
[0072] The present invention adds support for direct playback of AUDIO_FORMAT_PCM_FLOAT in the audio playback hardware abstraction layer, thereby solving the above problem.
[0073] In addition, the present invention adds support for direct playback of multiple widely used audio output formats in the audio playback hardware abstraction layer according to the support of the audio playback hardware:
[0074] AUDIO_FORMAT_PCM_32_BIT, AUDIO_FORMAT_PCM_8_24_BIT,
[0075] AUDIO_FORMAT_PCM_24_BIT_PACKED, AUDIO_FORMAT_DSD. The self-built audio playback application in the device described in the second aspect of the present invention can use these formats as output formats to achieve fully bit-perfect output. While achieving better sound quality, it also supports the transmission of MQA music and DOP (DSD Over PCM).
[0076] When the channel flag of the first application is set to the AUDIO_OUTPUT_FLAG_DEEP_BUFFER output flag, delete the output flag.
[0077] And at the same time, set the AUDIO_OUTPUT_FLAG_DIRECT output flag for the first application;
[0078] In summary, the present invention sets a direct-through flag for each audio playback application that requests playback through the first management module, sends the ID information of the current application to the third management module through the second management module, stops the current application through the third management module, and at the same time, the second management module closes the direct-through playback channel of the current application, releases the audio playback hardware, and gives it to the first application. At the same time, direct playback support for multiple audio formats is added to the audio playback hardware abstraction layer to form a complete direct-through path. In this way, all audio playback applications can be directly transmitted to the audio playback hardware in the audio format they output, so that authentic playback can be achieved, achieving true lossless playback.
[0079] The above are only implementation modes of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for global exclusive audio playback, characterized in that: include: When the terminal device is playing audio through the current application, the first management module receives a play request sent by the first application, the first management module is used for audio channel management, the first management module sets a direct identification for the first application, and the first management module sends a direct play request to the second management module; The second management module is used for direct play management, and after receiving the direct play request, the second management module sends a stop notification to the third management module; The third management module is used for application management. The third management module receives a stop notification to close the current application, and the second management module closes the direct playback channel of the current application. The second management module releases the audio playback hardware, the second management module obtains the direct identification of the first application, and the first application uses the audio playback hardware to play sound through the second management module.
2. The method for global exclusive audio playback according to claim 1, characterized in that: The setting of the direct identification includes the first management module checking the channel identification of the first application: When the channel identifier of the first application is set to another output identifier, the output identifier is deleted, and a through identifier is set for the first application; When the channel identifier of the first application is set to the through identifier, no deletion processing is performed.
3. The method for global exclusive audio playback according to claim 1, characterized in that: When the second management module receives a direct playback request, it records the ID information of each application requested to be played. When the first application requests direct playback, the second management module sends the ID information of the current application to the third management module, and the third management module stops the current application according to the ID information.
4. The method for global exclusive audio playback according to claim 3, characterized in that: The third management module receives the ID information of the current application sent by the second management module, and stops the current application through the forceStopPackage interface of Android ActivityManager.
5. The method for global exclusive audio playback according to claim 1, characterized in that: Add audio formats supported by the direct playback application layer to the abstract layer of the audio playback hardware.
6. The method for global exclusive audio playback according to claim 1, characterized in that: The abstract layer of audio playback hardware adds the audio output format AUDIO_FORMAT_PCM_FLOAT.
7. The method for global exclusive audio playback according to claim 2, characterized in that: The direct flag is the AUDIO_OUTPUT_FLAG_DIRECT output flag.
8. A terminal device, characterized in that: include: at least one processor and a memory, the memory being configured to store computer program instructions; The at least one processor is configured to execute the instructions to implement the method according to any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that: The computer readable storage medium stores computer program instructions; When the computer program instructions are executed, the method according to any one of claims 1 to 7 is implemented.
