Audio data playing method and electronic device
By combining with third-party applications, the spatial audio technology of electronic devices and channel-encoded audio resources of third-party applications are used to generate spatial audio data with better results, solving the problem of the lack of channel-encoded audio resources of existing electronic devices, and achieving the effect of improving music playback quality and bringing users an immersive spatial audio experience.
Patent Information
- Application Number
- CN202410611231.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-26
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2043-12-26
AI Technical Summary
Existing electronic devices lack channel-encoded audio resources and cannot play better spatial audio data.
By combining with third-party applications, spatial audio technology of electronic devices and channel-encoded audio resources of third-party applications can generate better spatial audio data.
It realizes the playback of spatial audio data for users, improves the quality of music playback, and brings an immersive spatial audio experience to users.
Smart Images

Figure CN118585163B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computers, and in particular to an audio data playback method and an electronic device. Background Art
[0002] Spatial audio technology is an extension technology based on stereo surround sound. Compared with stereo surround sound, it has more support for sound decoding and channel technology, and can more easily present the layering, stereoscopic and depth of sound. Spatial audio technology is mainly applied to channel-encoded audio data. The reason is that compared with ordinary audio data, channel-encoded audio data has more obvious effects after spatial audio sound effect processing, which is more conducive to bringing users an immersive spatial audio experience.
[0003] At present, with the development of smart devices, more and more electronic devices are equipped with spatial audio technology, but these electronic devices lack audio resources for channel encoding and therefore cannot play better spatial audio data for users. Summary of the invention
[0004] The embodiments of the present application provide an audio data playback method and an electronic device. Based on the method described in the present application, it can be combined with a third-party application to generate better spatial audio data, effectively play spatial audio data for users, and improve the quality of music playback.
[0005] In a first aspect, the present application provides an audio data playback method, the method comprising: in response to a playback operation on first audio data in a playback interface of a first application, playing the first audio data; when playing the first audio data, in response to the first audio data being a media stream and the electronic device supporting a spatial audio function, performing spatial audio sound effect processing on the first audio data based on attribute characteristics of the first audio data to obtain first spatial audio data; and playing the first spatial audio data.
[0006] Based on the method described in the first aspect, when playing audio data, the spatial audio technology of the electronic device and the channel-encoded audio resources of the third-party application can be used to generate better spatial audio data, thereby realizing the combination between the electronic device and the third-party application, thereby effectively playing spatial audio data for users and improving the quality of music playback.
[0007] In a possible implementation, performing spatial audio effect processing on the first audio data based on the attribute characteristics of the first audio data to obtain the first spatial audio data includes: if the attribute characteristics of the first audio data do not include the first feature, performing spatial audio effect processing on the first audio data to obtain the first spatial audio data; the first feature indicates that the first audio data has been processed by spatial audio effect, or the first characteristic indicates that the first audio data is not allowed to be processed by spatial audio effect, or the first characteristic indicates that the processing delay of the first audio data is lower than a preset threshold. Based on this method, the effectiveness of spatial audio effect processing can be improved.
[0008] In a possible implementation, if the attribute characteristics of the first audio data do not include the first feature, performing spatial audio effect processing on the first audio data to obtain the first spatial audio data includes: if the attribute characteristics of the first audio data do not include the first feature, performing spatial audio effect processing on the first audio data when the spatial audio function is turned on to obtain the first spatial audio data. Based on this method, the effectiveness of spatial audio effect processing can be improved and power consumption can be saved.
[0009] In a possible implementation, performing spatial audio effect processing on the first audio data to obtain the first spatial audio data includes: in response to the first audio data being multi-channel audio data, performing spatial audio effect processing on the first audio data to obtain the first spatial audio data. Based on this approach, the effectiveness and visibility of spatial audio effect processing can be improved, thereby improving user experience.
[0010] In a possible implementation, the playback interface includes a spatial audio function switch; the method further includes: in response to the spatial audio function switch being turned on, displaying a first prompt box; the first prompt box is used to recommend a user to a spatial audio data zone; in response to the spatial audio function switch not being turned on, displaying a second prompt box; the second prompt box is used to recommend the user to turn on the spatial audio function. Based on this method, spatial audio data can be intelligently recommended to users, improving user experience.
[0011] In one possible implementation, in response to the spatial audio function switch being turned on, before displaying the first prompt box, the method further includes: when the electronic device supports the spatial audio function and one or more applications are registered and permitted by the electronic device, storing the address information of the spatial audio data area corresponding to the one or more applications; the one or more applications include the first application. Based on this method, when a third-party application is started or at other appropriate times, the corresponding interface of AudioKit can be called to pre-store the address information of the spatial audio data area corresponding to the third-party application in the electronic device, thereby realizing the combination with the third-party application.
[0012] In a possible implementation, the first prompt box includes an option of a spatial audio data zone corresponding to the one or more applications; the method further includes: in response to an operation of triggering the option of the first spatial audio data zone, based on the address information of the first spatial audio data zone, displaying a recommendation interface corresponding to the first spatial audio data zone; the first spatial audio data zone is one of the spatial audio data zones corresponding to the one or more applications. Based on this method, more spatial audio data can be intelligently recommended to users, improving user experience.
[0013] In a possible implementation, the first spatial audio data zone is a spatial audio data zone corresponding to the first application, and the recommendation interface of the first spatial audio data zone includes options for the first spatial audio data and options for the second spatial audio data; the second spatial audio data is associated with the first spatial audio data. Based on this method, other spatial audio data associated with the current audio data can be intelligently recommended to the user, thereby improving the user experience.
[0014] In a second aspect, the present application provides an audio data playback device, which may be an electronic device, or a device in an electronic device, or a device that can be used in combination with an electronic device; wherein the audio data playback device may also be a chip system, and the audio data playback device may execute the method executed by the electronic device in the first aspect. The functions of the audio data playback device may be implemented by hardware, or by hardware executing corresponding software implementations. The hardware or software includes one or more units corresponding to the above functions. The unit may be software and / or hardware. The operations and beneficial effects performed by the audio data playback device may refer to the methods and beneficial effects described in the first aspect above, and the repeated parts will not be repeated.
[0015] In a third aspect, the present application provides an audio data playback device, which includes a processor. When the processor calls a computer program in a memory, the method described in the first aspect is executed.
[0016] In a fourth aspect, the present application provides an audio data playback device, which includes a processor and a memory, and the processor and the memory are coupled; the processor is used to implement the method described in the first aspect.
[0017] In a fifth aspect, the present application provides an audio data playback device, which includes a processor, a memory and a transceiver, and the processor and the memory are coupled; the transceiver is used to send and receive data, and the processor is used to implement the method described in the first aspect.
[0018] In a sixth aspect, the present application provides an electronic device, comprising one or more processors and one or more memories. The one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program codes, and the computer program codes include computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the audio data playback method in any possible implementation of the first aspect.
[0019] In a seventh aspect, the present application provides a chip comprising a processor and an interface, wherein the processor and the interface are coupled; the interface is used to receive or output signals, and the processor is used to execute code instructions so that the method described in the first aspect is executed.
[0020] In an eighth aspect, the present application provides an audio data playback system, which includes an electronic device; wherein the electronic device is used to execute the method described in the first aspect.
[0021] In a ninth aspect, the present application provides an audio data playback device, which includes a function or unit for executing any one of the methods in the first aspect.
[0022] In the tenth aspect, the present application provides a computer-readable storage medium, which stores a computer program, and the computer program includes program instructions. When the program instructions are run on an audio data playback device, the audio data playback device executes the audio data playback method in any possible implementation of the first aspect above.
[0023] In an eleventh aspect, the present application provides a computer program product, which, when executed on a computer, enables the computer to execute the audio data playback method in any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 It is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0025] Figure 2 It is a software structure block diagram of an electronic device provided in an embodiment of the present application;
[0026] Figure 3 It is a flowchart of an audio data playback method provided in an embodiment of the present application;
[0027] Figure 4A It is a schematic diagram of a flow chart of presetting a spatial audio data zone provided by an embodiment of the present application;
[0028] Figure 4Bis a schematic diagram of a flow chart of spatial audio data recommendation provided by an embodiment of the present application;
[0029] Figure 5 is a flowchart of another audio data playback method provided in an embodiment of the present application;
[0030] Fig. 6A is a schematic diagram of a playback interface of a first application provided in an embodiment of the present application;
[0031] Figure 6B is a schematic diagram of displaying a second prompt box when the spatial audio function is not enabled, provided in an embodiment of the present application;
[0032] Figure 6C is a schematic diagram of displaying a first prompt box when a spatial audio function is turned on, provided in an embodiment of the present application;
[0033] Fig.6D This is a schematic diagram of displaying a third prompt box when a third application verification fails, provided by an embodiment of the present application;
[0034] Fig. 7A is a schematic diagram of a spatial audio data area A corresponding to a first application provided in an embodiment of the present application;
[0035] Figure 7B is a schematic diagram of a spatial audio data area B corresponding to a second application provided in an embodiment of the present application;
[0036] Figure 7C is a schematic diagram of a recommendation interface corresponding to a spatial audio data zone A provided in an embodiment of the present application;
[0037] Fig.7D is a schematic diagram of a floating window provided in an embodiment of the present application;
[0038] Figure 8 is a structural diagram of an audio data playback device provided in an embodiment of the present application;
[0039] Fig. 9 It is a schematic diagram of the structure of a chip provided in an embodiment of the present application. DETAILED DESCRIPTION
[0040] The technical solutions in the embodiments of the present application will be described clearly and in detail below in conjunction with the accompanying drawings. 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" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0041] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0042] The term "user interface (UI)" in the following embodiments of the present application refers to a medium interface for interaction and information exchange between an application or operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The user interface is a source code written in a specific computer language such as Java and extensible markup language (XML). The interface source code is parsed and rendered on an electronic device, and finally presented as content that the user can recognize. The commonly used form of user interface is a graphical user interface (GUI), which refers to a user interface related to computer operations that is displayed in a graphical manner. It can be a visual interface element such as time, date, text, icon, button, menu, tab, text box, dialog box, status bar, navigation bar, widget, etc. displayed on the display screen of an electronic device.
[0043] In order to facilitate understanding of the solution provided by the embodiment of the present application, the following introduces the relevant concepts involved in the embodiment of the present application:
[0044] 1. Spatial Audio Technology
[0045] Spatial audio technology is an extension of stereo surround sound. It is a technology that makes the audience feel that the sound is coming from a virtual position in three-dimensional space by manipulating the sound produced by stereo speakers, surround speakers, speaker arrays or headphones. Compared with stereo surround sound, it has more support for sound decoding and channel technology, and can more easily present the layering, three-dimensionality and depth of the sound, which can bring users a more immersive and spatial audio content experience.
[0046] In addition, spatial audio technology is mainly used to support audio data that supports 5.1, 7.1 and other channel encodings. The reason is that compared with ordinary audio data, the channel-encoded audio data has a more obvious effect after spatial audio sound effect processing, which is more conducive to providing users with an immersive spatial audio experience.
[0047] 2. Third-party applications (also called third-party applications)
[0048] Third-party applications are related software developed by other organizations or individuals other than the software developer to address the functional deficiencies of a certain software or application. They can be understood as third-party programs and services that do not directly involve the manufacturer through the program.
[0049] In an embodiment of the present application, taking a third-party music application as an example, the third-party music application has rich channel-encoded audio resources, such as audio resources that support 5.1, 7.1 and other channel encodings. At present, with the development of smart devices, more and more electronic devices have spatial audio technology, but these electronic devices lack channel-encoded audio resources, so they cannot play better spatial audio data for users. Therefore, electronic devices can be combined with third-party applications, and third-party applications can provide rich channel-encoded audio resources, so as to timely recommend audio resources (i.e., spatial audio resources) processed by spatial audio technology to users, bringing users an immersive spatial audio experience.
[0050] In order to be able to combine with third-party applications to generate better spatial audio data, effectively play spatial audio data for users, and improve the quality of music playback, the present application provides an audio data playback method and an electronic device. In a specific implementation, the above-mentioned audio data playback method can be executed by an electronic device 100. Among them, the electronic device 100 can be a mobile phone, a tablet computer, or a wearable electronic device with wireless communication function (such as a smart watch), etc., but is not limited to this. The electronic device 100 is configured with a display screen and can be installed with a preset application (application, APP), such as a third-party music APP, etc., which is not limited here. For example, a user can play music through a third-party music APP on the display screen.
[0051] The hardware structure of the electronic device 100 is introduced below. Figure 1 , Figure 1 It is a schematic diagram of the hardware structure of the electronic device 100 provided in an embodiment of the present application.
[0052] The electronic device 100 may 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, an earphone interface 170D, a sensor module 180, a button 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 may include a pressure sensor 180A, a gyroscope sensor 180B, an air 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.
[0053] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0054] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0055] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0056] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. Repeated access is avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved. The processor 110 calls the instructions or data stored in the memory, so that the electronic device 100 executes the audio data playing method executed by the electronic device in the following method embodiment.
[0057] In some embodiments, the processor 110 may include one or more interfaces. The interface may 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), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0058] The charging management module 140 is used to receive charging input from a charger, where the charger can be a wireless charger or a wired charger.
[0059] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160. In some other embodiments, the power management module 141 can also be set in the processor 110.
[0060] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0061] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0062] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0063] The modulation and demodulation processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is transmitted to the application processor.
[0064] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as Wi-Fi networks), Bluetooth (BT), BLE broadcasting, global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. 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, modulates the frequency of the electromagnetic wave signal and filters it, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0065] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, so that electronic device 100 can communicate with the network and other devices through wireless communication technology.
[0066] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0067] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0068] The electronic device 100 can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194 and the application processor. The ISP is used to process the data fed back by the camera 193. The camera 193 is used to capture static images or videos. The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. The video codec is used to compress or decompress digital videos. The electronic device 100 can support one or more video codecs.
[0069] NPU is a neural-network (NN) computing processor. It can quickly process input information by drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, and can also continuously self-learn.
[0070] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement a data storage function.
[0071] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function), etc. The data storage area may store data (such as audio data) created during the use of the electronic device 100, etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as a flash memory device, etc.
[0072] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0073] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.
[0074] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The receiver 170B, also called a "earpiece", is used to convert an audio electrical signal into a sound signal. The microphone 170C, also called a "microphone" or "microphone", is used to convert a sound signal into an electrical signal. The headphone jack 170D is used to connect a wired headphone. The pressure sensor 180A is used to sense a pressure signal and can convert the pressure signal into an electrical signal.
[0075] In some embodiments, the pressure sensor 180A may be provided on the display screen 194. The gyroscope sensor 180B may be used to determine the motion posture of the electronic device 100. The air pressure sensor 180C is used to measure air pressure. The magnetic sensor 180D includes a Hall sensor. The acceleration sensor 180E may detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes). The distance sensor 180F is used to measure the distance. The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector. The ambient light sensor 180L is used to sense the brightness of ambient light. The fingerprint sensor 180H is used to collect fingerprints. The temperature sensor 180J is used to detect the temperature. The touch sensor 180K, also known as a "touch panel". The touch sensor 180K may be provided on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also known as a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The bone conduction sensor 180M may obtain a vibration signal. The buttons 190 include a power button, a volume button, etc. The motor 191 can generate a vibration prompt. The indicator 192 can be an indicator light, which can be used to indicate the charging status, power change, messages, missed calls, notifications, etc. The SIM card interface 195 is used to connect a SIM card.
[0076] In addition, an operating system is running on the above components. For example, operating systems such as iOS and Android. The operating system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to illustrate the software structure of the electronic device 100. It should be noted that although the embodiment of the present application is described by taking the Android system as an example, its basic principles are also applicable to electronic devices of other operating systems.
[0077] Figure 2 It is a software structure block diagram of the electronic device 100 of the embodiment of the present application. The software structure adopts a layered architecture, which divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In the embodiment of the present application, the operating system (taking the Android system, the Android system running on the AP as an example) can be divided into six layers, from top to bottom, respectively, the application layer (application, APP), the application framework layer (framework, FWK), the Android runtime (Android runtime) and the system library, the hardware abstraction layer (hardware abstraction layer, HAL), the kernel layer and the hardware layer.
[0078] The application layer may include a series of application packages. Figure 2As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc. Among them, the music application here may include an audio service software development kit (SDK) (which may be called Audiokit), and the music application may be a third-party music application. Audiokit can be considered as an application integration calling interface, which is used to determine whether the device has audio open services. The application layer may also include a system UI (systemUI), which is used to display the interface of the electronic device, such as the playback interface.
[0079] The application framework layer provides application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. Figure 2 As shown, the application framework layer may include an audio framework, system services, camera services, etc., and the embodiments of the present application do not impose any restrictions on this.
[0080] The audio framework is responsible for the collection and output of audio data, the control of audio streams, the management of audio devices, etc. It can specifically include audio open services (AudioEngine), playback data modules (AudioTrack), audio service modules (AudioService), playback monitoring modules (PlaybackActivityMonitor), audio playback configuration modules (AudioPlaybackConfiguration), audio attribute modules (AudioAttributes), audio service extension modules (HwAudioServiceEx), spatial audio processing modules (Spatializer), etc. Among them:
[0081] AudioEngine is used to bind the application on the device and establish a connection with the application; provide the application with a corresponding audio open service list and bind the corresponding audio service to the application; store the address information of the spatial audio data area corresponding to the application, etc.
[0082] AudioTrack is responsible for the output of playback data and belongs to the Android native framework API class. For example, the first audio data is played.
[0083] AudioService is the core process module of the audio framework, which is responsible for managing and controlling audio devices and audio output. It provides a unified interface that allows applications to access and control audio devices, including microphones, speakers, headphones, etc.; it also provides some advanced functions such as audio mixing, audio enhancement, audio format conversion, etc. It can automatically detect and configure audio devices to ensure that they can work properly. In addition, it can also manage driver and firmware updates for audio devices to ensure that they are always up to date.
[0084] PlaybackActivityMonitor is used to monitor the audio playback service. When audio data (audio stream) is played in the device, it is notified by callback.
[0085] AudioPlaybackConfiguration is used to provide configuration parameters for audio data (audio stream).
[0086] AudioAttributes is used to parse the configuration parameters of audio data (audio stream) to provide attribute characteristics of the audio data (audio stream), such as a collection of attribute flag bits.
[0087] HwAudioServiceEx is used to trigger the execution of the recommendation process, which is used to recommend users to enable the spatial audio function or recommend users more other spatial audio data areas.
[0088] Spatializer is used to trigger spatial audio processing of audio data when the user turns on the spatial audio function.
[0089] System services are responsible for scheduling application startup processes, creating and managing processes, creating and managing windows, etc. They can include verification modules (KitAssistantSDK), window managers, content providers, view systems, phone managers, resource managers, notification managers, etc. Among them:
[0090] KitAssistantSDK is used to verify the application. When the application verification is successful (i.e., registration permission is obtained), it instructs AudioEngine to obtain and store the address information of the space resource area corresponding to the application.
[0091] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0092] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0093] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0094] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).
[0095] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0096] The Notification Manager allows applications to display notification information (such as prompt boxes) in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the Notification Manager is used to notify download completion, message reminders, etc. The Notification Manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
[0097] The camera service is the core process module of the camera framework. It mainly provides API interface functions to the application layer and calls the camera hardware abstraction layer downward through HIDL (hardware interface definition language).
[0098] Android runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
[0099] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
[0100] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0101] The system library may include multiple functional modules, such as surface manager, media libraries, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0102] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0103] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats.
[0104] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0105] A 2D graphics engine is a drawing engine for 2D drawings.
[0106] The hardware abstraction layer is an interface layer between the operating system kernel and the hardware circuit. Its purpose is to abstract the hardware. It hides the hardware interface details of a specific platform and can provide a virtual hardware platform for the operating system. The hardware abstraction layer is an encapsulation of the Linux kernel driver, providing an interface to the upper layer and shielding the implementation details of the low-level hardware. Figure 2 As shown, the hardware abstraction layer may include Wi-Fi HAL, audio HAL, camera HAL, etc.
[0107] The kernel layer is the layer between hardware and software. It is the core of an operating system and the first layer of software expansion based on hardware. It provides the most basic functions of the operating system and is the basis for the operation of the operating system. It is responsible for managing the system's processes, memory, device drivers, files, and network systems, and determines the performance and stability of the system. The kernel layer can include display drivers, audio drivers, camera drivers, sensor drivers, etc. Among them, the camera driver is the driver layer of the camera device, which is mainly responsible for the interaction with the hardware.
[0108] The hardware layer includes displays, cameras, sensors, etc.
[0109] Based on the above software structure, the present application embodiment provides a flowchart of an audio data playback method. Figure 3 As shown, the audio data playing method includes spatial audio data area presetting and spatial audio data recommendation. The spatial audio data area presetting process includes the following steps: Figure 4A In steps S301 to S311, the process of recommending spatial audio data includes the following steps: Figure 4B Steps S401 to S418 in the embodiment. Wherein:
[0110] 1. Spatial Audio Data Area Preset
[0111] A third-party application can preset the address information of the corresponding spatial audio data area into the electronic device by accessing the open capabilities of AudioKit. Specifically, AudioKit provides an SDK interface for third-party applications to integrate and call. When the third-party application is started or at other appropriate times, it can call the corresponding interface of AudioKit to pre-store the address information of the spatial audio data area corresponding to the third-party application into the electronic device. The third-party application may include one or more. The following takes the third-party application as the first application as an example. The first application can actively perform the following steps S301 to S311 when it is started or at other appropriate times.
[0112] S301. The first application calls the isDeviceSupport function to determine whether the electronic device supports the audio open service through the audio service SDK (Audiokit).
[0113] The first application may be a third-party music application. The first application may have rich channel-encoded audio data, such as audio data supporting 5.1, 7.1, etc. channel encoding.
[0114] S302: The audio service SDK notifies the first application that the electronic device has an audio open service.
[0115] For example, the audio service SDK replies "true" to the first application to indicate that the electronic device has an audio open service.
[0116] S303, the first application calls the construct function to construct an object to the audio service SDK; after the audio service SDK calls the init function to initialize, it calls the bindService function to notify the audio open service (AudioEngine) to bind the first application on the electronic device; after the audio open service binds the first application on the electronic device, it feeds back to the first application through the audio service SDK.
[0117] For example, the audio open service may call the onServiceConnected function to notify the audio service SDK that the first application is successfully bound to the electronic device, and the audio service SDK further feeds back to the first application that the first application is successfully bound to the electronic device.
[0118] S304: The first application calls the getSupportedServices function to obtain an audio open service list from the audio open service through the audio service SDK; the audio open service feeds back the audio open service list to the first application through the audio service SDK.
[0119] For example, the audio open service feeds back an audio open service list (servicelist) supported by the electronic device to the audio service SDK, and the audio service SDK further feeds back the audio open service list to the first application.
[0120] S305. The first application calls the createService function to construct an object to the audio service SDK; the audio service SDK calls the bindService function to notify the audio open service to bind the audio service that supports spatial audio data storage to the first application; after the audio open service binds the audio service that supports spatial audio data storage to the first application, it feeds back to the first application through the audio service SDK.
[0121] For example, the audio open service can call the onServiceConnected function to notify the audio service SDK that the corresponding audio service is successfully bound to the first application, and the audio service SDK further feedbacks to the first application that the audio service supporting spatial audio data storage is successfully bound to the first application.
[0122] S306: The first application calls the addSpatialZoneAddress function to notify the audio open service through the audio service SDK to store the address information of the spatial audio data zone corresponding to the first application.
[0123] S307: The audio open service calls the checkPermission function to confirm with the verification module (KitAssistantSDK) whether the first application has registered permission.
[0124] S308: The verification module notifies the audio open service of the first application registration permission (ie, verification is successful).
[0125] For example, the verification module replies "true" to the audio open service to indicate that the first application is registered with permission (ie, the verification is successful).
[0126] Optionally, when the verification module notifies the audio open service that the first application verification has failed, the method further includes: a notification manager (NotificationManager) notifying the display screen to display a third prompt box, wherein the third prompt box is used to prompt the user that the first application cannot use the audio open service.
[0127] S309: The audio open service calls the saveSpatialAudioZoneAddress function to store the address information of the spatial audio data zone corresponding to the first application.
[0128] S310: After storing the address information of the spatial audio data area corresponding to the first application, the audio open service feeds back the return value to the first application through the audio service SDK.
[0129] The return value here may be called operation result, which may indicate that the audio open service has completed the storage of the address information of the spatial audio data area corresponding to the first application.
[0130] S311. The first application calls the destroy function to notify the audio service SDK to destroy the object, and the audio service SDK calls the unbindService function to notify the audio open service to unbind the audio service bound to the first application.
[0131] Similarly, other applications may also adopt the above steps S301 to S311 to store the address information of their corresponding spatial audio data areas to the audio open service. Therefore, the audio open service may include the address information of the spatial audio data areas corresponding to one or more applications.
[0132] 2. Spatial Audio Data Recommendation
[0133] S401. The audio service module (AudioService) calls the registerPlaybackCallback function to register the monitoring of the playback service with the playback monitoring module (PlaybackActivityMonitor).
[0134] S402: In response to a user's operation of playing the first audio data on the play interface of the first application, the electronic device plays the first audio data through a playback data module (AudioTrack).
[0135] S403: When the play monitoring module monitors that the first audio data (audio stream) is played in the electronic device, the callback function is called to notify the audio service module that the first audio data is currently being played.
[0136] It can be understood that when the audio service is in the initial state, it will register the listening of the playback service with the playback monitoring module. When the first audio data (i.e., audio stream) is played in the device, the audio service will receive a corresponding callback from the playback monitoring module. After receiving the callback, the audio service will further analyze the characteristics of the first audio data. Among them, the first audio data here can be audio data in the first application that supports 5.1, 7.1 and other channel encoding.
[0137] S404: The audio service module analyzes the first audio data and determines whether the first audio data is a media stream.
[0138] S405: If the first audio data is a media stream, the audio service module further determines whether the electronic device supports a spatial audio function.
[0139] Optionally, if the first audio data is not a media stream, it means that the first audio data is not audio data that meets the recommended characteristics, and the subsequent process needs to be terminated to save power consumption.
[0140] S406: If the electronic device supports the spatial audio function, the audio service module calls the config.getAudioAttributes function to obtain the configuration parameters of the first audio data from the audio playback configuration module (AudioPlaybackConfiguration).
[0141] Specifically, the audio playback configuration module queries the configuration parameters of the first audio data and feeds them back to the audio service module.
[0142] Optionally, if the electronic device does not support the spatial audio function, it is necessary to terminate the subsequent process to save power consumption.
[0143] S407. The audio service module calls the audioAttributes.getAllFlags function to obtain a set of attribute flags of the first audio data from the audio attribute module (AudioAttributes).
[0144] Specifically, the audio attribute module parses the configuration parameters of the first audio data, determines the attribute flag bit set of the first audio data, and feeds back the set to the audio service module.
[0145] It can be understood that, when the audio service module determines that the first audio data is a media stream and the electronic device supports a spatial audio function, it is necessary to further determine the attribute characteristics (ie, a collection of attribute flag bits) of the first audio data.
[0146] S408. The audio service module determines whether the first audio data can be processed with spatial audio effects based on the attribute flag bit set of the first audio data.
[0147] Specifically, if the attribute flag bit set of the first audio data does not include the first feature, it is determined that the first audio data can be processed with spatial audio effects.
[0148] Among them, the first feature indicates that the first audio data has been processed with spatial audio effects, or, the first characteristic indicates that the first audio data is not allowed to be processed with spatial audio effects, or, the first characteristic indicates that the processing delay of the first audio data is lower than a preset threshold.
[0149] It can be understood that, assuming that the first feature indicates that the first audio data has been processed with spatial audio effects, if the attribute flag bit set of the first audio data includes the first feature (i.e., carries the FLAG_CONTENT_SPATIALIZED tag), then no further spatial audio effect processing is required, otherwise repeated spatial audio effect processing will damage the sound quality. Therefore, when the attribute flag bit set of the first audio data does not include the first feature, it is determined that the first audio data can be processed with spatial audio effects.
[0150] Assuming that the first feature indicates that the first audio data is not allowed to be processed with spatial audio effects, if the attribute flag bit set of the first audio data includes the first feature (i.e., carries the FLAG_NEVER_SPATIALIZE tag), then further spatial audio effects processing cannot be performed. Therefore, when the attribute flag bit set of the first audio data does not include the first feature, it is determined that the first audio data can be processed with spatial audio effects.
[0151] Assume that the first characteristic indicates that the processing delay of the first audio data is lower than a preset threshold. The preset threshold here can be 10ms, or it can be other smaller values (for example, a value less than 20ms), which is not limited here. The processing delay of the first audio data lower than the preset threshold can indicate that the first audio data needs to be played through a low-latency path, that is, the processing delay requirement of the first audio data is low latency. If the attribute mark bit collection of the first audio data includes the first feature (that is, carrying the FLAG_LOW_LATENCY mark), it indicates that the playback initiator of the media stream has high requirements for latency and no further spatial audio sound effect processing is required, otherwise the processing time of the first audio data will be increased, which is contrary to the low latency requirement of the audio data, and will reduce the real-time performance of the first audio data and reduce the user experience. Therefore, when the attribute mark bit collection of the first audio data does not include the first feature, it is determined that the first audio data can be processed with spatial audio sound effects.
[0152] In general, when the attribute flag bit set of the first audio data does not include the first feature, it can be determined that the first audio data can be processed with spatial audio effects. Based on this method, it is possible to more efficiently determine whether the current audio data meets the target requirements, and to filter out audio data that does not meet the recommended features as quickly as possible, which is conducive to improving the effectiveness of spatial audio effect processing.
[0153] S409: If the first audio data can be processed with spatial audio effects, the audio service module further calls the getChannelMask function to obtain the channel information of the first audio data from the audio playback configuration module.
[0154] Specifically, the audio playback configuration module determines the channel information of the first audio data and feeds it back to the audio service module.
[0155] S410: The audio service module determines whether the first audio data is multi-channel audio data based on the channel information of the first audio data.
[0156] S411: If the first audio data is multi-channel audio data, the audio service module detects whether the spatial audio function is enabled.
[0157] It can be understood that after the electronic device determines that the first audio data can be processed with spatial audio effects, the channel information of the first audio data is further analyzed. If the first audio data is monophonic audio data, the user will not be able to clearly perceive the spatial audio effect, which is easy to reduce the user experience. Therefore, only when the first audio data is multi-channel audio data, it is meaningful to process the first audio data with spatial audio effects, so that the user can clearly perceive the immersive spatial audio experience. At this time, the first audio data is processed with spatial audio effects, so that the first spatial audio data can be obtained. Among them, the so-called monophonic channel means that there is only one independent input or output signal in the audio system; the so-called multi-channel means that there are at least two independent input or output signals in the audio system, which can be used for immersive sound effects or wide stereo surround sound. Based on this method, the quality of music playback can be effectively improved, and the user can obviously bring an immersive spatial audio experience. In addition, before the spatial audio effect processing is performed on the first audio data, it is also determined whether the spatial audio function is turned on, and different recommendations are provided for different situations.
[0158] S412: If the spatial audio function is not enabled, the audio service module indicates to the audio service extension module (HwAudioServiceEx) that the spatial audio function is not enabled.
[0159] S413: The audio service extension module calls a notify function to indicate to the NotificationManager that the spatial audio function is not enabled.
[0160] S414. The notification manager displays a second prompt box, where the second prompt box is used to recommend the user to enable the spatial audio function.
[0161] It can be understood that, when the spatial audio function is not turned on, the second prompt box recommends the user to turn on the spatial audio function (i.e., recommends the spatial audio function turn-on button), prompting the user that the current audio will have a better sound experience using spatial audio.
[0162] S415. In response to the user's operation of enabling the spatial audio function, the notification manager calls the setEnabled function to notify the spatial audio processing module (Spatializer) that the spatial audio function is enabled.
[0163] S416: The spatial audio processing module performs spatial audio effect processing on the first audio data to obtain first spatial audio data, and plays the first spatial audio data.
[0164] S417: The notification manager displays a first prompt box, where the first prompt box is used to recommend a user space audio data zone.
[0165] The first prompt box includes options for a spatial audio data area corresponding to one or more applications.
[0166] It can be understood that after the spatial audio function is turned on, the first audio data is processed with spatial audio effects to obtain the first spatial audio data, and the first spatial audio data is played. At this time, the user can hear the first audio data processed with spatial audio effects, giving the user an immersive spatial audio experience.
[0167] In addition, the user spatial audio data area can be recommended through the first prompt box. In the spatial audio data area, the audio in the album corresponding to the first audio data, the spatial audio resource area jump link corresponding to the first application or other applications can be recommended to the user, and the user can experience the immersive feeling brought by the spatial audio after clicking.
[0168] S418. In response to the user triggering the option of the first spatial audio data zone, the notification manager jumps to display a recommendation interface corresponding to the first spatial audio data zone in the first application based on the address information of the first spatial audio data zone stored in the audio open service.
[0169] The one or more applications include the first application, and the first spatial audio data zone is one of the spatial audio data zones corresponding to the one or more applications. In the embodiment of the present application, when the first spatial audio data zone is the spatial audio data zone corresponding to the first application, when the user clicks the spatial audio data zone corresponding to the first application in the first prompt box, the recommendation interface corresponding to the spatial audio data zone will be displayed in the first application. Based on this method, more spatial audio data can be intelligently recommended to users to improve user experience.
[0170] Similarly, when the user clicks on the spatial audio data area corresponding to the second application in the first prompt box, the user will jump from the first application to the second application to display the recommendation interface corresponding to the audio data area.
[0171] It can be seen that based on the method described above, spatial audio data is generated by utilizing the spatial audio technology of electronic devices and the audio resources of third-party applications, thereby realizing the combination between electronic devices and third-party applications, thereby being able to play spatial audio data for users and improve the quality of music playback.
[0172] Based on the above, the electronic device is regarded as the execution subject, and another audio data playback method provided by the embodiment of the present application is further described in detail. Figure 5 As shown, the audio data playing method includes the following steps S501 to S503. Figure 5 The method execution subject shown can be the electronic device mentioned above. Or, Figure 5 The method execution entity shown may be a chip in an electronic device, which is not limited in the embodiments of the present application. Figure 5 The method is described by taking an electronic device as an example of an execution subject.
[0173] S501: In response to a play operation on first audio data in a play interface of a first application, an electronic device plays the first audio data.
[0174] In the embodiment of the present application, the first application may be a third-party music application. The first application may have rich channel-encoded audio data. For example, it supports 5.1, 7.1 and other channel-encoded audio data. Fig. 6A As shown, the play interface of the first application includes a play button, a previous song button, and a next song button. The user can play music A by clicking the play button in the play interface of the first application, and the electronic device will start playing music A. Here, music A is considered to be the first audio data.
[0175] S502: When playing the first audio data, the electronic device responds that the first audio data is a media stream and supports a spatial audio function, and performs spatial audio effect processing on the first audio data based on attribute characteristics of the first audio data to obtain first spatial audio data.
[0176] S503: The electronic device plays the first spatial audio data.
[0177] In an embodiment of the present application, when playing the first audio data, the electronic device determines whether the first audio data is a media stream and whether the electronic device supports a spatial audio function. The first audio data here may be channel-encoded audio data in a first application, such as audio data supporting 5.1, 7.1, and other channel encodings. If the first audio data is a media stream and whether the electronic device supports a spatial audio function, the spatial audio sound effect processing of the first audio data is further implemented according to the attribute characteristics of the first audio data, thereby obtaining the first spatial audio data. After the electronic device generates the first spatial audio data, it can play the first spatial audio data for the user, improve the quality of music playback, and bring an immersive spatial audio experience to the user.
[0178] In a possible implementation manner, when the electronic device performs spatial audio effect processing on the first audio data based on the attribute characteristics of the first audio data to obtain the first spatial audio data, a specific implementation manner may be:
[0179] If the attribute characteristics of the first audio data do not include the first feature, the electronic device performs spatial audio sound effect processing on the first audio data to obtain first spatial audio data; the first feature indicates that the first audio data has been processed with spatial audio sound effects, or the first characteristic indicates that the first audio data is not allowed to be processed with spatial audio sound effects, or the first characteristic indicates that the processing delay of the first audio data is lower than a preset threshold.
[0180] It can be understood that the first feature here can indicate: (1) the first audio data has been processed with spatial audio effects, which can be indicated by the FLAG_CONTENT_SPATIALIZED tag; (2) the first audio data is not allowed to be processed with spatial audio effects, which can be indicated by the FLAG_NEVER_SPATIALIZE tag; (3) the processing delay of the first audio data is lower than a preset threshold, which can be indicated by the FLAG_LOW_LATENCY tag. Of course, the first feature can also indicate other attributes, which are not limited here.
[0181] Assuming that the first feature indicates that the first audio data has been processed with spatial audio effects, and the attribute flag bit set of the first audio data includes the first feature (i.e., carries the FLAG_CONTENT_SPATIALIZED tag), then no further spatial audio effect processing can be performed, otherwise repeated spatial audio effect processing will damage the sound quality. Therefore, when the attribute flag bit set of the first audio data does not include the first feature, it is determined that the first audio data can be processed with spatial audio effects.
[0182] Assuming that the first feature indicates that the first audio data is not allowed to be processed with spatial audio effects, and the attribute flag bit set of the first audio data includes the first feature (i.e., carries the FLAG_NEVER_SPATIALIZE tag), then further spatial audio effects processing cannot be performed. Therefore, when the attribute flag bit set of the first audio data does not include the first feature, it is determined that the first audio data can be processed with spatial audio effects.
[0183] Assume that the first characteristic indicates that the processing delay of the first audio data is lower than a preset threshold. The preset threshold here can be 10ms, or it can be other smaller values (for example, a value less than 20ms), which is not limited here. The processing delay of the first audio data lower than the preset threshold can indicate that the first audio data needs to be played through a low-latency path, that is, the processing delay requirement of the first audio data is low latency. If the attribute mark bit collection of the first audio data includes the first feature (that is, carrying the FLAG_LOW_LATENCY mark), it indicates that the playback initiator of the media stream has high requirements for latency and no further spatial audio sound effect processing is required, otherwise the processing time of the first audio data will be increased, which is contrary to the low latency requirement of the audio data, and will reduce the real-time performance of the first audio data and reduce the user experience. Therefore, when the attribute mark bit collection of the first audio data does not include the first feature, it is determined that the first audio data can be processed with spatial audio sound effects.
[0184] In general, when the attribute flag bit set of the first audio data does not include the first feature, it can be determined that the first audio data can be processed with spatial audio effects. Based on this method, it is possible to more efficiently determine whether the current audio data meets the target requirements, and to filter out audio data that does not meet the recommended features as quickly as possible, which is conducive to improving the effectiveness of spatial audio effect processing.
[0185] The specific implementation process inside the electronic device may refer to the above steps S401 to S408, namely:
[0186] The audio service module (AudioService) calls the registerPlaybackCallback function to register the listening of the playback service with the playback monitoring module (PlaybackActivityMonitor); the electronic device responds to the user's operation of playing the first audio data in the playback interface of the first application, and the first application plays the first audio data through the playback data module (AudioTrack); when the playback monitoring module monitors the first audio data (audio stream) being played in the electronic device, the callback function is called to notify the audio service module that the first audio data is currently being played; the audio service module analyzes the first audio data to determine whether the first audio data is a media stream; if the first audio data is a media stream , the audio service module further determines whether the electronic device supports the spatial audio function; if the electronic device supports the spatial audio function, the audio service module calls the config.getAudioAttributes function to obtain the configuration parameters of the first audio data from the audio playback configuration module (AudioPlaybackConfiguration); the audio service module calls the audioAttributes.getAllFlags function to obtain the attribute flag bit collection of the first audio data from the audio attribute module (AudioAttributes); the audio service module determines whether the first audio data can be processed with spatial audio effects based on the attribute flag bit collection of the first audio data.
[0187] Optionally, when the electronic device performs spatial audio effect processing on the first audio data to obtain the first spatial audio data, a specific implementation method may be: the electronic device responds to the first audio data being multi-channel audio data, performs spatial audio effect processing on the first audio data to obtain the first spatial audio data.
[0188] It can be understood that after the electronic device determines that the first audio data can be processed with spatial audio effects, the channel information of the first audio data is further analyzed. If the first audio data is monophonic audio data, it will cause the user to be unable to clearly perceive the immersive spatial audio experience, which is easy to reduce the user experience. Therefore, only when the first audio data is multi-channel audio data, it is meaningful to process the first audio data with spatial audio effects, so that the user can clearly perceive the immersive spatial audio experience. At this time, the first audio data is processed with spatial audio effects, so that the first spatial audio data can be obtained, and then the recommendation process can be entered. Among them, the so-called monophonic channel means that there is only one independent input or output signal in the audio system; the so-called multi-channel means that there are at least two independent input or output signals in the audio system, which can be used for immersive sound effects or wide stereo surround sound. Based on this method, the quality of music playback can be effectively improved, the effectiveness and obviousness of spatial audio effect processing can be improved, and the user experience can be improved.
[0189] Further optionally, if the attribute feature of the first audio data does not include the first feature, the electronic device performs spatial audio sound effect processing on the first audio data to obtain the first spatial audio data, and a specific implementation method may be:
[0190] If the attribute characteristics of the first audio data do not include the first feature, the electronic device performs spatial audio sound effect processing on the first audio data when the spatial audio function is turned on to obtain first spatial audio data.
[0191] It can be understood that before the electronic device performs spatial audio sound effect processing on the first audio data, it will also determine whether the spatial audio function is turned on, and different recommendations will be made for different situations. That is to say, when the electronic device determines that the first audio data is a media stream, the electronic device supports the spatial audio function, and the first audio data is multi-channel audio data, it determines whether the spatial audio function is turned on. Only when the spatial audio function is turned on will the spatial audio sound effect processing be performed on the first audio data to obtain the first spatial audio data. Based on this method, if the spatial audio function is not turned on, there is no need to perform spatial audio sound effect processing, which improves the effectiveness of spatial audio sound effect processing and saves power consumption.
[0192] The specific implementation process inside the electronic device may refer to the above steps S409 to S411, that is:
[0193] If the first audio data can be processed with spatial audio effects, the audio service module further calls the getChannelMask function to obtain the channel information of the first audio data from the audio playback configuration module; the audio service module determines whether the first audio data is multi-channel audio data based on the channel information of the first audio data; if the first audio data is multi-channel audio data, the audio service module detects whether the spatial audio function is turned on.
[0194] In a possible implementation, the playback interface includes a spatial audio function switch. The following describes in detail the recommended methods corresponding to the two situations: the spatial audio function switch is turned on (i.e., the spatial audio function is turned on) and the spatial audio function switch is not turned on (i.e., the spatial audio function is turned off).
[0195] Case 1: In response to the spatial audio function switch not being turned on, the electronic device displays a second prompt box; the second prompt box is used to recommend the user to turn on the spatial audio function.
[0196] It can be understood that, when the spatial audio function is not turned on, the second prompt box recommends the user to turn on the spatial audio function (i.e., recommends the spatial audio function turn-on button), prompting the user that the current audio will have a better sound experience using spatial audio.
[0197] like Figure 6B As shown, the spatial audio function switch is displayed on the playback interface of the first application, and the user can turn on or off the spatial audio function through the spatial audio function switch. Figure 6B If the spatial audio function switch in the electronic device is in the off state (that is, the spatial audio function switch is not turned on), the electronic device also needs to display a second prompt box, in which the second prompt box prompts the user: "Turn on the spatial audio function for better results."
[0198] The specific implementation process inside the electronic device may refer to the above steps S412 to S414, namely:
[0199] If the spatial audio function is not turned on, the audio service module indicates to the audio service extension module (HwAudioServiceEx) that the spatial audio function is not turned on; the audio service extension module calls the notify function to indicate to the notification manager (NotificationManager) that the spatial audio function is not turned on; the notification manager displays a second prompt box, which is used to recommend the user to turn on the spatial audio function.
[0200] Case 2: In response to the spatial audio function switch being turned on, the electronic device displays a first prompt box; the first prompt box is used to recommend a user spatial audio data zone.
[0201] It can be understood that after the spatial audio function is turned on, the first audio data is processed with spatial audio sound effects to obtain the first spatial audio data, and the first spatial audio data is played. At this time, the user can hear the first audio data after the spatial audio sound effect processing, which brings an immersive spatial audio experience to the user. At the same time, the electronic device can display a first prompt box to recommend the user a spatial audio data area; in the spatial audio data area, the user can be recommended the audio in the album corresponding to the first audio data, the jump link to the spatial audio resource area corresponding to the first application or other applications, etc., and the user can experience more immersion brought by spatial audio after clicking. Based on this method, spatial audio data can be intelligently recommended to users to improve user experience.
[0202] like Figure 6C As shown, the user turns on the spatial audio function through the spatial audio function switch in the playback interface of the first application. At this time, after the electronic device detects that the spatial audio function switch is turned on, it performs spatial audio sound effect processing on music A (i.e., the first audio data) to obtain music A after spatial audio sound effect processing (i.e., the first spatial audio data), and plays the first spatial audio data. The user can then hear the music A after spatial audio sound effect processing, giving the user an immersive spatial audio experience. At the same time, a first prompt box is displayed in the playback interface, and the first prompt box prompts the user: "Experience more spatial audio data areas", and the first prompt box includes option buttons for three spatial audio resource areas, namely, option buttons for spatial audio resource area A, spatial audio resource area B, and spatial audio resource area C.
[0203] The specific implementation process inside the electronic device may refer to the above steps S415 to S417, namely:
[0204] In response to the user's operation of turning on the spatial audio function, the notification manager calls the setEnabled function to notify the spatial audio processing module (Spatializer) that the spatial audio function is turned on; the spatial audio processing module performs spatial audio sound effect processing on the first audio data to obtain first spatial audio data, and plays the first spatial audio data; the notification manager displays a first prompt box, which is used to recommend the user a spatial audio data area.
[0205] Optionally, before the electronic device displays a first prompt box in response to the spatial audio function switch being turned on, the method also includes: if the electronic device supports the spatial audio function and one or more applications are registered with the electronic device with permission, storing address information of a spatial audio data area corresponding to one or more applications; the one or more applications include the first application.
[0206] Further optionally, when an electronic device supports the spatial audio function and one or more applications are registered and licensed on the electronic device, the address information of the spatial audio data area corresponding to the one or more applications is stored. The specific implementation method may be: when the electronic device supports the spatial audio function, obtaining the storage service corresponding to the spatial audio function; in response to the one or more applications being registered and licensed on the electronic device, storing the address information of the spatial audio data area corresponding to the one or more applications based on the storage service corresponding to the spatial audio function.
[0207] It can be understood that, in response to the spatial audio function switch being turned on, before the first prompt box is displayed, the third-party application can proactively access the open capabilities of AudioKit to preset the address information of the corresponding spatial audio data area into the electronic device at startup or other appropriate times. Specifically, AudioKit provides an SDK interface for third-party applications to integrate and call. At startup or other appropriate times, the third-party application can call the corresponding interface of AudioKit to pre-store the address information corresponding to the spatial audio data area in the third-party application into the electronic device, thereby realizing the union with the third-party application. The third-party application can include one or more. The one or more third-party applications here can be considered as one or more applications.
[0208] Here, taking the third-party application as the first application as an example, the first application can actively execute the following when it is started or at other appropriate times: Figure 4A In steps S301 to S311 described in the embodiment, the address information of the spatial audio data area corresponding to the first application is pre-stored in the electronic device, that is:
[0209] The first application calls the isDeviceSupport function to determine whether the electronic device supports the audio open service through the audio service SDK (Audiokit); the audio service SDK notifies the first application that the electronic device has the audio open service; the first application calls the construct function to build an object for the audio service SDK; after the audio service SDK calls the init function for initialization, it calls the bindService function to notify the audio open service (AudioEngine) to bind the first application on the electronic device; after the audio open service binds the first application on the electronic device, it feeds back to the first application through the audio service SDK; the first application calls the getSupportedServices function to obtain the audio open service list from the audio open service through the audio service SDK; the audio open service feeds back the audio open service list to the first application through the audio service SDK; the first application calls the createService function to build an object for the audio service SDK; the audio service SDK calls the bindService function to notify the audio open service to bind the audio service ( that is, storage service); after the audio open service binds the audio service that supports spatial audio data storage to the first application, it feeds back to the first application through the audio service SDK; the first application calls the addSpatialZoneAddress function to notify the audio open service through the audio service SDK to store the address information of the spatial audio data zone corresponding to the first application; the audio open service calls the checkPermission function to confirm with the verification module (KitAssistantSDK) whether the first application has registered for permission; the verification module notifies the audio open service of the registration permission (that is, the verification is successful) for the first application; the audio open service calls the saveSpatialAudioZoneAddress function to store the address information of the spatial audio data zone corresponding to the first application; after the audio open service stores the address information of the spatial audio data zone corresponding to the first application, it feeds back the return value to the first application through the audio service SDK; the first application calls the destroy function to notify the audio service SDK to destroy the object, and the audio service SDK calls the unbindService function to notify the audio open service to unbind the audio service bound to the first application.
[0210] Further optionally, the method further includes: the electronic device displays a third prompt box in response to the failure of the third application to register; the third prompt box is used to prompt the user that the third application cannot use the spatial audio function. Based on this method, the user can be effectively notified of the failure of the third application to register, and the user is reminded that the third application may be dangerous, thereby improving the safety of the electronic device.
[0211] like Fig.6DAs shown, if the verification module of the electronic device fails to verify the third application when the third application is started (i.e., registration fails), this indicates that the third application may be dangerous, and the user needs to be prompted through a third prompt box: "The third application cannot use the spatial audio function normally."
[0212] Further optionally, the first prompt box includes an option of the spatial audio data zone corresponding to the one or more applications; the method also includes: the electronic device responds to the operation of triggering the option of the first spatial audio data zone, and based on the address information of the first spatial audio data zone, displays a recommendation interface corresponding to the first spatial audio data zone; the first spatial audio data zone is one of the spatial audio data zones corresponding to one or more applications.
[0213] It can be understood that the user can click on the option of a certain spatial audio data area (i.e., the first spatial audio data area) in the first prompt box, and the electronic device will jump to the recommendation interface corresponding to the first audio data area according to the previously stored address information. If the first spatial audio data area is the spatial audio data area corresponding to the first application, then it will continue to jump to the recommendation interface corresponding to the first audio data area in the first application; if the first spatial audio data area is the spatial audio data area corresponding to the second application (i.e., other applications), then it will jump from the playback interface of the first application to the recommendation interface corresponding to the first audio data area displayed in the second application. Based on this method, more spatial audio data can be intelligently recommended to users, improving user experience, and at the same time, it can achieve the effect of attracting other audio data or applications.
[0214] like Fig. 7A As shown, the first prompt box includes option buttons for spatial audio data area A, spatial audio data area B, and spatial audio data area C. Spatial audio data area A is the spatial audio data area corresponding to the first application, spatial audio data area B is the spatial audio data area corresponding to the second application, and spatial audio data area C is the spatial audio data area corresponding to the third application. The user clicks the option button of spatial audio data area A in the first prompt box (i.e., spatial audio data area A is the first spatial audio data area), and according to the address information of spatial audio data area A stored in advance, the recommendation interface corresponding to spatial audio data area A is displayed in the first application, and the recommendation interface corresponding to spatial audio data area A includes music A-singer 1, music B-singer 2, music C-singer 3, music D-singer 4, music E-singer 5, and music F-singer 6.
[0215] Another example Figure 7BAs shown, the first prompt box includes option buttons for spatial audio data area A, spatial audio data area B, and spatial audio data area C. Spatial audio data area A is the spatial audio data area corresponding to the first application, spatial audio data area B is the spatial audio data area corresponding to the second application, and spatial audio data area C is the spatial audio data area corresponding to the third application. The user clicks the option button of spatial audio data area B in the first prompt box (that is, spatial audio data area B is the first spatial audio data area), and according to the address information of spatial audio data area B pre-stored before, the user jumps from the first application to the second application to display the recommendation interface corresponding to spatial audio data area B, and the recommendation interface corresponding to spatial audio data area B includes music 1-singer a, music 2-singer b, music 3-singer c, music 4-singer d, music 5-singer e, and music 6-singer f.
[0216] Further optionally, the first spatial audio data zone is a spatial audio data zone corresponding to the first application, and the recommendation interface of the first spatial audio data zone includes options for the first spatial audio data and options for the second spatial audio data; the second spatial audio data is associated with the first spatial audio data.
[0217] It can be understood that the audio data in the same spatial audio data zone can be related, for example, they can be audio data of the same type, audio data in the same album, audio data sung by the same singer, audio data that the user has recently played, or audio data that the user likes, without limitation. Based on this method, other spatial audio data related to the current audio data can be intelligently recommended to the user, thereby improving the user experience.
[0218] For example, Figure 7C As shown in (a), the first application corresponds to the spatial audio data area A, and the recommendation interface corresponding to the spatial audio data area A includes music A-singer 1, music B-singer 2, music C-singer 3, music D-singer 4, music E-singer 5, and music F-singer 6. The music recommended in the spatial audio data area A is all music of the same type. For example, assuming that "music A-singer 1" is an option for the first spatial audio data, and "music B-singer 2" is an option for the first spatial audio data, then the music A and music B here are associated and are music of the same type, that is, the second spatial audio data is associated with the first spatial audio data.
[0219] For example, Figure 7CAs shown in (b), the first application corresponds to the spatial audio data area A, and the recommendation interface corresponding to the spatial audio data area A includes music A-singer 1, music B-singer 1, music C-singer 1, music D-singer 1, music E-singer 1, and music F-singer 1. The music recommended in the spatial audio data area A is all music sung by the same singer in the same album. For example, assuming that "Music A-singer 1" is an option for the first spatial audio data, and "Music B-singer 1" is an option for the first spatial audio data, then the music A and music B here are related, and are music sung by the same singer in the same album, that is, the second spatial audio data is associated with the first spatial audio data.
[0220] Optionally, the method further includes: when the spatial audio function is turned on, the electronic device responds to the operation of exiting the playback interface, plays the first spatial audio data in the background, and displays a floating window icon; the electronic device responds to the operation of triggering the floating window image, and displays a floating window interface; the floating window interface includes a spatial audio function switch and multiple spatial audio data areas, and the multiple spatial audio data areas correspond to the same or different applications. Based on this method, the convenience of playing spatial audio data can be improved, and the user experience can be improved.
[0221] like Fig.7D As shown, when the spatial audio function is turned on, music A (i.e., the first spatial audio data) processed by spatial audio sound effects is played in the first application. After the user exits the playback interface of the first application and returns to the desktop, the electronic device can continue to play the first spatial audio data in the background, and a floating window icon will be displayed on the desktop at this time. The user can click the floating window icon at any time to enter the floating window interface. The floating window interface includes the player of the first application, the spatial audio function switch, and option buttons for multiple spatial audio data areas. The user can conveniently switch songs, pause songs, play songs, etc. through the player of the first application in the floating window interface; the user can also directly control the opening or closing of the spatial audio function through the spatial audio function switch in the floating window interface. In addition, the option buttons of the multiple spatial audio data areas include option buttons for spatial audio data area A, option buttons for spatial audio data area B, and option buttons for spatial audio data area C, and the user can also switch spatial audio data areas by clicking the option buttons of these spatial audio data areas.
[0222] It can be seen that based on Figure 5 The described method can utilize the spatial audio technology of the electronic device and the channel-encoded audio resources of the third-party application to generate better spatial audio data when playing audio data, thereby realizing the combination between the electronic device and the third-party application, thereby effectively playing spatial audio data for users and improving the quality of music playback.
[0223] See also Figure 8 , Figure 8 A structural schematic diagram of an audio data playback device 800 according to an embodiment of the present application is shown. Figure 8 The audio data playback device shown may be an electronic device, or a device in an electronic device, or a device that can be used in conjunction with an electronic device. Figure 8 The audio data playing device shown may include a playing unit 801 and a processing unit 802 .
[0224] in:
[0225] A playing unit 801, configured to play the first audio data in response to a play operation on the first audio data in a play interface of the first application;
[0226] The processing unit 802 is configured to, when playing the first audio data, perform spatial audio effect processing on the first audio data based on attribute characteristics of the first audio data to obtain first spatial audio data in response to the first audio data being a media stream and the electronic device supporting a spatial audio function;
[0227] The playing unit 801 is further configured to play the first spatial audio data.
[0228] In one possible implementation, the processing unit 802, when performing spatial audio sound effect processing on the first audio data based on the attribute characteristics of the first audio data to obtain the first spatial audio data, is specifically used to: if the attribute characteristics of the first audio data do not include the first feature, perform spatial audio sound effect processing on the first audio data to obtain the first spatial audio data; the first feature indicates that the first audio data has been processed with spatial audio sound effects, or the first characteristic indicates that the first audio data is not allowed to be processed with spatial audio sound effects, or the first characteristic indicates that the processing delay of the first audio data is lower than a preset threshold.
[0229] In one possible implementation, the processing unit 802, if the attribute characteristics of the first audio data do not include the first feature, performs spatial audio sound effect processing on the first audio data to obtain the first spatial audio data, is specifically used to: if the attribute characteristics of the first audio data do not include the first feature, then when the spatial audio function is turned on, perform spatial audio sound effect processing on the first audio data to obtain the first spatial audio data.
[0230] In a possible implementation, the processing unit 802, when performing spatial audio and sound effect processing on the first audio data to obtain the first spatial audio data, is specifically used to: in response to the first audio data being multi-channel audio data, perform spatial audio and sound effect processing on the first audio data to obtain the first spatial audio data.
[0231] In one possible implementation, the playback interface includes a spatial audio function switch; the device also includes a display unit, the display unit being used to: in response to the spatial audio function switch being turned on, display a first prompt box; the first prompt box is used to recommend the user a spatial audio data area; in response to the spatial audio function switch not being turned on, display a second prompt box; the second prompt box is used to recommend the user to turn on the spatial audio function.
[0232] In one possible implementation, before the display unit displays the first prompt box in response to the spatial audio function switch being turned on, the device also includes a storage unit, which is used to: when the electronic device supports the spatial audio function and one or more applications are registered with the electronic device with permission, store address information of the spatial audio data area corresponding to the one or more applications; the one or more applications include the first application.
[0233] In one possible implementation, the first prompt box includes an option of a spatial audio data zone corresponding to the one or more applications; the display unit is further used to: in response to an operation of triggering the option of the first spatial audio data zone, display a recommendation interface corresponding to the first spatial audio data zone based on address information of the first spatial audio data zone; the first spatial audio data zone is one of the spatial audio data zones corresponding to one or more applications.
[0234] In a possible implementation, the first spatial audio data zone is a spatial audio data zone corresponding to the first application, and the recommendation interface of the first spatial audio data zone includes options for the first spatial audio data and options for the second spatial audio data; the second spatial audio data is associated with the first spatial audio data.
[0235] For the case where the audio data playback device may be a chip or a chip system, see Fig. 9 Schematic diagram of the chip structure shown. Fig. 9 The chip 900 shown includes a processor 901 and an interface 902. Optionally, it may also include a memory 903. The number of the processor 901 may be one or more, and the number of the interface 902 may be multiple.
[0236] For the case where the chip is used to implement the electronic device in the embodiment of the present application:
[0237] The interface 902 is used to receive or output signals;
[0238] The processor 901 is used to execute data processing operations of the electronic device.
[0239] It is understandable that some optional features in the embodiments of the present application may be implemented independently in certain scenarios without relying on other features, such as the solution on which they are currently based, to solve corresponding technical problems and achieve corresponding effects, or may be combined with other features according to needs in certain scenarios. Accordingly, the audio data playback device provided in the embodiments of the present application may also implement these features or functions accordingly, which will not be described in detail here.
[0240] It should be understood that the processor in the embodiment of the present application can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method embodiment can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor can be a general-purpose processor, a digital signal processor (digital signal processor, DSP), an application specific integrated circuit (application specific integrated circuit, ASIC), a field programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0241] It can be understood that the memory in the embodiments of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0242] The present application also provides an audio data playback system, which includes an electronic device; wherein the electronic device is used to execute the method executed by the electronic device in any of the above method embodiments.
[0243] The present application also provides a computer-readable storage medium, in which a computer program is stored. The computer program includes program instructions. When the program instructions are executed on an electronic device, the functions of any of the above method embodiments are implemented.
[0244] The present application also provides a computer program product. When the computer program product is executed on a computer, the computer can implement the functions of any of the above method embodiments.
[0245] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a high-density digital video disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).
[0246] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for playing audio data, characterized in that: Applied to electronic equipment, the method comprises: In response to a play operation on the first audio data in the play interface of the first application; When the first audio data is a media stream, the electronic device supports a spatial audio function, and the attribute characteristics of the first audio data do not include the first feature, performing spatial audio sound effect processing on the first audio data to obtain first spatial audio data, wherein the first feature indicates that the first audio data has been processed with spatial audio sound effects, or the first feature indicates that spatial audio sound effect processing is not allowed for the first audio data, or the first feature indicates that a processing delay of the first audio data is lower than a preset threshold; Playing the first spatial audio data; Displaying a first prompt box; the first prompt box is used to recommend a spatial audio data zone, the spatial audio data zone including a first spatial audio data zone corresponding to the first application and a second spatial audio data zone corresponding to the second application; An operation performed by the user on the second spatial audio data area is received, and a recommendation interface corresponding to the second spatial audio data area of the second application is displayed based on the address information of the second spatial audio data area; the recommendation interface corresponding to the second spatial audio data area includes one or more second spatial audio data, and the second spatial audio data is obtained by performing spatial audio sound effect processing on the second audio data when the second audio data is a media stream, the electronic device supports the spatial audio function, and the attribute characteristics of the second audio data do not include the first characteristics.
2. The method according to claim 1, characterized in that The performing spatial audio effect processing on the first audio data to obtain first spatial audio data includes: In the case that the first audio data is multi-channel audio data, spatial audio effect processing is performed on the first audio data to obtain first spatial audio data.
3. The method according to claim 1 or 2, characterized in that: The playback interface of the first application includes a spatial audio function switch; In response to the playing operation of the first audio data on the playing interface of the first application, when the first audio data is a media stream, the electronic device supports a spatial audio function, and the attribute characteristics of the first audio data do not include the first characteristic, performing spatial audio sound effect processing on the first audio data to obtain the first spatial audio data, the method further includes: Playing first audio data; Displaying a second prompt box, where the second prompt box is used to recommend the user to enable the spatial audio function; An operation of turning on the spatial audio function switch is received.
4. The method according to claim 1 or 2, characterized in that: The method further comprises: An operation performed by a user on the first spatial audio data area is received, and a recommendation interface corresponding to the first spatial audio data area of the first application is displayed based on the address information of the first spatial audio data area; the recommendation interface corresponding to the first spatial audio data area includes the first spatial audio data and third spatial audio data, the third spatial audio data is obtained by performing spatial audio sound effect processing on the third audio data when the third audio data is a media stream, the electronic device supports a spatial audio function, and the attribute characteristics of the third audio data do not include the first characteristics, and the first spatial audio data is associated with the third spatial audio data.
5. The method according to claim 1 or 2, characterized in that: The electronic device stores address information of a spatial audio data area corresponding to one or more applications, and the one or more applications include the first application and the second application.
6. The method according to claim 5, characterized in that When the one or more applications are registered with the electronic device for permission, the electronic device stores address information of a spatial audio data area corresponding to the one or more applications.
7. The method according to claim 6, characterized in that The electronic device includes an audio service software development kit SDK, an audio open service and a verification module, and the method further includes: The first application notifies the audio open service through the audio service SDK of address information of a first spatial audio data dedicated area storing the first application; In response to receiving the address information of the first spatial audio data area corresponding to the first application, the audio open service confirms with the verification module whether the first application is registered and permitted; In response to receiving the notification of the first application registration permission sent by the verification module, the audio open service stores address information of the first spatial audio data area corresponding to the first application.
8. The method according to claim 7, characterized in that Before the first application notifies the audio open service through the audio service SDK of address information of a first spatial audio data dedicated area storing the first application, the method further includes: The first application is bound to an audio service that supports spatial audio data storage through the audio service SDK.
9. The method according to claim 8, characterized in that The first application is bound to an audio service supporting spatial audio data storage through the audio service SDK, including: The first application notifies the audio open service through the audio service SDK to bind the first application on the electronic device; In response to receiving a notification sent by the audio open service through the audio service SDK that the first application is successfully bound to the electronic device, the first application sends a notification of obtaining an audio open service list to the audio open service through the audio service SDK; In response to receiving the audio open service list sent by the audio open service through the audio service SDK, the first application notifies the audio open service through the audio service SDK to bind the audio service supporting spatial audio data storage on the first application; A notification of successfully binding an audio service supporting spatial audio data storage on the first application is received.
10. The method according to any one of claims 7 to 9, characterized in that: The electronic device further includes an audio service module, a play monitoring module, an audio play configuration module and an audio attribute module, and the method further includes: In response to the first audio data being played in the electronic device, the play monitoring module sends a notification to the audio service module that the first audio data is played in the electronic device; In response to receiving the notification sent by the playback monitoring module that the first audio data is played in the electronic device, when the first audio data is a media stream and the electronic device supports a spatial audio function, the audio service module obtains configuration parameters of the first audio data from the audio playback configuration module; The audio service module obtains a set of attribute flag bits of the first audio data from the audio attribute module; When the attribute flag bit set of the first audio data does not include the first feature, the audio service module obtains the channel information of the first audio data from the audio playback configuration module; In a case where the first audio data is multi-channel audio data, the audio service module detects whether the spatial audio function is enabled.
11. The method according to claim 10, characterized in that The electronic device further includes an audio service extension module, a notification manager, and a spatial audio processing module, and the method further includes: The audio service module notifies the audio service extension module that the spatial audio function is not enabled; In response to receiving the notification sent by the audio service module that the spatial audio function is not enabled, the audio service extension module notifies the notification manager that the spatial audio function is not enabled; In response to receiving a notification sent by the audio service module that the spatial audio function is not turned on, the notification manager displays a second prompt box, where the second prompt box is used to recommend that the user turn on the spatial audio function; The notification manager notifies the spatial audio processing module that the spatial audio function is turned on in response to the operation of turning on the spatial audio function switch; In response to receiving the notification sent by the notification manager that the spatial audio function is enabled, the spatial audio processing module performs spatial audio sound effect processing on the first audio data to obtain first spatial audio data.
12. An electronic device, characterized in that: include: One or more processors, one or more memories; wherein the one or more memories are coupled to the one or more processors, the one or more memories are used to store computer program codes, the computer program codes include computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the method as described in any one of claims 1-11.
13. An audio data playback system, characterized in that: Comprising an electronic device; wherein, the electronic device is used to execute the method as described in any one of claims 1-11.
14. A chip, characterized in that: It comprises a processor and an interface, wherein the processor and the interface are coupled; the interface is used to receive or output signals, and the processor is used to execute code instructions so that the method described in any one of claims 1 to 11 is executed.
15. A computer storage medium, characterized in that The computer storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 11.
16. A computer program product, characterized in that When the computer program product is run on a computer, the computer is caused to execute the method according to any one of claims 1 to 11.
Citation Information
Patent Citations
System, method, and graphical user interface for selecting audio output mode of wearable audio output device
CN116578214A