CN117785312A - Audio playing method, electronic device and storage medium - Google Patents

Audio playing method, electronic device and storage medium Download PDF

Info

Publication number
CN117785312A
CN117785312A CN202211159721.8A CN202211159721A CN117785312A CN 117785312 A CN117785312 A CN 117785312A CN 202211159721 A CN202211159721 A CN 202211159721A CN 117785312 A CN117785312 A CN 117785312A
Authority
CN
China
Prior art keywords
target application
playing
audio
play
application program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211159721.8A
Other languages
Chinese (zh)
Inventor
李昕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Device Co Ltd
Original Assignee
Huawei Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Device Co Ltd filed Critical Huawei Device Co Ltd
Priority to CN202211159721.8A priority Critical patent/CN117785312A/en
Publication of CN117785312A publication Critical patent/CN117785312A/en
Pending legal-status Critical Current

Links

Landscapes

  • Telephone Function (AREA)

Abstract

The embodiment of the application provides an audio playing method, electronic equipment and a storage medium, wherein the method comprises the following steps: in response to a first broadcast control operation of a user, if the target application program is determined to be in an un-started state, executing a first process, wherein the first process comprises: starting a target application program; the media player of the electronic equipment is controlled to acquire pre-stored play source information, and corresponding audio is played based on the acquired play source information; the target application program is an audio and video application program which is used by a user last time, and the playing source information is playing source information of audio to be played by the target application program. When the target application program is in a non-started scene, a user clicks a control key, and simultaneously, the pre-stored playing source information is obtained and corresponding audio is played when the target application program is cold started, so that the user can play the corresponding audio by the electronic equipment of the user without waiting for a long time in the cold starting stage of the target program, and the user experience can be improved.

Description

Audio playing method, electronic device and storage medium
Technical Field
The present disclosure relates to the field of cold start technologies of playback sessions, and in particular, to an audio playback method, an electronic device, and a storage medium.
Background
A play control area (including a last song, play/pause and a next song button) is generally present on the interface of the control center of the terminal, and the user can control the terminal to start playing audio, such as starting playing music, by clicking a "play" button of the play control area.
In some scenarios, a user may control a third party music Application (APP) cold start on the terminal by clicking a "play" button of the play control area, and after the third party APP completes the cold start, play music may begin in response to the user clicking the "play" button.
However, it takes a certain time, generally 2-3 seconds, to start the application in cold mode, that is, after the user finishes clicking the "play" button and waits for 2-3 seconds, the user can hear the music, and the delay time of the play mode is longer, which affects the user experience.
Disclosure of Invention
In a scenario that a user clicks a key (such as a "play" key) of a play control area to control a third party APP on a terminal to play audio, the audio playing method can shorten the waiting time of the user (i.e., the time interval from the user clicking the "play" key to starting playing the corresponding audio), and improve the user experience.
In a first aspect, an embodiment of the present application provides an audio playing method, applied to an electronic device, where the method includes: in response to a first broadcast control operation of a user, if the target application program is determined to be in an un-started state, executing a first process, wherein the first process comprises: starting a target application program; the media player of the electronic equipment is controlled to acquire pre-stored play source information, and corresponding audio is played based on the acquired play source information; the target application program is an audio and video application program which is used by a user last time, and the playing source information is playing source information of audio to be played by the target application program. When the target application program is in an un-started scene, a user can take the media player as a proxy player when the target application program is cold started by clicking a control key of the broadcasting center window for the first time, play source information of the target application program is obtained, and corresponding audio is played through the media player based on the obtained play source information in a time delay stage of cold starting of the target application program, so that the user can hear the electronic equipment of the user to play the corresponding audio without long-time waiting in the cold starting stage of the target application program, and experience feeling of the user can be improved.
Further, after the electronic equipment is started, the media player is in a ready state, and plays corresponding audio based on the acquired play source information in the ready state. In a scene that the target application program needs to be cold started, the media player in the ready state plays corresponding audio based on the play source information, so that waiting time of a user can be reduced, and use experience of the user is improved.
Further, before responding to the first playing control operation of the user, if the target application program is determined to be in the non-started state, the method further comprises: and in the operation stage of the target application program, the playing source information is cached at the system side. In one aspect, in the starting stage of the target application, by caching the playing source information on the system side, the media player can perform proxy playing based on the playing source information cached on the system side before the target application is started, so that a user does not need to wait for the target application to start playing after cold starting, and user experience is improved. In still another aspect, the playing source information is cached at the system side, and when the target application program is killed, the relevant playing source information is not cleaned, so that the media player can still obtain the playing source information.
Further, the play source information includes a streaming media URL, a local file URI, or complete audio PCM data cached at the system side by the last time the target application was run. The play source may include a variety of forms as described above, providing a variety of caching forms to the user.
Further, in the running stage of the target application program, caching the play source information on the system side includes: and in the operation stage of the target application program, based on the playing sequence of the target application program, caching playing source information of the next audio to be played in the playing sequence on a system side. In one embodiment, in the audio playing stage, the target application program may cache the playing source information of the next audio to be played on the system side based on the playing sequence of the target application program. Therefore, in the scene that the target application program is killed (i.e. is in an unactuated state) and the user implements the first playing control operation, in order to respond to the first playing control operation of the user, the media player can acquire playing source information from the system side and play corresponding audio based on the playing source information, so that the stability of the playing source information buffer space is ensured. On the other hand, in order to save the storage space on the system side, only the play source information of the next head in the play order of the target application program may be cached on the system side.
Further, in the running stage of the target application program, caching the play source information on the system side includes: and in the operation stage of the target application program, based on the playing sequence of the target application program, caching playing source information of at least two subsequent audios to be played in the playing sequence of the target application program on a system side. Before the first procedure is implemented, the target application may perform multiple play control operations at the play center before the cold start is completed, for example, after the user clicks the play start control, the user clicks the next control, so at this time, the media player needs at least two pieces of play source information, and further, by caching at least two pieces of play source information in the play sequence of the target application program at the system side, the user may respond to the multiple play control operations at the play center, and play corresponding audio through the media player.
Further, in the running stage of the target application program, caching the play source information on the system side further includes: before the target application program is finished, the playing progress information of the current playing audio is cached at the system side. When the media player starts playing the audio based on the acquired playing source information, the media player can continue playing based on the playing progress information of the target application program. Illustratively, a user plays a song using a certain music APP before and pauses the play when playing to the 2 nd and 11 th seconds of the song, and when the user kills the music APP, the music APP can buffer the play progress information at the system side as a part of the play source information. Furthermore, after the media player acquires the playing source information, the media player can continue playing from the 2 nd minute and the 11 th second of the song based on the playing progress information, so that the user experience can be improved.
Further, in the first process, in response to the second playing control operation of the user, if it is determined that the target application program is still in an inactive state, the media player is controlled to play the corresponding audio based on the play source information.
Further, the first broadcast control operation of the user or the second broadcast control operation of the user includes: clicking operation of a key of a broadcasting center interface displayed on a display screen of the electronic equipment by a user; or the user performs play control operation on the audio device, wherein the audio device is connected with the electronic device and is used for playing the audio provided by the electronic device. Wherein, the broadcast control operation includes: the last first-play control operation, play/pause-play control operation or the next first-play control operation.
Further, the broadcasting center interface key at least comprises: a last first-play control key, a play/pause-play control key and a next first-play control key. In other embodiments, a play mode key may be further included, for example, in response to a user clicking the play mode key, to switch the current play mode to sequential play, single-track, or random play.
Further, when the first procedure is executed, if it is determined that the target application is already in the start state, the audio playing process is switched to play the audio through the target application. In the audio playing stage based on the acquired playing source information by the media player, if the target application program is determined to be in the starting state, the audio playing stage can be switched back to the audio playing stage by the target application program, more functions supported by the target application program can be provided for a user, and user experience is improved.
Further, if it is determined that the target application is already in the start state, switching to playing the audio through the target application includes: if the target application program is determined to be in the starting state, after the current audio is played by the media player, switching to continuously playing the next audio to be played by the target application program. In order to avoid the problem of jamming caused by switching the playing main body (the media player is switched to the target application program) in the audio playing process, when the switching condition is met (the target application program is in the starting state), whether the current audio is played is determined to be finished or not through the playing progress information of the current playing audio, and after the current audio is played by the media player, the next audio to be played is switched to be continuously played through the target application program, so that the user experience is improved.
In a second aspect, embodiments of the present application further provide an electronic device, including: the audio playback device comprises a processor and a memory for storing at least one instruction which, when loaded and executed by the processor, implements the audio playback method provided in the first aspect.
In a third aspect, embodiments of the present application further provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the audio playing method provided in the first aspect.
In a fourth aspect, embodiments of the present application further provide a computer program product, including a computer program or instructions, which when executed by a processor implement the audio playing method provided in the first aspect.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief description will be given below of the drawings that are needed in the embodiments or the prior art descriptions, it being obvious that the drawings in the following description are some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort to a person skilled in the art.
Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
FIG. 2 is a block diagram of the software architecture of an electronic device 100 according to an embodiment of the present invention;
fig. 3 is a schematic view of a scenario suitable for use in the embodiments of the present application;
FIG. 4 is a flow chart of a response of a cold start scene broadcast control in the related art;
fig. 5 is a flowchart of an audio playing method according to an embodiment of the present application;
fig. 6 is a schematic diagram of a play source information buffering process according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
To facilitate the description of the embodiments of the present solution, the following correspondingly explains the concepts related to the embodiments of the present application:
1. cold start: the system is started when there is no application process (i.e., the application is started for the first time or the application is in a non-surviving state). The application program is a music APP, a certain music APP of the terminal is in a survival state, and after the music APP is completely killed (Kill) (i.e. all processes related to the music APP are killed (Kill)), restarting the music APP is a cold start of the music APP.
2. A process (process) is a running activity of an application program on a certain data set, and is a basic unit of resource allocation and scheduling by an operating system (for example, an Android system). Each process occupies a memory space, and the application program runs on the operating system in the form of one or more processes to realize corresponding functions.
3. Playing session: the system only controls and updates the conversation by abstracting all the playing related behaviors into the conversation, so as to achieve the effect of uniformly managing the playing behaviors of all the applications, and the common functions include sending instructions of starting, pausing, next playing conversation or displaying the title, artist, album cover information and the like related to the playing content.
The implementation of the examples is described in detail below with reference to the accompanying drawings.
The audio playing method provided by the embodiment of the application can be applied to electronic devices such as mobile phones, tablet computers, handheld computers, personal digital assistants (personal digital assistant, PDAs), intelligent wearable devices, vehicle-mounted devices, virtual reality devices and the like, and the embodiment of the application is not limited in any way.
Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charge 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, keys 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identity module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It should be understood that the illustrated structure of the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
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 hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
The I2C interface is a bi-directional synchronous serial bus comprising a serial data line (SDA) and a serial clock line (derail clock line, SCL). In some embodiments, the processor 110 may contain multiple sets of I2C buses. The processor 110 may be coupled to the touch sensor 180K, charger, flash, camera 193, etc., respectively, through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through an I2C interface, such that the processor 110 communicates with the touch sensor 180K through an I2C bus interface to implement a touch function of the electronic device 100.
The I2S interface may be used for audio communication. In some embodiments, the processor 110 may contain multiple sets of I2S buses. The processor 110 may be coupled to the audio module 170 via an I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may transmit an audio signal to the wireless communication module 160 through the I2S interface, to implement a function of answering a call through the bluetooth headset.
PCM interfaces may also be used for audio communication to sample, quantize and encode analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface. In some embodiments, the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface to implement a function of answering a call through the bluetooth headset. Both the I2S interface and the PCM interface may be used for audio communication.
The UART interface is a universal serial data bus for asynchronous communications. The bus may be a bi-directional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is typically used to connect the processor 110 with the wireless communication module 160. For example: the processor 110 communicates with a bluetooth module in the wireless communication module 160 through a UART interface to implement a bluetooth function. In some embodiments, the audio module 170 may transmit an audio signal to the wireless communication module 160 through a UART interface, to implement a function of playing music through a bluetooth headset.
The MIPI interface may be used to connect the processor 110 to peripheral devices such as a display 194, a camera 193, and the like. The MIPI interfaces include camera serial interfaces (camera serial i nterface, CSI), display serial interfaces (display serial interface, DSI), and the like. In some embodiments, processor 110 and camera 193 communicate through a CSI interface to implement the photographing functions of electronic device 100. The processor 110 and the display 194 communicate via a DSI interface to implement the display functionality of the electronic device 100.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal or as a data signal. In some embodiments, a GPIO interface may be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface may also be configured as an I2C interface, an I2S interface, a UART interface, an MIPI interface, etc.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the electronic device 100, and may also be used to transfer data between the electronic device 100 and a peripheral device. And can also be used for connecting with a headset, and playing audio through the headset. The interface may also be used to connect other electronic devices, such as AR devices, etc.
It should be understood that the interfacing relationship between the modules illustrated in the embodiments of the present invention is only illustrative, and is not meant to limit the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also use different interfacing manners, or a combination of multiple interfacing manners in the foregoing embodiments.
The charge management module 140 is configured to receive a charge input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charge management module 140 may receive a charging input of a wired charger through the USB interface 130. In some wireless charging embodiments, the charge management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 140 may also supply power to the electronic device through the power management module 141 while charging the battery 142.
The power management module 141 is used for connecting the battery 142, and the charge management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 to power the processor 110, the internal memory 121, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be configured to monitor battery capacity, battery cycle number, battery health (leakage, impedance) and other parameters. In other embodiments, the power management module 141 may also be provided in the processor 110. In other embodiments, the power management module 141 and the charge management module 140 may be disposed in the same device.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed into a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution for wireless communication including 2G/3G/4G/5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA), etc. The mobile communication module 150 may receive electromagnetic waves from the antenna 1, perform processes such as filtering, amplifying, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can amplify the signal modulated by the modem processor, and convert the signal into electromagnetic waves through the antenna 1 to radiate. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be provided in the same device as at least some of the modules of the processor 110.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating 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. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs sound signals through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional module, independent of the processor 110.
The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (wirelesslocal area networks, WLAN) (e.g., wireless fidelity (wireless fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc., as applied to the electronic device 100. The wireless communication module 160 may be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via the antenna 2.
In some embodiments, antenna 1 and mobile communication module 150 of electronic device 100 are coupled, and antenna 2 and wireless communication module 160 are coupled, such that electronic device 100 may communicate with a network and other devices through wireless communication techniques. The wireless communication techniques may include the Global System for Mobile communications (global system for mobile communications, GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), wideband code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC, FM, and/or IR techniques, among others. The GNSS may include a global satellite positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GLONASS), a beidou satellite navigation system (beidou navigation satellite system, BDS), a quasi zenith satellite system (quasi-zenith satellite system, QZSS) and/or a satellite based augmentation system (satellite based augmentation systems, SBAS).
The electronic device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The display screen 194 is used to display images, videos, and the like. The display 194 includes a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED) or an active-matrix organic light-emitting diode (matrix organic light emitting diode), a flexible light-emitting diode (flex), a mini, a Micro led, a Micro-OLED, a quantum dot light-emitting diode (quantum dot light emitting diodes, QLED), or the like. In some embodiments, the electronic device 100 may include 1 or N display screens 194, N being a positive integer greater than 1.
The electronic device 100 may implement photographing functions through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
The ISP is used to process data fed back by the camera 193. For example, when photographing, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electric signal, and the camera photosensitive element transmits the electric signal to the ISP for processing and is converted into an image visible to naked eyes. ISP can also optimize the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in the camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transferred to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. In some embodiments, electronic device 100 may include 1 or N cameras 193, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process other digital signals besides digital image signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to fourier transform the frequency bin energy, or the like.
Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record video in a variety of encoding formats, such as: dynamic picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
The NPU is a neural-network (NN) computing processor, and can rapidly process input information by referencing a biological neural network structure, for example, referencing a transmission mode between human brain neurons, and can also continuously perform self-learning. Applications such as intelligent awareness of the electronic device 100 may be implemented through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, etc.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to enable expansion of the memory capabilities of the electronic device 100. The external memory card communicates with the processor 110 through an external memory interface 120 to implement data storage functions. For example, files such as music, video, etc. are stored in an external memory card.
The internal memory 121 may be used to store computer executable program code including instructions. The internal memory 121 may include a storage program area and a storage data area. The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data created during use of the electronic device 100 (e.g., audio data, phonebook, etc.), and so on. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like. The processor 110 performs various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
The electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or a portion of the functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also referred to as a "horn," is used to convert audio electrical signals into sound signals. The electronic device 100 may listen to music, or to hands-free conversations, through the speaker 170A.
A receiver 170B, also referred to as a "earpiece", is used to convert the audio electrical signal into a sound signal. When electronic device 100 is answering a telephone call or voice message, voice may be received by placing receiver 170B in close proximity to the human ear.
Microphone 170C, also referred to as a "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can sound near the microphone 170C through the mouth, inputting a sound signal to the microphone 170C. The electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C, and may implement a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may also be provided with three, four, or more microphones 170C to enable collection of sound signals, noise reduction, identification of sound sources, directional recording functions, etc.
The earphone interface 170D is used to connect a wired earphone. The headset interface 170D may be a USB interface 130 or a 3.5mm open mobile electronic device platform (open mobile terminal platform, OMTP) standard interface, a american cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The pressure sensor 180A is used to sense a pressure signal, and may convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The pressure sensor 180A is of various types, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a capacitive pressure sensor comprising at least two parallel plates with conductive material. The capacitance between the electrodes changes when a force is applied to the pressure sensor 180A. The electronic device 100 determines the strength of the pressure from the change in capacitance. When a touch operation is applied to the display screen 194, the electronic apparatus 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 may also calculate the location of the touch based on the detection signal of the pressure sensor 180A. In some embodiments, touch operations that act on the same touch location, but at different touch operation strengths, may correspond to different operation instructions. For example: and executing an instruction for checking the short message when the touch operation with the touch operation intensity smaller than the first pressure threshold acts on the short message application icon. And executing an instruction for newly creating the short message when the touch operation with the touch operation intensity being greater than or equal to the first pressure threshold acts on the short message application icon.
The gyro sensor 180B may be used to determine a motion gesture of the electronic device 100. In some embodiments, the angular velocity of electronic device 100 about three axes (i.e., x, y, and z axes) may be determined by gyro sensor 180B. The gyro sensor 180B may be used for photographing anti-shake. For example, when the shutter is pressed, the gyro sensor 180B detects the shake angle of the electronic device 100, calculates the distance to be compensated by the lens module according to the angle, and makes the lens counteract the shake of the electronic device 100 through the reverse motion, so as to realize anti-shake. The gyro sensor 180B may also be used for navigating, somatosensory game scenes.
The air pressure sensor 180C is used to measure air pressure. In some embodiments, electronic device 100 calculates altitude from barometric pressure values measured by barometric pressure sensor 180C, aiding in positioning and navigation.
The magnetic sensor 180D includes a hall sensor. The electronic device 100 may detect the opening and closing of the flip cover using the magnetic sensor 180D. In some embodiments, when the electronic device 100 is a flip machine, the electronic device 100 may detect the opening and closing of the flip according to the magnetic sensor 180D. And then according to the detected opening and closing state of the leather sheath or the opening and closing state of the flip, the characteristics of automatic unlocking of the flip and the like are set.
The acceleration sensor 180E may detect the magnitude of acceleration of the electronic device 100 in various directions (typically three axes). The magnitude and direction of gravity may be detected when the electronic device 100 is stationary. The electronic equipment gesture recognition method can also be used for recognizing the gesture of the electronic equipment, and is applied to horizontal and vertical screen switching, pedometers and other applications.
A distance sensor 180F for measuring a distance. The electronic device 100 may measure the distance by infrared or laser. In some embodiments, the electronic device 100 may range using the distance sensor 180F to achieve quick focus.
The proximity light sensor 180G may include, for example, a Light Emitting Diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 detects infrared reflected light from nearby objects using a photodiode. When sufficient reflected light is detected, it may be determined that there is an object in the vicinity of the electronic device 100. When insufficient reflected light is detected, the electronic device 100 may determine that there is no object in the vicinity of the electronic device 100. The electronic device 100 can detect that the user holds the electronic device 100 close to the ear by using the proximity light sensor 180G, so as to automatically extinguish the screen for the purpose of saving power. The proximity light sensor 180G may also be used in holster mode, pocket mode to automatically unlock and lock the screen.
The ambient light sensor 180L is used to sense ambient light level. The electronic device 100 may adaptively adjust the brightness of the display 194 based on the perceived ambient light level. The ambient light sensor 180L may also be used to automatically adjust white balance when taking a photograph. Ambient light sensor 180L may also cooperate with proximity light sensor 180G to detect whether electronic device 100 is in a pocket to prevent false touches.
The fingerprint sensor 180H is used to collect a fingerprint. The electronic device 100 may utilize the collected fingerprint feature to unlock the fingerprint, access the application lock, photograph the fingerprint, answer the incoming call, etc.
The temperature sensor 180J is for detecting temperature. In some embodiments, the electronic device 100 performs a temperature processing strategy using the temperature detected by the temperature sensor 180J. For example, when the temperature reported by temperature sensor 180J exceeds a threshold, electronic device 100 performs a reduction in the performance of a processor located in the vicinity of temperature sensor 180J in order to reduce power consumption to implement thermal protection. In other embodiments, when the temperature is below another threshold, the electronic device 100 heats the battery 142 to avoid the low temperature causing the electronic device 100 to be abnormally shut down. In other embodiments, when the temperature is below a further threshold, the electronic device 100 performs boosting of the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperatures.
The touch sensor 180K, also referred to as a "touch device". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is for detecting a touch operation acting thereon or thereabout. The touch sensor may communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to touch operations may be provided through the display 194. In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100 at a different location than the display 194.
The bone conduction sensor 180M may acquire a vibration signal. In some embodiments, bone conduction sensor 180M may acquire a vibration signal of a human vocal tract vibrating bone pieces. The bone conduction sensor 180M may also contact the pulse of the human body to receive the blood pressure pulsation signal. In some embodiments, bone conduction sensor 180M may also be provided in a headset, in combination with an osteoinductive headset. The audio module 170 may analyze the voice signal based on the vibration signal of the sound portion vibration bone block obtained by the bone conduction sensor 180M, so as to implement a voice function. The application processor may analyze the heart rate information based on the blood pressure beat signal acquired by the bone conduction sensor 180M, so as to implement a heart rate detection function.
The keys 190 include a power-on key, a volume key, etc. The keys 190 may be mechanical keys. Or may be a touch key. The electronic device 100 may receive key inputs, generating key signal inputs related to user settings and function controls of the electronic device 100.
The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration alerting as well as for touch vibration feedback. For example, touch operations acting on different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 191 may also correspond to different vibration feedback effects by touching different areas of the display screen 194. Different application scenarios (such as time reminding, receiving information, alarm clock, game, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
The indicator 192 may be an indicator light, may be used to indicate a state of charge, a change in charge, a message indicating a missed call, a notification, etc.
The SIM card interface 195 is used to connect a SIM card. The SIM card may be inserted into the SIM card interface 195, or removed from the SIM card interface 195 to enable contact and separation with the electronic device 100. The electronic device 100 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 195 may support Nano SIM cards, micro SIM cards, and the like. The same SIM card interface 195 may be used to insert multiple cards simultaneously. The types of the plurality of cards may be the same or different. The SIM card interface 195 may also be compatible with different types of SIM cards. The SIM card interface 195 may also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to realize functions such as communication and data communication. In some embodiments, the electronic device 100 employs esims, i.e.: an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
The software system of the electronic device 100 may employ a layered architecture, an event driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. In the embodiment of the invention, taking an Android system with a layered architecture as an example, a software structure of the electronic device 100 is illustrated.
Fig. 2 is a software configuration block diagram of the electronic device 100 according to the embodiment of the present invention.
The layered architecture divides the software into several layers, each with distinct roles and branches. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, from top to bottom, an application layer, an application framework layer, an Zhuoyun row (Android run) and system libraries, and a kernel layer, respectively.
The application layer may include a series of application packages.
As shown in fig. 2, the application package may include applications for cameras, gallery, calendar, phone calls, maps, navigation, WLAN, bluetooth, music, video, short messages, etc.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for application programs of the application layer. The application framework layer includes a number of predefined functions.
As shown in FIG. 2, the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.
The window manager is used for managing window programs. The window manager can acquire the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
The content provider is used to store and retrieve data and make such data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phonebooks, etc.
The view system includes visual controls, such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, a display interface including a text message notification icon may include a view displaying text and a view displaying a picture.
The telephony manager is used to provide the communication functions of the electronic device 100. Such as the management of call status (including on, hung-up, etc.).
The resource manager provides various resources for the application program, such as localization strings, icons, pictures, layout files, video files, and the like.
The notification manager allows the application to display notification information in a status bar, can be used to communicate notification type messages, can automatically disappear after a short dwell, and does not require user interaction. Such as notification manager is used to inform that the download is complete, message alerts, etc. The notification manager may also be a notification in the form of a chart or scroll bar text that appears on the system top status bar, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in a status bar, a prompt tone is emitted, the electronic device vibrates, and an indicator light blinks, etc.
Android run time includes a core library and virtual machines. Android run time is responsible for scheduling and management of the Android system.
The core library consists of two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. The virtual machine executes java files of the application program layer and the application program framework layer as binary files. The virtual machine is used for executing the functions of object life cycle management, stack management, thread management, security and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface manager (surface manager), media Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., openGL ES), 2D graphics engines (e.g., SGL), etc.
The surface manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
Media libraries support a variety of commonly used audio, video format playback and recording, still image files, and the like. The media library may support a variety of audio and video encoding formats, such as MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, etc.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like.
The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
The workflow of the electronic device 100 software and hardware is illustrated below in connection with capturing a photo scene.
When touch sensor 180K receives a touch operation, a corresponding hardware interrupt is issued to the kernel layer. The kernel layer processes the touch operation into the original input event (including information such as touch coordinates, time stamp of touch operation, etc.). The original input event is stored at the kernel layer. The application framework layer acquires an original input event from the kernel layer, and identifies a control corresponding to the input event. Taking the touch operation as a touch click operation, taking a control corresponding to the click operation as an example of a control of a camera application icon, the camera application calls an interface of an application framework layer, starts the camera application, further starts a camera driver by calling a kernel layer, and captures a still image or video by the camera 193.
The following describes in detail an audio playing method provided in the embodiments of the present application with reference to the accompanying drawings.
Fig. 3 is a schematic view of a scenario suitable for use in the embodiment of the present application.
Referring to fig. 3, a user operates the electronic device 100, and illustratively, the user performs a sliding operation along a top-to-bottom direction on a screen of the electronic device 100, so that the electronic device 100 displays a control center interface A1, where the control center interface A1 may include a broadcasting center window w1, and the broadcasting center window w1 has keys for controlling a media player, which are a play/pause key B1, a previous key B2, and a next key B3, respectively.
By clicking a key of the media player in the broadcasting center window w1, the user can use the media player to play the recently played audio of the target Application program (APP), specifically, the Application program that is completely killed (kill) after use. Illustratively, the user playing audio last time is playing music (e.g., "waiting you for lessons" -Zhou Jielun) through a third party application (target application) and the third party application is killed completely. After the user clicks the play button B1, the media player may continue playing music "etc. you are in class" -Zhou Jielun.
Fig. 4 is a flow chart of a related art cold start scene play control response.
Referring to fig. 4, in this scenario, the user clicks a key of the media player in the broadcasting center window w1 to make the media player continue to play the audio recently played by the third party application (for example, continue to play music), which is implemented as follows:
step 401: and responding to the broadcasting control operation of the broadcasting control center of the electronic equipment by the user, and cold starting the target application program by the electronic equipment.
After the electronic equipment identifies the broadcasting control operation of the user on the broadcasting control center of the electronic equipment, whether the target application program is in a starting state or not can be monitored, and if the target application program is not in the starting state, the target application program is controlled to be started in a cold mode.
Step 402: after the target application completes cold start, the electronic equipment controls the media player to acquire the play source information of the target application, and plays corresponding audio based on the acquired play source information.
After the playing session determines that the target application program is currently in a starting state (i.e. after the target application program is cold started), the media player can be controlled to acquire playing source information from the system side, so that the media player plays corresponding audio based on the acquired playing source information.
In the related art shown in fig. 4, after the target application program is controlled to be cold started, the media controller obtains the playing source information of the audio to be played of the target application program after the cold start is completed, and plays the audio based on the obtained playing source information. However, it takes a certain time to cold-start the target application, and it takes 2 to 3 seconds for the target application to cold-start, for example. Therefore, when the user clicks the key of the broadcasting center, a Media control key (Media Button) broadcasting command is sent through the Media Controller (Media Controller) until the broadcasting command starts to play the audio, which may delay for a period of time and affect the experience of the user.
In order to overcome the technical problems described above, embodiments of the present application provide an audio playing method, by which, in a cold start stage of a target application, based on system cache information corresponding to audio and video data recently played by the target application, a media player is used as a proxy player to play audio and video recently played by the target application, so that a user can hear the player to play corresponding audio and video without waiting for a certain time delay in the cold start stage, and experience of the user is improved.
Fig. 5 is a flowchart of an audio playing method according to an embodiment of the present application.
Referring to fig. 5, the audio playing method may include the steps of:
step 501: in response to the first playing control operation of the user, the electronic device determines whether the target application program is in a startup state, if the target application is in a startup state, step 502 is executed, and if the target application is in a non-startup state, step 503 is executed.
Wherein, in response to a first play control operation by the user, the Media controller sends a play control (Media Button) instruction to the play session.
In one embodiment, as shown in fig. 3, the user's play control operation may include: the user performs a sliding operation along the top-to-bottom direction on the screen of the electronic device 100, so that the electronic device 100 displays the control center interface A1, and the user clicks a control key of the broadcasting center window w 1.
In one application scenario of the embodiment shown in fig. 5, the user clicks a key of the media player in the broadcasting center window w1 to make the media player continue to play the audio recently played by the third party application (e.g., continue to play music).
In one embodiment, the first multicast operation in response to the user may be: and responding to the broadcasting control operation of the user to the broadcasting control center of the electronic equipment.
The user controls the electronic device to play audio (e.g. play music) by clicking a key (e.g. a "play" key) of the play center window w 1. Audio playback may be achieved through cooperation of a Media Controller (Media Controller) and a Media Player (Media Player) of the electronic device 100.
The Media Controller (Media Controller) is an android control that matches the Media Player (Media Player). It mainly integrates some control interfaces that are very classical for media players, which may include play/pause, last, next, etc.
Within the operating system of the electronic device 100, the Session may be implemented by a play Session (Media Session) mechanism, where the play Session may receive and process play control instructions sent by a Media Controller (Media Controller), such as play, pause, skip to previous song, skip to next song instructions. Further, when the user clicks a key of the electronic device 100 broadcasting the center window w1, the Media Controller (Media Controller) may send a corresponding play control (Media Button) instruction to the play session.
After the user clicks the control Button on the broadcasting center window w1, the Media Controller (Media Controller) transmits a Media control Button (Media Button) broadcasting control instruction to the broadcasting Session (Media Session) in response to the clicking operation of the user.
The playback session, upon receiving a playback control command from a Media Controller (Media Controller), may determine whether the target application is currently in a startup state. In one embodiment, the playback session may determine whether the target application is in a startup state based on the listening data of the application management system (application management system, AMS), and if the target application is determined to be in an un-startup state based on the listening data of the AMS, the AMS may initiate the target application by sending a broadcast. The AMS can manage the process and the application and is responsible for starting monitoring work.
For a cold start scenario, the application registration static broadcast receiver (Broadcast Receiver) is required, and the target application static broadcast receiver (Broadcast Receiver) triggers the target application start after receiving the AMS transmitted broadcast.
In another embodiment, the user connects to other audio devices using the electronic device 100, and illustratively, the user connects to headphones or a speaker device using a mobile phone. Taking the mobile phone connected with the Bluetooth headset as an example, after the mobile phone is connected with the Bluetooth headset, a mobile phone screen (screen locking interface) pops up a broadcasting control center window, and a user can finish broadcasting control operation of the mobile phone by clicking a broadcasting control key of the broadcasting control center window.
In one embodiment, the first multicast operation in response to the user may be further: responsive to a control operation of the audio device connected to the electronic device by the user.
The location clicked by the user may also be an audio device connected to the electronic device 100, for example, an earphone, where the user sends a corresponding play control instruction (such as a "play start instruction") by controlling the earphone, and the media controller may receive the play control instruction sent by the earphone and send the corresponding instruction to the play session.
And then the playing session can monitor whether the target application program is in a starting state, and if the target application program is in an un-starting state, the target application program can be started in a cold mode by sending a broadcast. Since the instruction is an instruction sent by an external audio device connected to the electronic device 100, the target application needs to receive the broadcast indicating the cold start of the target application through the media control key receiver (Media Button Receiver), and then the target application starts after receiving the broadcast.
After the target application program is started, the playing session connection of the target application program can be completed, and then the target application program can play audio in the playing session connection state.
Step 502: and continuing playing through the target application program.
If it is determined that the target application program is in the start state, that is, the play session of the target application program is in the connection state, the play session of the target application program may receive and process the play command sent by the media controller, and execute the play command in the received play command. In one embodiment, the playing source information of the target application program may include audio playing progress information of the target application program, and the media player may continue playing based on the audio playing progress information of the target application program, in other words, may continue playing based on the playing history of the user when playing using the target application program. Illustratively, the target application is a music APP that the user previously played the song using and paused when playing to the 2 nd and 11 th seconds of the song. If the user clicks the key of the broadcasting center window w1 (e.g. the "play" key), the media player can continue playing from the 2 nd and 11 th seconds of the song.
Wherein, in response to the user operation, the Media controller may send a Media Button (Media Button) play control instruction to the play session, and the play session may implement play through the following step 503.
As shown in fig. 5, after determining that the target application is not in the start state in step 501, the electronic device 100 may perform playing processing through two parallel flows, specifically, for two parallel flows, one branch is to control the target application to start and resume the playing session of the target application (implemented according to step 503a and step 503 b), and the other branch is to play the target audio through the media player of the electronic device 100 before the target application is started, and after resuming the playing session of the target application, continue playing the audio through the playing session of the application (implemented according to step 503c, step 503d, step 503e and step 503 f), and the specific scheme is as follows:
step 503a: the electronic device starts the target application.
When it is determined that the target application is not in the start state, cold start is required to be performed on the target application. In one embodiment, the AMS sends the corresponding broadcast and the target application executes step 503c after starting the player service within a broadcast reception callback (onReceiver).
Step 503b: and the electronic equipment restores the playing session connection corresponding to the target application program.
After the target application program is started, in order to enable the target application program to receive and process the playing control instruction sent by the media controller, the playing session connection corresponding to the target application program needs to be restored.
Step 503c: the electronic equipment controls the media player to acquire playing source information from the system side.
It should be noted that, in the embodiment of the present application, the execution sequence of the step 503a and the step 503c is not limited.
The playing source information of the system side is the playing source information of the target application program cached at the system side in the starting stage. In one embodiment, the play source information includes a streaming media URL, a local file URI, or complete audio PCM data.
Fig. 6 is a schematic diagram of a play source information buffering process according to an embodiment of the present application.
Referring to fig. 6, the play source information caching process may include the steps of:
step 601: the electronic device controls the application to start.
Step 602: the electronic device controls the application program to play the audio and video.
Step 603: the electronic device determines whether the application program starts the system cache function, if so, executes step 604, and if not, executes step 605.
Step 604: the electronic equipment caches the playing source information of the application program on the system side.
In one embodiment, the system framework service layer of the electronic device 100 may store the play source information in the system internal database, so as to store the play source information in the system own database (i.e. the system side). And when the target application program is not in the starting state, the media player can be controlled to perform proxy play based on the obtained play source information by obtaining the play source information from the system side.
In one embodiment, the target application program may only cache the playing source information of a song on the system side, specifically, the target application program may cache the playing source information of the next song to be played in the playing sequence on the system side based on the playing sequence of the target application program in the starting stage, and when the currently played audio is played to the set progress, the playing source information of the next song to be played in the playing sequence is cached on the system side based on the playing sequence of the target application program, if the system side caches the historical playing source information, the historical playing source information can be replaced by the playing source information to be cached currently, so that the storage space of the system side is saved. The setting progress may be when the length of the audio to be played of the audio currently played is n seconds, where n is a natural number.
In another embodiment, the target application program may cache the play source information of at least two songs in the play order on the system side, specifically, the target application program may cache the play source information of at least two subsequent songs to be played in the play order on the system side based on the play order of the target application program in the start stage, and when the last one of the cached play source information is played to the set progress based on the play order of the target application program, the play source information of at least two subsequent songs to be played in the play order is cached on the system side based on the play order of the target application program, and similarly, if the system side caches the historical play source information, the historical play source information may be replaced by the current play source information to be cached, so as to save the storage space of the system side.
Step 605: the popup displays inquiry information of whether to start the system cache function, and executes corresponding instructions in response to user operation.
If the user selects to start the system cache function, the current application starts the function of caching the play source information to the system side based on the user operation, and after the system cache function is started, the play source information is cached to the system side, wherein the caching mode can be the caching mode provided by any one embodiment of the application.
If the user selects not to start the cache function, the current application keeps the switch state of the current system cache function.
After the playing source information is cached in the system, the current application continues to play control according to the operation instruction of the user until the user finishes using the playing source information, and the application process is selected to be ended.
In one embodiment, when the user finishes the current application process, the playing source information cached by the system side may be playing source information of the audio played by the user last in the application, and may include playing progress information of the audio played last.
The embodiment shown in fig. 6 can buffer the play source information at the system side during the running process of the target application program.
Step 503d: the media player plays the audio based on the acquired play source information.
In one embodiment, the media player further includes playing progress information of the target application program in the playing source information acquired by the system side, and when the media player starts playing the audio based on the acquired playing source information, the media player can continue playing based on the playing progress information of the target application program. An exemplary target application is a music APP that a user previously plays a song using and pauses playing when playing to the 2 nd and 11 th seconds of the song, and when the user kills the music APP, the music APP may cache the playing progress information on the system side as part of the playing source information. Further, after the media player acquires the play source information, the media player may continue playing from the 2 nd and 11 th seconds of the song based on the play progress information.
During playing of the corresponding audio by the media player based on the play source information acquired from the system side (i.e., when the first procedure is performed), the electronic device 100 may also respond to the second play control operation of the user, and may also determine whether the target application is in the start state again. And according to the determined result, if the target application program is still in an un-started state (the un-started state is not completed), continuing to control the media player to play the audio based on the acquired play source information. If it is determined that the target application is in a startup state (startup is completed), switching to playing audio through the target application may be performed.
In one embodiment, the second multicast operation in response to the user may be: and responding to the broadcasting control operation of the user to the broadcasting control center of the electronic equipment.
In another embodiment, the second multicast operation in response to the user may be further: responsive to a control operation of the audio device connected to the electronic device by the user.
In one embodiment, the second multicast operation is the same or similar to the first multicast operation.
In an exemplary scenario in which the user performs the play control operation on the play center of the electronic device, after the user clicks the control key in the play center window w1, the user may still continue to click the control key in the play center window w1, and in an exemplary scenario, after the user clicks the play key B1 in the play center window w1, the user wants to switch to the next piece of music, clicks the next key B3, and in response to the user clicking the next key B3, the media controller sends a "next" play control instruction to the target application program. In order to ensure that the target application program can receive and process the next play control instruction sent by the media controller, the play session connection corresponding to the target application program should be restored after the target application program is started. Therefore, in the stage of playing the audio by the playing session control media player, it can be determined whether the application playing session state of the target application program is restored to be connected, which is specifically implemented as follows:
Step 503e: the electronic device determines whether the playback session state of the target application is restored, if so, executes step 503f, and if not, returns to step 503d.
Step 503f: and the electronic equipment is switched to the target application program to continue playing.
In one embodiment, after determining that the application playing session has been restored to the connection, and before executing step 503f, it may further be determined whether the playing of the piece of music played by the media player is completed, specifically, the playing session may determine whether the playing of the piece of music played by the media player is completed by monitoring the current playing progress of the media player. And if the playing is completed, switching to the target application program to continue playing. After the media player is determined to play the music, switching to the target application program to play the next music based on the playing sequence, and if the media player does not play the music, waiting for the media player to play the application playing session path of the target application program to continue playing after the media player finishes playing the music, so that the influence of blank time waiting for switching on user experience caused by the fact that the switching is performed in the process of playing the music by the media player is avoided.
Based on the above manner, when the target application program is in an un-started scene, the user first clicks the control key of the broadcasting center window w1, and simultaneously, the media player can be used as a proxy player to obtain the broadcasting source information of the target application program cached at the system side, and the audio corresponding to the broadcasting source information is broadcasted in the time delay stage of the cold start of the target application program, so that the user can hear the electronic equipment of the user to broadcast the corresponding audio without long-time waiting in the cold start stage of the target application program, and the experience of the user can be improved.
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application, as shown in fig. 7, where the device may include a processor 701 and a memory 702, where the memory 702 is configured to store at least one instruction, and the instruction is loaded and executed by the processor 701 to implement an audio playing method according to any embodiment of the present application. In an implementation manner, the hardware structure of the electronic device provided in the embodiment of the present application may be the same as or similar to the structure of the electronic device 100 shown in fig. 1, and will not be described herein. In one implementation, the software structure provided in the embodiment of the present application may be the same as or similar to the software structure of the electronic device 100 shown in fig. 2, and will not be described herein.
The embodiment of the application also provides a computer storage medium, on which a computer program is stored, the computer program implementing the audio playing method provided by any embodiment of the application when being executed by a processor.
The embodiments of the present application also provide a computer program product, including a computer program or instructions, which when executed by a processor, implement the audio playing method provided in any of the embodiments of the present application.
It may be understood that the application may be an application program (native app) installed on the terminal, or may also be a web page program (webApp) of a browser on the terminal, which is not limited in this embodiment of the present application.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the elements is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple elements or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in hardware plus software functional units.
The integrated units implemented in the form of software functional units described above may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium, and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a Processor (Processor) to perform part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing description of the preferred embodiments of the present invention is not intended to limit the invention to the precise form disclosed, and any modifications, equivalents, improvements and alternatives falling within the spirit and principles of the present invention are intended to be included within the scope of the present invention.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims (14)

1. An audio playing method applied to an electronic device, wherein the method comprises the following steps:
in response to a first broadcast control operation of a user, if the target application program is determined to be in an un-started state, executing a first procedure, wherein the first procedure comprises:
starting the target application program; and
controlling a media player of the electronic equipment to acquire pre-stored play source information, and playing corresponding audio based on the acquired play source information;
The target application program is an audio and video application program which is used by a user last time, and the playing source information is playing source information of audio to be played by the target application program.
2. The method of claim 1, wherein the media player is in a ready state after the electronic device is booted, the media player playing the corresponding audio based on the acquired play source information in the ready state.
3. The method of claim 1, further comprising, prior to said executing the first procedure in response to the first multicast operation by the user if the target application is determined to be in an inactive state:
and in the operation stage of the target application program, caching the playing source information on a system side.
4. A method according to claim 1 or 3, characterized in that the play-out source information comprises a streaming URL, a local file URI or complete audio PCM data cached at the system side by the last run of the target application.
5. The method of claim 3, wherein said caching said play source information at a system side during said target application running phase comprises:
And in the operation stage of the target application program, based on the playing sequence of the target application program, caching playing source information of the next audio to be played in the playing sequence on a system side.
6. The method of claim 3, wherein said caching said play source information at a system side during said target application running phase comprises:
and in the operation stage of the target application program, based on the playing sequence of the target application program, caching playing source information of at least two subsequent audios to be played in the playing sequence on a system side.
7. The method according to claim 3, 5 or 6, wherein, at the target application running stage, caching the play source information on a system side further comprises:
before the target application program is finished, the playing progress information of the audio played by the target application program is cached at the system side.
8. The method of claim 1, 3, 5 or 6, wherein the first procedure is performed in response to a second playback operation by a user, and wherein the media player is controlled to play the corresponding audio based on the play source information if it is determined that the target application is still in an inactive state.
9. The method of claim 8, wherein the first multicast operation of the user or the second multicast operation of the user comprises:
clicking operation of a key of a broadcasting center interface displayed on a display screen of the electronic equipment by a user; or alternatively
And the playing control operation of the audio equipment is carried out by a user, wherein the audio equipment is connected with the electronic equipment and is used for playing the audio provided by the electronic equipment.
10. The method of claim 9, wherein the broadcast center interface key comprises at least:
a last first-play control key, a play/pause-play control key and a next first-play control key.
11. The method of claim 7, wherein upon executing the first flow, switching to playing audio through the target application if it is determined that the target application is already in a startup state.
12. The method of claim 11, wherein if the target application is determined to be already in the active state, switching to playing audio through the target application comprises:
if the target application program is determined to be in the starting state, after the current audio is played by the media player, switching to continuously playing the next audio to be played by the target application program.
13. An electronic device, the electronic device comprising:
a processor and a memory for storing at least one instruction that when loaded and executed by the processor implements the audio playback method of any one of claims 1-12.
14. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the audio playback method of any one of claims 1-12.
CN202211159721.8A 2022-09-22 2022-09-22 Audio playing method, electronic device and storage medium Pending CN117785312A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211159721.8A CN117785312A (en) 2022-09-22 2022-09-22 Audio playing method, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211159721.8A CN117785312A (en) 2022-09-22 2022-09-22 Audio playing method, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN117785312A true CN117785312A (en) 2024-03-29

Family

ID=90398784

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211159721.8A Pending CN117785312A (en) 2022-09-22 2022-09-22 Audio playing method, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN117785312A (en)

Similar Documents

Publication Publication Date Title
CN113542839B (en) Screen projection method of electronic equipment and electronic equipment
WO2021000807A1 (en) Processing method and apparatus for waiting scenario in application
CN110430324B (en) Display method, electronic equipment and storage medium for application screen opening information
CN111628916B (en) Method for cooperation of intelligent sound box and electronic equipment
CN116564304A (en) Voice interaction method and device
US11489972B2 (en) Method for presenting video on electronic device when there is incoming call and electronic device
CN114040242B (en) Screen projection method, electronic equipment and storage medium
CN116360725B (en) Display interaction system, display method and device
WO2021052139A1 (en) Gesture input method and electronic device
JP2022547572A (en) callback stream processing method and device
WO2021104122A1 (en) Method and apparatus for responding to call request, and electronic device
WO2020062014A1 (en) Method for inputting information into input box and electronic device
WO2022242412A1 (en) Method for killing application, and related device
CN114500728B (en) Incoming call bell setting method, incoming call prompting method and electronic equipment
CN113645595B (en) Equipment interaction method and device
CN117785312A (en) Audio playing method, electronic device and storage medium
CN115460445B (en) Screen projection method of electronic equipment and electronic equipment
CN116048629B (en) System service switching method, control device, electronic equipment and storage medium
CN116723384B (en) Process control method, electronic device and readable storage medium
CN116017138B (en) Light measuring control display method, computer equipment and storage medium
CN116048831B (en) Target signal processing method and electronic equipment
CN116719376B (en) Voltage control method, device, equipment and storage medium
CN116795604B (en) Processing method, device and equipment for application exception exit
CN114205318B (en) Head portrait display method and electronic equipment
WO2020029213A1 (en) Method for answering or rejecting call during srvcc handover

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination