WO2020103076A1 - 音频播放处理方法、装置、终端和计算机可读存储介质 - Google Patents

音频播放处理方法、装置、终端和计算机可读存储介质

Info

Publication number
WO2020103076A1
WO2020103076A1 PCT/CN2018/116908 CN2018116908W WO2020103076A1 WO 2020103076 A1 WO2020103076 A1 WO 2020103076A1 CN 2018116908 W CN2018116908 W CN 2018116908W WO 2020103076 A1 WO2020103076 A1 WO 2020103076A1
Authority
WO
WIPO (PCT)
Prior art keywords
audio
audio track
releasable
track
application
Prior art date
Application number
PCT/CN2018/116908
Other languages
English (en)
French (fr)
Inventor
李亚军
Original Assignee
深圳市欢太科技有限公司
Oppo广东移动通信有限公司
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 深圳市欢太科技有限公司, Oppo广东移动通信有限公司 filed Critical 深圳市欢太科技有限公司
Priority to PCT/CN2018/116908 priority Critical patent/WO2020103076A1/zh
Priority to CN201880098466.6A priority patent/CN112997155B/zh
Publication of WO2020103076A1 publication Critical patent/WO2020103076A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]

Definitions

  • the present application relates to the field of communication technologies, and in particular, to an audio playback processing method, device, terminal, and computer-readable storage medium.
  • the terminal There is a corresponding audio system in the terminal for playing audio resources in the terminal.
  • the corresponding audio track needs to be configured so that the audio resources can be played.
  • any application can automatically configure the audio track when required.
  • Embodiments of the present application provide an audio playback processing method, device, terminal, and computer-readable storage medium.
  • An audio playback processing method including:
  • an audio track is configured for the target audio, and the target audio is played based on the configured audio track.
  • An audio playback processing device includes:
  • the receiving module is used to obtain the occupied state of the audio track when receiving the configuration instruction of the audio track;
  • a release module used to obtain and release a releasable audio track when it is determined that there is no available audio track
  • the configuration module is configured to configure the audio track for the target audio when the release of the releasable audio track is completed, and play the target audio based on the configured audio track.
  • a terminal includes a memory and a processor.
  • a computer program is stored in the memory.
  • the processor is caused to perform the following operations:
  • an audio track is configured for the target audio, and the target audio is played based on the configured audio track.
  • a computer-readable storage medium includes a memory and a processor.
  • a computer program is stored in the memory.
  • the processor causes the processor to perform the following operations:
  • an audio track is configured for the target audio, and the target audio is played based on the configured audio track.
  • the audio playback processing method, terminal and computer-readable storage medium of the embodiment of the present application when receiving the audio track configuration instruction, acquire the occupied state of the included audio track, and then determine according to the determined occupied state of the audio track Whether there is a usable audio track, and when there is no usable audio track, obtain a releasable audio track from all the audio tracks to release the releasable audio track, and finally configure the audio track for the target audio, based on the configuration To play the target audio.
  • the target audio track is configured by acquiring and releasing the idle and unused audio tracks to play the target audio, ensuring the terminal audio resources Normal playback.
  • FIG. 1 is an application environment diagram of an audio playback processing method in an embodiment.
  • FIG. 2 is a flowchart of an audio playback processing method in an embodiment.
  • FIG. 3 is a flowchart of steps for releasing a releasable audio track in one embodiment.
  • FIG. 4 is a flowchart of steps for releasing a releasable audio track in another embodiment.
  • FIG. 5 is a structural block diagram of an audio playback processing device in an embodiment.
  • FIG. 6 is a schematic structural diagram of a terminal in an embodiment.
  • FIG. 7 is a partial block diagram of a mobile phone in an embodiment.
  • FIG. 1 is a schematic diagram of an application environment of an audio playback processing method in an embodiment.
  • the application environment includes a terminal 100.
  • the terminal 100 receives the configuration instruction of the audio track, it acquires the occupied status of the audio track included in the terminal 100 to determine whether there is an available audio track, and then when the terminal 100 When it is determined that there is no usable audio track, obtain a releasable audio track and release the releasable audio track. Finally, when the release of the releasable audio track is completed, configure the audio track for the target audio and play the target audio based on the configured audio track.
  • the terminal 100 may be a smart phone, a tablet computer, a personal digital assistant, or the like.
  • an audio playback processing method is provided, which is exemplified by the application to the above terminal 100. As shown in FIG. 2, the method includes the following operations:
  • Operation 202 when receiving the configuration instruction of the audio track, acquiring the occupied state of the audio track.
  • the audio track is the resource information for the terminal to play audio.
  • the audio system in the terminal includes several audio tracks for each application to play audio resources.
  • the audio track is stored in the audio track
  • the audio resource can be in an unused state.
  • the audio track is controlled to play the stored audio resource.
  • the occupied state is that the audio track is in the occupied state
  • the unused state is the idle and unoccupied state.
  • the terminal when receiving the configuration instruction of the audio track, the terminal will obtain the occupied status of the audio track included in the terminal. Specifically, there is a corresponding audio system inside the terminal for controlling the terminal's management of audio resources, including releasing audio resources and playing audio resources.
  • the audio resource corresponding to the application When configuring the audio track, the audio resource corresponding to the application will be stored in the audio track.
  • the application state of the audio track resource in the audio system changes.
  • the actual application status of the audio track in the terminal's own audio system is first obtained to determine whether the target audio track can be configured and completed.
  • Operation 204 when it is determined that there is no available audio track, acquire and release the releasable audio track.
  • the usable audio track refers to an audio track that is not occupied and can be configured.
  • the configuration of the target audio track is not directly completed. It is necessary to determine whether the configuration of the target audio track can be completed based on the application state of the audio track of the terminal itself. Therefore, the When the application status of the audio track is, first determine whether there is an available audio track based on the application status of the included audio track. Specifically, for the audio system inside the terminal, the number of configurable audio tracks is limited. When the number of already configured audio tracks is too large, the configuration of audio tracks will not be allowed again.
  • the terminal when the terminal configures the audio track, it will make corresponding records and statistics to determine the real-time application status of the audio track included in the terminal.
  • the number of configurable audio tracks in the terminal is limited. When the number of already configured audio tracks reaches the upper limit of the number of configurable audio tracks, it means that there are currently no available audio tracks.
  • the releasable audio track will be acquired, and then the releasable audio track will be released.
  • the corresponding audio track will be directly selected from the available audio tracks to complete the configuration of the target audio track, thereby achieving the playback of the target audio.
  • the audio track that has been configured in the audio system in the terminal may be idle and unused. Due to the occupation of the audio track, there will be no available audio track when the audio track needs to be configured.
  • the released track is used for the configuration of the target track.
  • the audio track configured in the audio system in the terminal contains corresponding audio resources. Only after the corresponding audio resources are released, the configuration of the target audio track can be completed, and then the target audio can be played.
  • the audio track is configured for the target audio, and the target audio is played based on the configured audio track.
  • the terminal determines the releasable audio track
  • the releasable audio corresponding to the releasable audio track is released, and after the release of the releasable audio track is completed, the audio track is configured for the target audio, and based on the configured audio track Play the target audio.
  • the occupancy of the included audio track is obtained, and then whether there is an available audio track is determined according to the determined occupancy of the audio track, and if there is no available
  • obtain releasable audio tracks from all audio tracks to release the releasable audio resources contained in the releasable audio tracks obtain releasable audio tracks from all audio tracks to release the releasable audio resources contained in the releasable audio tracks.
  • configure the target audio Audio track and play the target audio based on the configured audio track.
  • the target audio track is configured by acquiring and releasing the idle and unused audio tracks to play the target audio, ensuring the terminal audio resources Normal playback.
  • the target application program is an application program that issues an audio track configuration instruction.
  • the number of audio tracks in the audio system in the terminal is limited, and the configuration and use of audio tracks cannot be unlimited.
  • the number of audio tracks allowed to be configured and used is also limited.
  • the target application is one of the three-party applications. When all the audio track resources of the terminal are occupied, the configuration of the audio track cannot be performed; for the three-party application, when the audio tracks used in the three-party application are all occupied, the configuration of the audio track cannot be performed. When there is no usable audio track, some audio tracks will need to be released to obtain usable audio tracks before the configuration of the target audio track can be completed.
  • acquiring the occupied status of the audio track included in the terminal includes: acquiring the first number of audio tracks included in the terminal; reading the second number of audio tracks in the application state in the terminal, where the first The quantity is not less than the second quantity; when the first quantity is equal to the second quantity, it is determined that there are no available audio tracks; and, when the first quantity is greater than the second quantity, it is determined that there are available audio tracks.
  • the first number refers to the maximum value of the audio tracks configurable by the audio system in the terminal
  • the second number refers to the value of the audio track configuration that has been completed in the terminal.
  • acquiring the occupied state of the audio track associated with the target application includes: acquiring the third number of audio tracks associated with the target application; reading the application state associated with the target application The fourth number of tracks, of which the third number is not less than the fourth number; when the third number is equal to the fourth number, it is determined that there is no usable track; and, when the third number is greater than the fourth number, it is determined that there is Audio tracks can be used.
  • the third number refers to the maximum value of the audio tracks that can be configured and used by the target application
  • the fourth number refers to the value of the audio tracks that have been configured in the target application.
  • operation 204 when it is determined that there are no available audio track resources, acquire and release Releasable audio tracks, including:
  • the configuration time corresponding to the first audio track is obtained, and the first audio track is the audio track corresponding to the fourth quantity.
  • the first number is equal to the second number, it is determined that there is no usable audio track.
  • the terminal when the first number is equal to the second number, it means that the audio tracks in the audio system in the terminal are all occupied, that is, there are no available audio tracks. At this time, the audio tracks included in the target application are also All are in the occupied state, and the terminal needs to perform the corresponding release to complete the configuration of the target audio track.
  • the configuration time corresponding to the first audio track is obtained, where the first audio track is the audio track corresponding to the fourth number, that is, the audio track in the target application in a state, and
  • the number of audios contained in the first audio track may be one or more.
  • the fourth quantity is not zero, it means that there are audio tracks in the application state among the audio tracks associated with the target application, that is, when obtaining the configuration times corresponding to the audio sounds associated with the target application, respectively It is the configuration time corresponding to the track in the application state associated with the target application.
  • the configuration time corresponding to the configuration of each audio track that is, when saving the configuration information of the audio track, in addition to recording the object of the configuration audio track, the configuration time of the audio track is also recorded. Therefore, when it is determined that there is no available audio track in the terminal, the configuration time corresponding to the audio track associated with the target application can be obtained.
  • Operation 304 based on the configuration moment, obtain a releasable audio track in the first audio track.
  • the corresponding releasable audio track is obtained in the first audio track according to the configuration time.
  • obtaining the releasable audio track in the first audio track includes:
  • Operation a obtain the target time corresponding to the configuration instruction.
  • the target time is compared with the configuration time, and the audio track corresponding to the configuration time farthest from the target time in the configuration time is obtained as a releasable audio track.
  • the audio track corresponding to the furthest configuration time is the releasable audio track.
  • the number of audio tracks that the target application has configured is 4, where the configuration time of the first audio track (numbered 01) is 16:30:20 on August 8, 2008, and the second audio track (numbered The configuration time for 02) is 16:33:25 on August 8, 2008, the configuration time for the third track (number 03) is 16:40:20 on August 8, 2008, and the fourth The configuration time of the audio track (No. 04) is 16:45:35 on August 8, 2008.
  • the first time corresponding to the configuration instruction is 16:48:05 on August 8, 2008
  • the audio track corresponding to the configuration time farthest from the first time corresponding to the configuration instruction is the first The audio track, which is the first audio track, will be treated as a releasable audio track.
  • the configuration time corresponding to the first audio track is obtained, the configuration time is also sorted in order of time, to obtain priority information corresponding to each audio track in the first audio track, which is associated with the target application. After arranging the configuration times of the audio tracks of the first track to obtain the priority of each track in the first track, select the track corresponding to the configuration time with the highest priority as the releasable track.
  • the state of the audio track associated with the target application is not necessarily in the application state, where the application state is the occupied state, and the configuration time of the audio track in the application state is sorted. After obtaining the configuration time corresponding to the above four audio tracks, when sorting them in the order of time, the corresponding order is 01 ⁇ 02 ⁇ 03 ⁇ 04, that is, the first audio track is the first configured audio track, At this time, the track with the highest priority is the track number 01, and the track with the lowest priority is the track number 04.
  • the release of the audio track needs to be performed. Then, it is necessary to select a releasable audio track among the already configured audio tracks for release.
  • the releasable audio track that is released is in an idle state, that is, although the configuration of the audio track has been completed, the corresponding audio resource is not played. At the same time, for the audio track that has been configured, after the corresponding audio resource is played, the audio track will be released, and then from the occupied state to the usable state.
  • the releasable audio track is released.
  • the releasable audio track After determining the releasable audio track that can be released, the releasable audio track will be released, specifically, the audio resources corresponding to the releasable audio track will be released to achieve the release of the releasable audio track.
  • the audio track with a longer configuration time is released in order of the configuration time, so that The configuration of the target audio track can be completed.
  • the fourth quantity when the first quantity is equal to the second quantity, and the fourth quantity is not zero, first obtain the audio track that is associated with the target application and is in the application state, by obtaining the corresponding Configure the time, and then release the audio track with a relatively long time. It realizes that when the terminal fails to configure the audio track, by releasing the audio track configured by the target application itself and in an idle and unused state, a usable audio track is obtained, and then the configuration of the target audio track is completed. It realizes the automatic release of audio tracks that have been configured but not used in the target application, so that the terminal can play audio resources normally.
  • operation 206 when it is determined that there are no available audio track resources, acquiring and releasing the releasable includes :
  • the application to which the second audio track belongs is determined, and the second audio track is the audio track corresponding to the second number.
  • the target application is not configured with any audio track.
  • the application to which each audio track in the second audio track belongs will be determined, where the second audio track is the audio track corresponding to the second number, that is, the audio track included in the terminal and in the application state.
  • different applications can record the identification information of the application that configures the audio track when configuring the audio track, that is, the object that configures the audio track, that is, the corresponding application. Therefore, when it is determined that the target application does not have an already configured audio track, the application to which all audio tracks belong is determined according to the identification information of the application corresponding to each audio track.
  • the identification information of the application is the only mark of the application, which can be text or digital number.
  • the number of audio tracks corresponding to the application program is determined.
  • the second audio track is classified by the application identifier corresponding to each audio track in the second audio track to determine the number of audio tracks corresponding to each application program. Specifically, the audio tracks are classified according to the application identifiers corresponding to the respective audio tracks, and the number of audio tracks included in different application programs is determined.
  • the application with the largest number of audio tracks associated with the application is regarded as a releasable application.
  • the number of audio tracks corresponding to different applications can be obtained, and then the application with the largest number of audio tracks in each application can be obtained and used as a band release application program. Specifically, the number of audio tracks included in each application is sorted to obtain the sorting result obtained by each application based on the number of audio tracks, and then the application with the largest number of included audio tracks is used as a releasable application to perform audio tracks Of release.
  • Operation 408 releasing the track associated with the releaseable application.
  • the audio track associated with the releasable application is obtained, and then the associated audio track is released, specifically, the corresponding audio resource in the audio track associated with the application is released to obtain usable Audio track.
  • the audio track included in the releasable application program can also be performed Partial release. Specifically, when a releasable application is obtained, the audio track included in the releasable application is obtained, and then the released audio track is determined according to the configuration time of the included audio track to obtain a usable audio track.
  • the target application when the first quantity is equal to the second quantity and the fourth quantity is zero, it means that the target application does not have a configured audio track. At this time, it will determine and determine which of the configured audio tracks belong respectively. Applications, and count the number, and then use the application with the largest number of configured audio tracks as a releasable application, and then release the audio tracks contained in the releasable application to obtain usable audio tracks, which has achieved automatic release. Configured but unused audio tracks, so that the terminal can play audio resources normally.
  • the third quantity is equal to the fourth quantity, and the fourth quantity is not zero, it means that the audio tracks included in the target application are all in the occupied state, that is, in the application state, and will not be It is necessary to determine whether all the audio tracks included in the terminal are in the application state, and directly select and determine the releasable audio track from the audio tracks included in the target application to complete the release of the audio track.
  • the operation of acquiring and releasing the releasable audio track includes: acquiring configuration times corresponding to the first audio track respectively, where the first audio track is the target application The collection of audio tracks in the application state in the program; obtaining the target time corresponding to the configuration instruction and comparing the target time with the configuration time; and, based on the obtained comparison result, separating the configuration time from the target time The corresponding audio track at the moment of configuration is the releasable audio track, and the audio contained in the releasable audio track is released.
  • FIG. 5 is a structural block diagram of an audio playback processing device in an embodiment. As shown in FIG. 5, the device includes: a receiving module 502, a releasing module 504, and a configuration module 506, where:
  • the receiving module 502 is configured to obtain the occupied state of the audio track when receiving the configuration instruction of the audio track.
  • the release module 504 is configured to acquire and release the releasable audio track when it is determined that there is no available audio track.
  • the configuration module 506 is configured to complete the configuration of the target audio track and play the target audio configured by the target audio track when the release of the audio contained in the releasable audio track is completed.
  • a provided receiving module includes a first acquiring module and a second acquiring module.
  • the first obtaining module is used to obtain the occupied state of the audio track included in the terminal, and the second obtaining module is used to obtain the occupied state of the audio track associated with the target application.
  • a first acquisition module includes a first data acquisition module, a second data acquisition module, and a first determination module.
  • the first data acquisition module is used to acquire the first number of audio tracks contained in the terminal
  • the second data acquisition module is used to read the second number of audio tracks in the application state of the terminal, wherein the first number is not less than The second quantity
  • the first determining module is used to determine the occupied status of the audio track included in the terminal based on the first quantity and the second quantity, wherein when the first quantity is equal to the second quantity, it is determined that there is no usable Audio track.
  • a second acquisition module provided includes a third data acquisition module, a fourth data acquisition module, and a second determination module.
  • the third data acquisition module is used to acquire the third number of audio tracks associated with the target application
  • the fourth data acquisition module is used to read the fourth number of audio tracks in the application state.
  • the second determination module is used to determine the occupied status of the audio track associated with the target application based on the third quantity and the fourth quantity, where when the third quantity is equal to the fourth quantity, it is determined not to Available audio tracks.
  • a release module provided further includes a time acquisition module, a judgment selection module, and an audio release module.
  • the first moment acquisition module is used to acquire the configuration time corresponding to the first audio track
  • the first audio track is the audio track corresponding to the fourth number
  • the judgment selection module is used to acquire the available sound in the first audio track based on the configuration time
  • the audio release module is used to release the releasable audio track.
  • the provided judgment selection module further includes a second moment acquisition module and a selection module.
  • the second moment obtaining module is used to obtain the target time corresponding to the configuration instruction
  • the selection module is used to compare the target time with the configuration time to obtain the audio track corresponding to the configuration time farthest from the target time in the configuration time as The audio track can be released.
  • a provided judgment selection module further includes a category determination module, a quantity determination module, a program selection module, and a program release module.
  • the category determination module is used to determine the application programs to which the second audio track belongs, the second audio track is the audio track corresponding to the second number, the quantity determination module is used to determine the number of audio tracks corresponding to the respective application programs, and the program selection module It is used to take the application with the largest number of audio tracks in each application as a releasable application, and the program release module is used to release the audio track associated with the releasable application.
  • a release module provided is also used to obtain the configuration time corresponding to the first audio track; and, obtain the target time corresponding to the configuration instruction and compare the target time with the configuration time; and, based on The obtained comparison result selects the audio track corresponding to the configuration time farthest from the target time as the releasable audio track, and releases the releasable audio track.
  • Each module in the audio playback processing device may be implemented in whole or in part by software, hardware, and a combination thereof.
  • the above modules may be embedded in the hardware form or independent of the processor in the terminal or server, or may be stored in the memory in the terminal or server in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
  • FIG. 6 a schematic diagram of an internal structure of a terminal is provided.
  • the terminal includes a processor, memory, display, and network interface connected by a system bus.
  • the processor is used to provide computing and control capabilities to support the operation of the entire terminal.
  • the memory is used to store data, programs, and / or instruction codes.
  • the memory stores at least one computer program that can be executed by the processor to implement the audio playback processing method applicable to the terminal provided in the embodiments of the present application.
  • the memory may include a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), or a random-access memory (Random-Access-Memory, RAM).
  • the memory includes a non-volatile storage medium and internal memory.
  • the non-volatile storage medium stores an operating system and computer programs.
  • the computer program may be executed by the processor to implement an audio playback processing method provided by various embodiments of the present application.
  • the internal memory provides a cached operating environment for the operating system and computer programs in the non-volatile storage medium.
  • the display can be used to display information, for example, to display various interfaces.
  • the network interface may be an Ethernet card or a wireless network card, which is used to communicate with external terminals, for example, it may be used to communicate with a server.
  • FIG. 6 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the terminal or server to which the solution of the present application is applied.
  • the specific terminal or The server may include more or less components than shown in the figure, or combine certain components, or have a different arrangement of components.
  • An embodiment of the present application also provides a terminal. As shown in FIG. 7, for ease of description, only parts related to the embodiments of the present application are shown, and specific technical details are not disclosed, please refer to the method part of the embodiments of the present application. Take the terminal as a mobile phone as an example:
  • the mobile phone includes: a radio frequency (Radio Frequency) circuit 710, a memory 720, an input unit 730, a display unit 740, a sensor 750, an audio circuit 760, a wireless fidelity (WiFi) module 770, a processor 780 , And power supply 790 and other components.
  • a radio frequency (Radio Frequency) circuit 710 for a radio frequency (Radio Frequency) circuit 710
  • a memory 720 includes: a radio frequency (Radio Frequency) circuit 710, a memory 720, an input unit 730, a display unit 740, a sensor 750, an audio circuit 760, a wireless fidelity (WiFi) module 770, a processor 780 , And power supply 790 and other components.
  • WiFi wireless fidelity
  • FIG. 7 does not constitute a limitation on the mobile phone, and may include more or less components than those shown in the figure, or a combination of certain components, or a different component arrangement.
  • the RF circuit 710 can be used for receiving and sending signals during sending and receiving information or during a call. It can receive the downlink information of the base station and process it to the processor 780; it can also send the uplink data to the base station.
  • RF circuits include but are not limited to antennas, at least one amplifier, transceiver, coupler, low noise amplifier (Low Noise Amplifier, LNA), duplexer, and so on.
  • the RF circuit 710 can also communicate with the network and other devices through wireless communication.
  • the above wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile (GSM), General Packet Radio Service (GPRS), and Code Division Multiple Access (Code Division) Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), e-mail, Short Message Service (SMS), etc.
  • GSM Global System of Mobile
  • GPRS General Packet Radio Service
  • CDMA Code Division Multiple Access
  • WCDMA Wideband Code Division Multiple Access
  • LTE Long Term Evolution
  • SMS Short Message Service
  • the memory 720 may be used to store software programs and modules, and may also be used to store application installation packages.
  • the processor 780 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 720.
  • the memory 720 may mainly include a program storage area and a data storage area, where the program storage area may store an operating system and applications required for at least one function (such as an application program for a sound playback function, an application program for an image playback function, etc.), etc .;
  • the data storage area can store data (such as audio data, address book, etc.) configured according to the use of the mobile phone.
  • the memory 720 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
  • the input unit 730 may be used to receive input numeric or character information, and generate key signal input related to user settings and function control of the mobile phone 700.
  • the input unit 1130 may include a touch panel 731 and other input devices 732.
  • the touch panel 731 also known as a touch screen, can collect user's touch operations on or near it (for example, the user uses any suitable object or accessory such as a finger, a stylus, etc. on or near the touch panel 731 Operation), and drive the corresponding connection device according to the preset program.
  • the touch panel 731 may include a touch detection device and a touch controller.
  • the touch detection device detects the user's touch orientation, and detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device and converts it into contact coordinates, and then sends To the processor 780, and can receive the command sent by the processor 780 and execute it.
  • the touch panel 731 may be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves.
  • the input unit 730 may also include other input devices 732.
  • other input devices 732 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.).
  • the display unit 740 may be used to display information input by the user or information provided to the user and various menus of the mobile phone.
  • the display unit 740 may display according to the resolution.
  • the display unit 740 may include a display panel 741.
  • the display panel 741 may be configured in the form of a liquid crystal display (Liquid Crystal) (LCD), an organic light-emitting diode (Organic Light-Emitting Diode, OLED), or the like.
  • LCD liquid crystal display
  • OLED Organic Light-Emitting Diode
  • the touch panel 731 may cover the display panel 741, and when the touch panel 731 detects a touch operation on or near it, it is transmitted to the processor 780 to determine the type of touch event, and then the processor 780 according to The type of touch event provides a corresponding visual output on the display panel 741.
  • the touch panel 731 and the display panel 741 are implemented as two independent components to realize the input and input functions of the mobile phone, in some embodiments, the touch panel 731 and the display panel 741 may be integrated and Realize the input and output functions of the mobile phone.
  • the mobile phone 700 may further include at least one sensor 750, such as a light sensor, a motion sensor, and other sensors.
  • the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 741 according to the brightness of the ambient light, and the proximity sensor may close the display panel 741 and / or when the mobile phone moves to the ear Or backlight.
  • the motion sensor may include an acceleration sensor, which can detect the magnitude of acceleration in various directions through the acceleration sensor, and can detect the magnitude and direction of gravity when at rest, and can be used for applications that recognize mobile phone gestures (such as horizontal and vertical screen switching), and vibration recognition-related functions (such as Pedometer, percussion), etc.
  • the mobile phone can also be equipped with other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared sensor and so on.
  • the audio circuit 760, the speaker 761, and the microphone 762 may provide an audio interface between the user and the mobile phone.
  • the audio circuit 760 can transmit the received electrical signal converted to electrical signals to the speaker 761, which is converted into a sound signal output by the speaker 761; on the other hand, the microphone 762 converts the collected sound signal into an electrical signal, which is converted by the audio circuit 760 After receiving, it is converted into audio data, and then processed by the audio data output processor 780, and then sent to another mobile phone through the RF circuit 710, or the audio data is output to the memory 720 for subsequent processing.
  • WiFi is a short-range wireless transmission technology.
  • the mobile phone can help users send and receive emails, browse web pages, and access streaming media through the WiFi module 770. It provides users with wireless broadband Internet access.
  • FIG. 7 shows the WiFi module 770, it can be understood that it is not a necessary component of the mobile phone 700, and may be omitted as needed.
  • the processor 780 is the control center of the mobile phone, connects various parts of the entire mobile phone with various interfaces and lines, executes or executes the software programs and / or modules stored in the memory 720, and calls the data stored in the memory 720 to execute Various functions and processing data of the mobile phone, so as to monitor the mobile phone as a whole.
  • the processor 780 may also update the application according to the application installation package.
  • the processor 780 may include one or more processing units.
  • the processor 780 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, user interface, application programs, and the like; the modem processor mainly processes wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 780.
  • the mobile phone 700 further includes a power supply 790 (such as a battery) for powering various components.
  • a power supply 790 (such as a battery) for powering various components.
  • the power supply can be logically connected to the processor 780 through a power management system, so as to realize functions such as charging, discharging, and power management through the power management system.
  • the mobile phone 700 may further include a camera, a Bluetooth module, and the like.
  • the processor 780 executes the steps of the audio playback processing method by running software programs and modules stored on the memory 720.
  • the embodiments of the present application also provide a computer-readable storage medium.
  • One or more non-volatile computer-readable storage media containing computer-executable instructions, which when executed by one or more processors, cause the processors to perform the steps of the audio playback processing method.
  • a computer program product containing instructions that, when run on a computer, causes the computer to perform an audio playback processing method.
  • Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory can include random access memory (RAM), which acts as external cache memory.
  • RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR) SDRAM, enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDR double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM synchronous Link (Synchlink) DRAM
  • Rambus direct RAM
  • DRAM direct memory bus dynamic RAM
  • RDRAM memory bus dynamic RAM

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)

Abstract

一种音频播放处理方法包括:当接收音轨的配置指令时,获取音轨的被占用情况;当确定不存在可使用音轨时,获取可释放音轨,并释放所述可释放音轨所包含的音频;及,当所述音频释放完成时,完成目标音轨的配置,并播放目标音频。

Description

音频播放处理方法、装置、终端和计算机可读存储介质 技术领域
本申请涉及通信技术领域,特别是涉及一种音频播放处理方法、装置、终端和计算机可读存储介质。
背景技术
终端中存在相应的音频系统,用于对终端中的音频资源进行播放。在进行音频资源的播放时,需要配置对应的音轨,进而才能够进行音频资源的播放。在终端中,任何应用程序都可以在有需求的情况下自动配置音轨。
然而,由于某些应用程序频繁配置音轨,且没有进行释放,使得终端中没有可使用的音轨,导致音轨资源耗尽,且无法自动恢复。
发明内容
本申请实施例提供一种音频播放处理方法、装置、终端和计算机可读存储介质。
一种音频播放处理方法,包括:
当接收音轨的配置指令时,获取音轨的被占用情况;
当确定不存在可使用音轨时,获取并释放可释放音轨;及
当所述可释放音轨释放完成时,对目标音频配置音轨,并基于所配置的音轨播放所述目标音频。
一种音频播放处理装置,所述装置包括:
接收模块,用于当接收音轨的配置指令时,获取音轨的被占用情况;
释放模块,用于当确定不存在可使用音轨时,获取并释放可释放音轨;及
配置模块,用于当所述可释放音轨频释放完成时,对目标音频配置音轨,并基于所配置的音轨播放所述目标音频。
一种终端,包括存储器及处理器,所述存储器中储存有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器执行以下操作:
当接收音轨的配置指令时,获取音轨的被占用情况;
当确定不存在可使用音轨时,获取并释放可释放音轨;及
当所述可释放音轨释放完成时,对目标音频配置音轨,并基于所配置的音轨播放所述目标音频。
一种计算机可读存储介质,包括存储器及处理器,所述存储器中储存有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器执行以下操作:
当接收音轨的配置指令时,获取音轨的被占用情况;
当确定不存在可使用音轨时,获取并释放可释放音轨;及
当所述可释放音轨释放完成时,对目标音频配置音轨,并基于所配置的音轨播放所述目标音频。
本申请实施例的音频播放处理方法、终端和计算机可读存储介质,在接收到音轨配置指令时,获取所包含的音轨的被占用情况,然后根据所确定的音轨的被占用情况确定是否存在可使用音轨,并在不存在可使用音轨时,从所有的音轨中获取可释放音轨,以将可释放音轨进行释放,最后对目标音频配置音轨,并基于所配置的音轨播放所述目标音频。实现了在终端的音频系统中的音轨资源被全部占有时,通过获取并释放处于空闲且未使用的音轨,完成对目标音轨的配置,以对目标音频进行播放,保证了终端音频资源的正常播放。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为一个实施例中音频播放处理方法的应用环境图。
图2为一个实施例中音频播放处理方法的流程图。
图3为一个实施例中释放可释放音轨的步骤的流程图。
图4为另一个实施例中释放可释放音轨的步骤的流程图。
图5为一个实施例中音频播放处理装置的结构框图。
图6为一个实施例中终端的架构示意图。
图7为一个实施例中手机的部分结构框图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
可以理解,本申请所使用的术语“第一”、“第二”等可在本文中用于描述各种元件,但这些元件不受这些术语限制。这些术语仅用于将第一个元件与另一个元件区分。
图1为一个实施例中音频播放处理方法的应用环境示意图。如图1所示,该应用环境包括终端100,当终端100接收到音轨的配置指令时,获取终端100所包含音轨的被占用情况,以确定是否存在可使用音轨,然后当终端100确定不存在可使用音轨时,获取可释放音轨,并释放可释放音轨,最后在可释放音轨释放完成时,对目标音频配置音轨,并基于所配置的音轨播放目标音频。可以理解的是,终端100可为智能手机、平板电脑、个人数字助理等。
在一个实施例中,提供了一种音频播放处理方法,以应用于上述终端100来举例说明,如图2所示,该方法包括如下操作:
操作202,当接收音轨的配置指令时,获取音轨的被占用情况。
其中,音轨是用于终端进行音频播放的资源信息,终端内的音频系统中包括有若干音轨,用于各应用程序进行音频资源的播放,在配置了音轨时,存储在音轨中的音频资源可以处于未使用状态,在需要进行音频资源播放时,控制音轨播放所存储的音频资源。其中,被占用情况即为音轨处于被占用状态,未使用状态即为处于空闲未被占用的状态。
终端在使用过程中,终端在接收到音轨的配置指令时,将获取自身所包含的音轨的被占用情况。具体地,终端内部有相应的音频系统,用于控制终端对音频资源的管理,包括对音频资源进行释放以及对音频资源进行播放等。在配置音轨时,音轨中将会保存有应用程序所对应的音频资源,此时由于音轨的配置,使得音频系统中的音轨资源的应用状态发生变化。在本实施例中,在接收到音轨配置指令时,首先获取终端自身的音频系统中音轨的实际应用状态,以确定是否可以进行并完成对目标音轨的配置。
操作204,当确定不存在可使用音轨时,获取并释放可释放音轨。
其中,可使用音轨是指没有被占用且可以进行配置的音轨。
在接收到音轨的配置指令时,并不是直接完成对目标音轨的配置,需要基于终端自身的音轨的应用状态确定是否可以完成对目标音轨的配置,因此,在获取得到终端所包含的音轨的应用状态时,首先基于所包含音轨的应用状态确定是否存在可使用音轨。具体地,对于终端内部的音频系统而言,可配置的音轨的数量是有限的,当已经配置的音轨的数量 过多时,将不会允许再次进行音轨的配置。
在实际应用中,终端在配置音轨时,会进行相应的记录与统计,用于确定终端所包含的音轨的实时应用状态。通常,终端内可配置的音轨的数量是有限的,当已经配置的音轨的数量达到可配置音轨的数量上限值时,说明当前不存在可使用音轨。
根据所获取得到的终端所包含的音轨的应用状态,确定不存在可使用音轨时,将获取可释放音轨,然后将可释放音轨进行释放。另外,在确定存在可使用的音轨时,将直接从可使用音轨中选择对应的音轨,完成目标音轨的配置,进而实现对目标音频的播放。
在实际应用中,终端内音频系统中已经配置的音轨可能处于空闲且未使用的状态,由于占用了音轨,使得在需要配置音轨时将没有可使用的音轨,因此需要释放部分可以进行释放的音轨,以用于目标音轨的配置。在终端内音频系统所配置的音轨中包含有对应的音频资源,只有在将对应的音频资源进行释放之后,才可以完成对目标音轨的配置,进而实现对目标音频的播放。
操作206,当可释放音轨释放完成时,对目标音频配置音轨,并基于所配置的音轨播放目标音频。
在终端确定了可释放音轨时,将可释放音轨所对应的可释放音频进行释放,并在完成对可释放音轨的释放之后,对目标音频配置音轨,并基于所配置的音轨播放目标音频。
在本实施例中,在接收到音轨配置指令时,获取所包含的音轨的被占用情况,然后根据所确定的音轨的被占用情况确定是否存在可使用音轨,并在不存在可使用音轨时,从所有的音轨中获取可释放音轨,以将可释放音轨中所包含的可释放音频资源进行释放,最后在完成对可释放音轨的释放之后,对目标音频配置音轨,并基于所配置的音轨播放目标音频。实现了在终端的音频系统中的音轨资源被全部占有时,通过获取并释放处于空闲且未使用的音轨,完成对目标音轨的配置,以对目标音频进行播放,保证了终端音频资源的正常播放。
在一个实施例中,提供的一种音频播放处理方法中,通过对终端或者目标应用程序进行检测,获取终端所包含音轨的被占用情况。具体地,获取终端所包含的音轨的被占用情况,以及,获取与目标应用程序相关联的音轨的被占用情况。其中,目标应用程序是发出音轨配置指令的应用程序。
具体地,终端内的音频系统中的音轨的数量是有限的,并不可以无限制的进行音轨的配置以及使用,同样对于三方应用程序而言,允许配置使用的音轨的数量也是有限的,在本实施例中,目标应用程序即为三方应用程序中的一种。在终端的所有音轨资源全部被占用时,将无法进行音轨的配置;对于三方应用程序而言,在三方应用程序中使用的音轨全部被占用时,也将无法进行音轨的配置。在不存在可使用音轨时,将需要对某些音轨进行释放,得到可使用音轨,才可以完成对目标音轨的配置。
进一步地,在获取终端所包含的音轨的被占用情况时,包括:获取终端所包含音轨的第一数量;读取终端中处于应用状态下的音轨的第二数量,其中,第一数量不小于第二数量;当第一数量等于第二数量时,确定不存在可使用音轨;及,当第一数量大于第二数量是,确定存在可使用音轨。
具体地,第一数量指的是终端内音频系统可配置的音轨的最大值,第二数量是指终端中已经完成音轨配置的数值。通过获取音频系统的实际状态信息,可以得到终端所包含的音轨的被占用情况。若第一数量等于第二数量,说明终端内的音轨资源已经处于饱和状态,饱和状态即为音轨全部处于被占用状态,即不存在可使用音轨,只有在第一数量大于第二数量时,终端内才存在可使用音轨,此时才有可能完成目标音轨的配置。
进一步地,在获取与目标应用程序相关联的音轨的被占用情况时,包括:获取与目标应用程序相关联的音轨的第三数量;读取与目标应用程序相关联的处于应用状态下的音轨 的第四数量,其中第三数量不小于第四数量;当第三数量等于第四数量时,确定不存在可使用音轨;及,当第三数量大于第四数量时,确定存在可使用音轨。
具体地,第三数量是指目标应用程序可配置使用的音轨的最大值,第四数量是指目标应用程序中已经完成配置的音轨的数值。通过获取目标应用程序的实时状态信息,确定目标应用程序所包含的音轨的被占用情况。若第三数据等于第四数据,说明目标应用程序所包含的音轨已经处于饱和状态,即不存在可使用音轨,只有在第三数量大于第四数量时,才存在可使用音轨,进而可以完成目标音轨的配置,以实现对目标音频资源的播放。
在一个实施例中,如图3所示,当第一数量等于第二数量时,确定不存在可使用音轨,此时,操作204,当确定不存在可使用音轨资源时,获取并释放可释放音轨,包括:
操作302,获取第一音轨对应的配置时刻,第一音轨为第四数量所对应的音轨。
在第一数量等于第二数量时,确定不存在可使用音轨。对于终端而言,在第一数量等于第二数量时,说明终端内音频系统中的音轨均处于被占用状态,即没有可以使用的音轨,此时目标应用程序中所包含的音轨也全部处于被占用状态,终端需要进行相应的释放时候才可以完成目标音轨的配置。
在第四数量不为零时,获取第一音轨对应的配置时刻,其中,第一音轨为第四数量所对应的音轨,即为目标应用程序中处于有状态下的音轨,且第一音轨所包含的音频数量可以是一个,也可以是多个。在第四数量不为零时,说明与目标应用程序所关联的音轨中有处于应用状态的音轨,也就是,在获取与目标应用程序相关联的音频音分别对应的配置时刻时,得到的是与目标应用程序相关联的处于应用状态的音轨分对应的配置时刻。
在配置音轨时,记录配置各音轨分别对应的配置时刻,也就是在保存音轨的配置信息时,除了记录配置音轨的对象,还记录音轨的配置时刻。因此在确定终端中没有可使用音轨时,可以获取与目标应用程序相关联的音轨分别对应的配置时刻。
操作304,基于配置时刻,在第一音轨中获取可释放音轨。
在得到与目标应用程序相关联的,且处于应用状态下的各音轨分别对应的配置时刻之后,根据配置时刻在第一音轨中获取对应的可释放音轨。
具体地,在第一音轨中获取可释放音轨包括:
操作a,获取配置指令所对应的目标时刻。
操作b,将目标时刻与配置时刻进行对比,获取配置时刻中与目标时刻相隔最远的配置时刻所对应的音轨作为可释放音轨。
在得到与目标应用程序相关联的音轨所对应的配置时刻之后,首先读取所接收到的配置指令所对应的目标时刻,然后将目标时刻与配置时刻进行对比,获取配置时刻中与目标时刻相隔最远的配置时刻所对应的音轨作为可释放音轨。
比如目标应用程序已经配置的音轨的数量为4,其中,第一条音轨(编号为01)的配置时刻为2008年8月8日16时30分20秒,第二条音轨(编号为02)的配置时刻为2008年8月8日16时33分25秒,第三条音轨(编号为03)的配置时刻为2008年8月8日16时40分20秒,第四条音轨(编号为04)的配置时刻为2008年8月8日16时45分35秒。而配置指令所对对应的第一时刻为2008年8月8日16时48分05秒,那么此时与配置指令对应的第一时刻相隔最远的配置时刻所对应的音轨是第一条音轨,也就是第一条音轨将被作为可释放音轨。
另外,在得到第一音轨所对应的配置时刻之后,还对配置时刻按照时刻先后顺序进行排序,得到第一音轨中各音轨分别对应的优先级信息,在对与目标应用程序相关联的音轨的配置时刻进行排序,得到第一音轨中各音轨的优先级之后,选择优先级最高的配置时刻所对应的音轨作为可释放音轨。
与目标应用程序相关联的音轨的状态并不一定是处于应用状态,其中应用状态即为被 占用状态,对处于应用状态的音轨的配置时刻进行排序。在得到上述4条音轨分别对应的配置时刻之后,此时按照时刻先后顺序进行排序时,对应的顺序为01→02→03→04,即第一条音轨为最先配置的音轨,此时也就是优先级最高的是编号为01的音轨,优先级最低的是编号为04的音轨。
由于终端中并不存在可使用音轨,因此需要进行音轨的释放,那么需要在已经配置的音轨中选择可释放音轨,以进行释放。另外需要说明的是,进行释放的可释放音轨处于空闲状态,即虽然已经完成了音轨的配置,但是对应的音频资源并未进行播放。同时对于已经配置的音轨而言,在将对应的音频资源播放之后,音轨将会被释放,进而从被占用状态变为可使用状态。
操作306,释放可释放音轨。
在确定可以进行释放的可释放音轨之后,将会将可释放音轨,具体是将可释放音轨中所对应的音频资源进行释放,以实现对可释放音轨的释放。
在本实施例中,在终端中不存在可使用音轨时,根据目标应用程序所包含的音轨的被占用情况,按照配置时刻的先后顺序将配置时刻较长的音轨进行释放,以使得可以完成对目标音轨的配置。通过释放配置时刻最远的音轨,可以有效避免将刚刚配置的音轨进行释放,导致需要短时刻内再次进行音轨配置的情况出现。
在本实施例中,当第一数量等于第二数量,且第四数量不为零时,首先获取与目标应用程序相关联,且处于应用状态下的音轨,通过获取各音轨分别对应的配置时刻,进而将配置时刻较为久远的音轨进行释放。实现了在终端配置音轨失败时,通过释放目标应用自身所配置的,且处于空闲未使用状态下的音轨,得到可使用音轨,进而完成对目标音轨的配置。实现了自动释放目标应用程序中已经配置但未使用的音轨,使得终端可以正常进行音频资源的播放。
在一个实施例中,如图4所示,当第一数量等于第二数量,且第四数量为零时,操作206,当确定不存在可使用音轨资源时,获取并释放可释放,包括:
操作402,确定第二音轨所属的应用程序,第二音轨为第二数量对应的音轨。
在第一数量等于第二数量,且第四数量为零时,说明目标应用程序没有配置任何音轨。此时将会确定第二音轨中各音轨分别所属的应用程序,其中第二音轨为第二数量对应的音轨,即为终端所包含的且处于应用状态下的音轨。
在实际应用中,不同的应用程序在配置音轨时,可以记录配置音轨的应用程序的标识信息,也就是会保存配置音轨的对象,即对应的应用程序。因此在确定目标应用程序没有已经配置的音轨时,根据各音轨所对应的应用程序的标识信息,确定所有的音轨所分别所属的应用程序。其中,应用程序的标识信息是应用程序的唯一标记,可以是文字,还可以是数字编号。
操作404,确定应用程序对应的音轨的数量。
通过第二音轨中各音轨分别对应的应用标识,对第二音轨进行分类,以确定各应用程序分别对应的音轨的数量。具体地,根据各音轨分别对应的应用标识对音轨进行类别归类,确定不同的应用程序分别所包含的音轨的数量。
操作406,将应用程序所关联的音轨数量最多的应用程序作为可释放应用程序。
通过对第二音轨按照所属的应用程序进行分类处理,可以得到不同应用程序分别对应的音轨的数量,然后获取各应用程序中包含音轨数量最多的应用程序,并将其作为带释放应用程序。具体地,通过各应用程序分别包含的音轨的数量进行排序,得到各应用程序基于音轨数量得到的排序结果,然后将包含音轨数量最多的应用程序作为可释放应用程序,以进行音轨的释放。
操作408,释放可释放应用程序所关联的音轨。
在得到可释放应用程序时,获取与可释放应用程序相关联的音轨,进而将所关联的音轨进行释放,具体是释放应用程序所关联的音轨中所对应音频资源,以得到可使用的音轨。
进一步地,在本实施例中除了将配置音轨数量最多的应用程序进行释放得到可使用音轨之外,还可以在得到可释放应用程序时,对可释放应用程序中所包含的音轨进行部分释放,具体地,在得到可释放应用程序时,获取可释放应用程序所包含的音轨,然后根据所包含的音轨的配置时刻来确定进行释放的音轨,以得到可使用音轨。
在本实施例中,当第一数量等于第二数量,且第四数量为零时,说明目标应用程序并没有已经配置完成的音轨,此时将判断并确定已经配置的音轨分别所属的应用程序,并进行数量统计,然后将配置音轨数量最多的应用程序作为可释放应用程序,进而将可释放应用程序所包含的音轨进行释放,以得到可使用音轨,实现了自动释放已经配置但未使用的音轨,使得终端可以正常进行音频资源的播放。
在一个实施例中,当第三数量等于第四数量,且第四数量不为零时,说明目标应用程序中所包含的音轨均处于被占用状态,即为处于应用状态,此时将不需要判断终端所包含的音轨是否全部处于应用状态,将直接从目标应用程序所包含的音轨中选择确定可释放音轨,以完成音轨的释放。
具体地,在确定目标应用程序所包含的音轨均处于应用状态时,获取可释放音轨并进行释放的操作包括:获取第一音轨分别对应的配置时刻,其中第一音轨为目标应用程序中处于应用状态下的音轨的集合;获取配置指令所对应的目标时刻,并将目标时刻与配置时刻进行对比;及,基于所得到的对比结果,将配置时刻中与目标时刻相隔最远的配置时刻所对应的音轨作为可释放音轨,并释放可释放音轨所包含的音频。
在从目标应用程序所关联的音轨中选择获取可释放音轨时,具体地实施方式如操作302至操作306所描述的实施例。
应该理解的是,虽然上述各个流程图中的各个操作按照箭头的指示依次显示,但是这些操作并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些操作的执行并没有严格的顺序限制,这些操作可以以其它的顺序执行。而且,上述各个流程图中的至少一部分操作可以包括多个子操作或者多个阶段,这些子操作或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子操作或者阶段的执行顺序也不必然是依次进行,而是可以与其它操作或者其它操作的子操作或者阶段的至少一部分轮流或者交替地执行。
图5为一个实施例中音频播放处理装置的结构框图,如图5所示,该装置包括:接收模块502、释放模块504以及配置模块506,其中:
接收模块502,用于当接收音轨的配置指令时,获取音轨的被占用情况。
释放模块504,用于当确定不存在可使用音轨时,获取并释放可释放音轨。
配置模块506,用于当可释放音轨所包含的音频释放完成时,完成目标音轨的配置,并播放目标音轨所配置的目标音频。
在一个实施例中,提供的一种接收模块包括第一获取模块以及第二获取模块。其中,第一获取模块用于获取终端所包含的音轨的被占用情况,第二获取模块用于获取与目标应用程序相关联的音轨的被占用情况。
在一个实施例中,提供的一种第一获取模块包括第一数据获取模块、第二数据获取模块以及第一确定模块。其中,第一数据获取模块用于获取终端所包含音轨的第一数量,第二数据获取模块用于读取终端中处于应用状态下的音轨的第二数量,其中,第一数量不小于第二数量,第一确定模块用于基于第一数量以及第二数量,确定终端所包含的音轨的被 占用情况,,其中当第一数量等于所述第二数量时,确定不存在可使用音轨。
在一个实施例中,提供的一种第二获取模块包括第三数据获取模块、第四数据获取模块以及第二确定模块。其中,第三数据获取模块用于获取与目标应用程序相关联的音轨的第三数量,第四数据获取模块用于读取处于应用状态下的音轨的第四数量,其中第三数量不小于第四数量,第二确定模块用于基于第三数量以及第四数量,确定与目标应用程序相关联的音轨的被占用情况,其中当第三数量等于所述第四数量时,确定不存在可使用音轨。
在一个实施例中,提供的一种释放模块还包括时刻获取模块、判断选择模块以及音频释放模块。其中,第一时刻获取模块用于获取第一音轨对应的配置时刻,第一音轨为第四数量所对应的音轨,判断选择模块用于基于配置时刻,在第一音轨中获取可释放音轨,音频释放模块用于释放可释放音轨。
在一个实施例中,提供的一种判断选择模块还包括第二时刻获取模块以及选择模块。其中,第二时刻获取模块用于获取配置指令所对应的目标时刻,选择模块用于将目标时刻与配置时刻进行对比,获取配置时刻中与目标时刻相隔最远的配置时刻所对应的音轨作为可释放音轨。
在一个实施例中,提供的一种判断选择模块还包括类别确定模块、数量确定模块、程序选择模块以及程序释放模块。其中类别确定模块用于确定第二音轨分别所属的应用程序,第二音轨为第二数量对应的音轨,数量确定模块用于确定各应用程序分别对应的音轨的数量,程序选择模块用于将各应用程序中包含音轨数量最多的应用程序作为可释放应用程序,程序释放模块用于释放可释放应用程序所关联的音轨。
在一个实施例中,提供的一种释放模块还用于获取第一音轨对应的配置时刻;和,获取配置指令所对应的目标时刻,并将目标时刻与配置时刻进行对比;和,基于所得到的对比结果,将配置时刻中与目标时刻相隔最远的配置时刻所对应的音轨作为可释放音轨,并释放可释放音轨。
关于音频播放处理装置的具体限定可以参见上文中对于音频播放处理方法的限定,在此不再赘述。上述音频播放处理装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于终端或者服务器中的处理器中,也可以以软件形式存储于终端或者服务器中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
在一个实施例中,如图6所示,提供了一种终端的内部结构示意图。该终端包括通过系统总线连接的处理器、存储器、显示器和网络接口。其中,该处理器用于提供计算和控制能力,支撑整个终端的运行。存储器用于存储数据、程序、和/或指令代码等,存储器上存储至少一个计算机程序,该计算机程序可被处理器执行,以实现本申请实施例中提供的适用于终端的音频播放处理方法。存储器可包括磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等非易失性存储介质,或随机存储记忆体(Random-Access-Memory,RAM)等。例如,在一个实施例中,存储器包括非易失性存储介质及内存储器。非易失性存储介质存储有操作系统和计算机程序。该计算机程序可被处理器所执行,以用于实现本申请各个实施例所提供的一种音频播放处理方法。内存储器为非易失性存储介质中的操作系统和计算机程序提供高速缓存的运行环境。显示器可用于显示信息,例如,显示各种界面等。网络接口可以是以太网卡或无线网卡等,用于与外部的终端进行通信,比如可用于同服务器进行通信。
本领域技术人员可以理解,图6中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的终端或者服务器的限定,具体的终端或者服务器可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
本申请实施例还提供了一种终端。如图7所示,为了便于说明,仅示出了与本申请实施例相关的部分,具体技术细节未揭示的,请参照本申请实施例方法部分。以终端为手机为例:
图7为与本申请实施例提供的终端相关的手机的部分结构的框图。参考图7,手机包括:射频(Radio Frequency,RF)电路710、存储器720、输入单元730、显示单元740、传感器750、音频电路760、无线保真(wireless fidelity,WiFi)模块770、处理器780、以及电源790等部件。本领域技术人员可以理解,图7所示的手机结构并不构成对手机的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
其中,RF电路710可用于收发信息或通话过程中,信号的接收和发送,可将基站的下行信息接收后,给处理器780处理;也可以将上行的数据发送给基站。通常,RF电路包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器(Low Noise Amplifier,LNA)、双工器等。此外,RF电路710还可以通过无线通信与网络和其他设备通信。上述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(Global System of Mobile communication,GSM)、通用分组无线服务(General Packet Radio Service,GPRS)、码分多址(Code Division Multiple Access,CDMA)、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)、长期演进(Long Term Evolution,LTE))、电子邮件、短消息服务(Short Messaging Service,SMS)等。
存储器720可用于存储软件程序以及模块,还可用于存储应用安装包,处理器780通过运行存储在存储器720的软件程序以及模块,从而执行手机的各种功能应用以及数据处理。存储器720可主要包括程序存储区和数据存储区,其中,程序存储区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能的应用程序、图像播放功能的应用程序等)等;数据存储区可存储根据手机的使用所配置的数据(比如音频数据、通讯录等)等。此外,存储器720可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。
输入单元730可用于接收输入的数字或字符信息,以及产生与手机700的用户设置以及功能控制有关的键信号输入。具体地,输入单元1130可包括触控面板731以及其他输入设备732。触控面板731,也可称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板731上或在触控面板731附近的操作),并根据预先设定的程式驱动相应的连接装置。在一个实施例中,触控面板731可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器780,并能接收处理器780发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板731。除了触控面板731,输入单元730还可以包括其他输入设备732。具体地,其他输入设备732可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)等中的一种或多种。
显示单元740可用于显示由用户输入的信息或提供给用户的信息以及手机的各种菜单。显示单元740可以根据分辨率进行显示。显示单元740可包括显示面板741。在一个实施例中,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板741。在一个实施例中,触控面板731可覆盖显示面板741,当触控面板731检测到在其上或附近的触摸操作后,传送给处理器780以确定触摸事件的类型,随后处理器780根据触摸事件的类型在显示面板741上提供相应的视觉输出。虽然在图7中,触控面板731与显示面板741是作为两个独立的部件来实现手机的输入和输入功能,但是在某些实施例中,可以将触控面板731与显示面板 741集成而实现手机的输入和输出功能。
手机700还可包括至少一种传感器750,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板741的亮度,接近传感器可在手机移动到耳边时,关闭显示面板741和/或背光。运动传感器可包括加速度传感器,通过加速度传感器可检测各个方向上加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换)、振动识别相关功能(比如计步器、敲击)等;此外,手机还可配置陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器等。
音频电路760、扬声器761和传声器762可提供用户与手机之间的音频接口。音频电路760可将接收到的音频数据转换后的电信号,传输到扬声器761,由扬声器761转换为声音信号输出;另一方面,传声器762将收集的声音信号转换为电信号,由音频电路760接收后转换为音频数据,再将音频数据输出处理器780处理后,经RF电路710可以发送给另一手机,或者将音频数据输出至存储器720以便后续处理。
WiFi属于短距离无线传输技术,手机通过WiFi模块770可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。虽然图7示出了WiFi模块770,但是可以理解的是,其并不属于手机700的必须构成,可以根据需要而省略。
处理器780是手机的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器720内的软件程序和/或模块,以及调用存储在存储器720内的数据,执行手机的各种功能和处理数据,从而对手机进行整体监控。处理器780还可以根据应用安装包进行应用更新。在一个实施例中,处理器780可包括一个或多个处理单元。在一个实施例中,处理器780可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等;调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器780中。
手机700还包括给各个部件供电的电源790(比如电池),优选的,电源可以通过电源管理系统与处理器780逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。
在一个实施例中,手机700还可以包括摄像头、蓝牙模块等。
在本实施例中,当手机700使用过程中,处理器780通过运行存储器720上所存储的软件程序以及模块执行音频播放处理方法的步骤。
本申请实施例还提供了一种计算机可读存储介质。一个或多个包含计算机可执行指令的非易失性计算机可读存储介质,当所述计算机可执行指令被一个或多个处理器执行时,使得所述处理器执行音频播放处理方法的步骤。
一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行音频播放处理方法。
本申请所使用的对存储器、存储、数据库或其它介质的任何引用可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM),它用作外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDR SDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (11)

  1. 一种音频播放处理方法,所述方法包括:
    当接收音轨的配置指令时,获取音轨的被占用情况;
    当确定不存在可使用音轨时,获取并释放可释放音轨;及
    当所述可释放音轨释放完成时,对目标音频配置音轨,并基于所配置的音轨播放所述目标音频。
  2. 根据权利要求1所述的方法,其特征在于,所述获取音轨的被占用情况,包括:
    获取终端所包含的音轨的被占用情况;及
    获取与目标应用程序相关联的音轨的被占用情况。
  3. 根据权利要求2所述的方法,其特征在于,所述获取终端所包含的音轨的被占用情况,包括:
    获取终端所包含音轨的第一数量;
    读取所述终端中处于应用状态下的音轨的第二数量,其中,所述第一数量不小于所述第二数量;
    当所述第一数量等于所述第二数量时,确定不存在可使用音轨;及
    当所述第一数量大于所述第二数量是,确定存在可使用音轨。
  4. 根据权利要求2所述的方法,其特征在于,所述获取与目标应用程序相关联的音轨的被占用情况,包括:
    获取与目标应用程序相关联的音轨的第三数量;
    读取与目标应用程序相关联的处于应用状态下的音轨的第四数量,其中所述第三数量不小于所述第四数量;
    当所述第三数量等于所述第四数量时,确定不存在可使用音轨;及
    当所述第三数量大于所述第四数量时,确定存在可使用音轨。
  5. 根据权利要求4所述的方法,其特征在于,当所述第一数量等于所述第二数量,且所述第四数量不为零时;
    所述当确定不存在可使用音轨资源时,获取并释放可释放音轨,包括:
    获取第一音轨对应的配置时刻,所述第一音轨为所述第四数量所对应的音轨;
    基于所述配置时刻,在所述第一音轨中获取可释放音轨;及
    释放所述可释放音轨。
  6. 根据权利要求5所述的方法,其特征在于,所述基于所述配置时刻,在所述第一音轨中获取可释放音轨,包括:
    获取所述配置指令所对应的目标时刻;及
    将所述目标时刻与配置时刻进行对比,获取所述配置时刻中与所述目标时刻相隔最远的配置时刻所对应的音轨作为可释放音轨。
  7. 根据权利要求4所述的方法,其特征在于,当所述第一数量等于所述第二数量,且所述第四数量为零时;
    所述当确定不存在可使用音轨资源时,获取并释放可释放音轨,还包括:
    确定第二音轨所属的应用程序,所述第二音轨为第二数量对应的音轨;
    确定所述应用程序对应的音轨的数量;
    将所述应用程序所关联的音轨数量最多的应用程序作为可释放应用程序;及
    释放所述可释放应用程序所关联的音轨。
  8. 根据权利要求4所述的方法,其特征在于,当所述第三数量等于所述第四数量,且所述第四数量不为零时;
    所述当确定不存在可使用音轨资源时,获取并释放可释放音轨,包括:
    获取所述第一音轨对应的配置时刻;
    获取所述配置指令所对应的目标时刻,并将所述目标时刻与配置时刻进行对比;及
    基于所得到的对比结果,将所述配置时刻中与所述目标时刻相隔最远的配置时刻所对应的音轨作为可释放音轨,并释放所述可释放音轨。
  9. 一种音频播放处理装置,其特征在于,所述装置包括:
    接收模块,用于当接收音轨的配置指令时,获取音轨的被占用情况;
    释放模块,用于当确定不存在可使用音轨时,获取并释放可释放音轨;及
    配置模块,用于当所述可释放音轨频释放完成时,完成目标音轨的配置,并播放所述目标音轨所配置的目标音频。
  10. 一种终端,包括存储器及处理器,所述存储器中储存有计算机程序,所述计算机程序被所述处理器执行时实现权利要求1至8中任一项所述的音频播放处理方法的步骤。
  11. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至8中任一项所述的音频播放处理方法的步骤。
PCT/CN2018/116908 2018-11-22 2018-11-22 音频播放处理方法、装置、终端和计算机可读存储介质 WO2020103076A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2018/116908 WO2020103076A1 (zh) 2018-11-22 2018-11-22 音频播放处理方法、装置、终端和计算机可读存储介质
CN201880098466.6A CN112997155B (zh) 2018-11-22 2018-11-22 音频播放处理方法、装置、终端和计算机可读存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/116908 WO2020103076A1 (zh) 2018-11-22 2018-11-22 音频播放处理方法、装置、终端和计算机可读存储介质

Publications (1)

Publication Number Publication Date
WO2020103076A1 true WO2020103076A1 (zh) 2020-05-28

Family

ID=70773780

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/116908 WO2020103076A1 (zh) 2018-11-22 2018-11-22 音频播放处理方法、装置、终端和计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN112997155B (zh)
WO (1) WO2020103076A1 (zh)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101944048A (zh) * 2010-09-26 2011-01-12 中兴通讯股份有限公司 一种终端在音频资源冲突时的管理方法及该终端
CN103294553A (zh) * 2012-02-24 2013-09-11 中兴通讯股份有限公司 移动终端多媒体资源的管理方法及装置
CN105550037A (zh) * 2015-12-11 2016-05-04 北京元心科技有限公司 多系统中分配音频资源的方法及装置

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101631120A (zh) * 2009-08-20 2010-01-20 中兴通讯股份有限公司 应用服务器和媒体资源分配方法
CN102135913A (zh) * 2011-03-18 2011-07-27 宇龙计算机通信科技(深圳)有限公司 应用的响应方法和装置
CN106126174B (zh) * 2016-06-16 2019-02-22 Oppo广东移动通信有限公司 一种场景音效的控制方法、及电子设备
CN107665143B (zh) * 2016-07-27 2020-10-16 华为技术有限公司 资源管理方法、装置及系统

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101944048A (zh) * 2010-09-26 2011-01-12 中兴通讯股份有限公司 一种终端在音频资源冲突时的管理方法及该终端
CN103294553A (zh) * 2012-02-24 2013-09-11 中兴通讯股份有限公司 移动终端多媒体资源的管理方法及装置
CN105550037A (zh) * 2015-12-11 2016-05-04 北京元心科技有限公司 多系统中分配音频资源的方法及装置

Also Published As

Publication number Publication date
CN112997155B (zh) 2023-10-13
CN112997155A (zh) 2021-06-18

Similar Documents

Publication Publication Date Title
US10831161B2 (en) Method and device for sending communication message
CN107368518B (zh) 一种通知消息的管理方法及终端、计算机可读存储介质
WO2018049887A1 (zh) 数据传输处理方法及终端设备
WO2019128540A1 (zh) 资源管理方法、移动终端及计算机可读存储介质
TWI520043B (zh) 消息查看方法、裝置和移動終端
US10657347B2 (en) Method for capturing fingerprint and associated products
WO2018014745A1 (zh) 漫游结束后的网络搜索方法及设备
WO2018219119A1 (zh) 应用功能的控制方法及相关产品
WO2015027856A1 (zh) 信息反馈方法、装置及终端
CN113039516B (zh) 一种对应用程序进行处理的方法、装置和电子设备
CN106341713B (zh) 一种多媒体同步播放方法、装置、系统及终端
CN103634717A (zh) 一种利用耳机控制的方法、装置及终端设备
US20150043312A1 (en) Sound playing method and device thereof
WO2017215661A1 (zh) 一种场景音效的控制方法、及电子设备
CN112997471B (zh) 音频通路切换方法和装置、可读存储介质、电子设备
CN107623612B (zh) 流量展示方法和装置、计算机设备、计算机可读存储介质
CN103533139B (zh) 多卡用户的数据管理方法、装置及移动终端
WO2015078349A1 (zh) 麦克风收音状态的切换方法和装置
CN104424203A (zh) 移动设备中的照片分享状态查看方法及系统
CN109511139B (zh) Wifi控制方法、装置、移动设备、计算机可读存储介质
CN112997507B (zh) 音频系统控制方法、装置、终端和计算机可读存储介质
WO2019084783A1 (zh) 服务调度方法和装置、计算机设备、计算机可读存储介质
WO2020103076A1 (zh) 音频播放处理方法、装置、终端和计算机可读存储介质
US20210286588A1 (en) Method and apparatus for playing alarm and electronic device
WO2018049896A1 (zh) 数据传输方法及设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18940898

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18940898

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 29/09/2021)

122 Ep: pct application non-entry in european phase

Ref document number: 18940898

Country of ref document: EP

Kind code of ref document: A1