WO2020113525A1 - 播放控制方法和装置、计算机可读存储介质、电子设备 - Google Patents

播放控制方法和装置、计算机可读存储介质、电子设备 Download PDF

Info

Publication number
WO2020113525A1
WO2020113525A1 PCT/CN2018/119608 CN2018119608W WO2020113525A1 WO 2020113525 A1 WO2020113525 A1 WO 2020113525A1 CN 2018119608 W CN2018119608 W CN 2018119608W WO 2020113525 A1 WO2020113525 A1 WO 2020113525A1
Authority
WO
WIPO (PCT)
Prior art keywords
audio data
pause
data
judgment result
playback
Prior art date
Application number
PCT/CN2018/119608
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 CN201880098660.4A priority Critical patent/CN113039518B/zh
Priority to PCT/CN2018/119608 priority patent/WO2020113525A1/zh
Publication of WO2020113525A1 publication Critical patent/WO2020113525A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/16Sound input; Sound output
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • the present application relates to the technical field of electronic equipment, and in particular to a playback control method and apparatus, a computer-readable storage medium, and electronic equipment.
  • the audio output channel of the electronic device is generally switched to a speaker or earpiece, and the video being watched or the music being enjoyed is still playing, which will affect the people around. .
  • the embodiments of the present application provide a playback control method and apparatus, a computer-readable storage medium, and an electronic device, which can perform different processing on the audio data being played according to different situations, which is highly intelligent and improves the user experience.
  • a playback control method applied to electronic equipment includes:
  • a playback control device is applied to electronic equipment.
  • the device includes:
  • a playback monitoring module used to monitor whether there is audio data being played in the electronic device
  • the first earphone monitoring module is used to monitor the connection status of the earphone and the electronic device when there is audio data being played in the electronic device, and determine whether the earphone is unplugged or disconnected;
  • a first strategy obtaining module used to obtain a first processing strategy for the audio data when the headset is unplugged or disconnected;
  • the first playback control module is configured to control the playback of the audio data according to the first processing strategy.
  • An electronic device includes a memory and a processor.
  • Computer-readable instructions are stored in the memory.
  • the processor causes the processor to execute the foregoing playback control method.
  • the above-mentioned playback control method and apparatus, computer-readable storage medium, and electronic device obtain the first processing strategy for the audio data, and control the playback of the audio data according to the first processing strategy, so that the electronic device When there is audio data being played, and the headset is unplugged or disconnected, the audio data being played can be processed in time according to different scenes and situations to prevent surroundings from affecting the surrounding environment.
  • the playback control method provided by the present application improves the intelligence of the electronic device, thereby improving the user experience.
  • FIG. 1 is a schematic diagram of the internal structure of an electronic device provided by an embodiment of the present application.
  • FIG. 2 is a schematic flowchart of a playback control method provided by an embodiment of this application.
  • FIG. 3 is a schematic flowchart of a method for determining whether to pause playback of the audio data and obtain the first processing strategy according to an embodiment of the present application;
  • FIG. 4 is a schematic flowchart of a method for judging whether to pause playback of the audio data according to the first user setting data according to an embodiment of the present application, to obtain a first pause judgment result;
  • FIG. 5 is a schematic flowchart of a method for judging whether to pause playback of the audio data according to first user habit data according to an embodiment of the present application to obtain a second pause judgment result;
  • FIG. 6 is a schematic flowchart of a method for determining whether to pause playback of the audio data according to the first surrounding environment data to obtain a third pause judgment result provided by an embodiment of the present application;
  • FIG. 7 is a schematic flowchart of a method for determining whether to pause playback of the audio data according to an embodiment of the present application to obtain the first processing strategy
  • FIG. 8 is a schematic flowchart of a playback control method provided by an embodiment of this application.
  • FIG. 9 is a schematic flowchart of a method for determining whether to resume playing the audio data according to an embodiment of the present application to obtain the second processing strategy
  • FIG. 10 is a schematic flowchart of a method for determining whether to resume playback of the audio data according to the second user setting data according to an embodiment of the present application, to obtain a first recovery judgment result;
  • FIG. 11 is a schematic flowchart of a method for judging whether to resume playing the audio data according to the second user habit data according to an embodiment of the present application to obtain a second pause judgment result;
  • FIG. 12 is a schematic flowchart of a method for judging whether to resume playing the audio data according to an earphone detachment time according to an embodiment of the present application, and obtaining a third resume judgment result;
  • FIG. 13 is a schematic flowchart of a method for determining whether to resume playback of the audio data to obtain the second processing strategy according to an embodiment of the present application
  • FIG. 14 is a schematic diagram of a frame of a playback control device provided by an embodiment of the present application.
  • 15 is a block diagram of a partial structure of a mobile phone related to an electronic device provided by an embodiment of the present application.
  • FIG. 1 a schematic diagram of an internal structure of an electronic device is provided.
  • the electronic device includes a processor, memory, and display screen connected by a system bus.
  • the processor is used to provide computing and control capabilities to support the operation of the entire electronic device.
  • the memory is used to store data, programs, and/or instruction codes, etc. At least one computer program is stored on the memory, and the computer program can be executed by the processor to implement the playback control method for electronic devices 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 the operating system, database, and computer program.
  • the database stores data related to implementing a playback control method provided by the foregoing embodiments, such as information such as the name of each process or application.
  • the computer program can be executed by the processor to implement a playback control method provided by various embodiments of the present application.
  • the internal memory provides a cached operating environment for operating systems, databases, and computer programs in non-volatile storage media.
  • the display screen can be a touch screen, such as a capacitive screen or an electronic screen, used to display the interface information of the application corresponding to the foreground process, and can also be used to detect the touch operation acting on the display screen and generate corresponding instructions, such as performing the front and background Application switching instructions, etc.
  • a touch screen such as a capacitive screen or an electronic screen
  • the structure shown in FIG. 1 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 electronic device to which the solution of the present application is applied.
  • the specific electronic device may It includes more or fewer components than shown in the figure, or some components are combined, or have a different component arrangement.
  • the electronic device further includes a network interface connected through a system bus.
  • the network interface may be an Ethernet card or a wireless network card, etc., which is used to communicate with external electronic devices, for example, it can be used to communicate with a server.
  • an embodiment of the present application provides a playback control method.
  • the playback control method is applied to an electronic device having a headphone channel.
  • the headset may be a wired headset or a wireless headset, such as a Bluetooth headset or an infrared headset.
  • the playback control method provided in the embodiment of the present application is mainly used to control the playback and pause of audio data of the electronic device according to the state transition of the earphone channel.
  • the electronic device may be a mobile phone, a tablet computer, a laptop computer, a palmtop computer, a mobile Internet device (Mobile Internet Device (MID)), a wearable device (such as a smart watch, smart bracelet, pedometer, etc.) ) Or other electronic devices that have audio data playback capabilities and can be connected to headphones.
  • a mobile Internet device Mobile Internet Device (MID)
  • MID Mobile Internet Device
  • a wearable device such as a smart watch, smart bracelet, pedometer, etc.
  • other electronic devices that have audio data playback capabilities and can be connected to headphones.
  • the playback control method includes S10-S40.
  • the audio data may be audio data during audio playback, audio data during video playback, or audio data during an instant call.
  • the electronic device may monitor the running status of the current audio data output program in real time, and determine whether there is audio data being played according to the running status of the audio data output program. For example, the electronic device monitors the running status of music playback software and video playback software in real time, and determines whether there is audio data output.
  • the electronic device may also monitor the audio data output of the earphone channel in real time, and determine whether there is audio data being played according to whether the earphone channel has audio data output. For example, according to whether there is audio data transmission in the wired headphone output channel or the wireless headphone output channel, and determine whether there is audio data being played.
  • the electronic device further monitors the connection status of the earphone. If the headset is a wired headset, whether the headset is unplugged can be judged through the interface data of the wired headset. If the earphone is a wireless earphone, the connection data between the wireless earphone and the electronic device can be monitored to determine whether the earphone has a disconnection behavior.
  • the electronic device obtains a processing strategy for the audio data being played according to a preset algorithm.
  • the first processing strategy may include multiple specific processing schemes, and the electronic device selects one or more processing schemes according to a preset selection algorithm. For example, the first processing strategy may be to pause or play the audio data through the audio data output program, the first processing strategy may be to switch the output channel of the audio data, the first processing strategy The output volume of the audio data can also be adjusted.
  • S40 Control the playback of the audio data according to the first processing strategy.
  • the electronic device When the headset is unplugged or disconnected, the electronic device generally switches the audio output channel to other audio channels such as a speaker or earpiece according to a preset switching rule.
  • the electronic device controls the playback of the audio data according to different situations by executing the first processing strategy to prevent the audio data from being played by the speaker or the earphone from affecting the surrounding environment after the headset is unplugged or disconnected.
  • the electronic device when listening to songs at night, if the headphones are unplugged or disconnected, the electronic device obtains a first processing strategy for the music being played through a preset algorithm, and executes the first processing strategy to control the music Play to prevent the music from playing suddenly through the speaker after the headset is unplugged or disconnected, affecting the rest of the people around.
  • the playback control method obtains the first processing strategy for the audio data, and controls the playback of the audio data according to the first processing strategy, so that the audio data being played by the electronic device And, when the headset is unplugged or disconnected, it can timely process the audio data being played according to different scenes and situations to prevent the surrounding from affecting the surrounding environment.
  • the playback control method provided by this embodiment improves the intelligence of the electronic device, thereby improving the user experience.
  • the first processing strategy for acquiring the audio data includes:
  • S310 Determine whether to pause the audio data to obtain the first processing strategy.
  • the first processing strategy includes pausing or continuing to play the audio data.
  • the electronic device determines whether to pause or continue playing the audio data according to a preset judgment rule.
  • the judgment rule can be set according to actual needs, and this application is not limited.
  • the judgment rule can be set according to the surrounding environment, according to user settings, or according to user habits, etc., so as to meet different use environments and needs.
  • the electronic device executes the first processing strategy to pause the playing of the audio data being played to prevent impact on the surrounding environment. If the first processing strategy is to continue to play the audio data, the electronic device does not process the audio data, and the audio data continues to play.
  • the method determines whether to pause the audio data according to different situations, so as to pause or resume the audio data being played, which improves the intelligence of audio playback processing and improves the user Experience.
  • S310 specifically includes S311, S312, S313, and S314:
  • S311 Determine whether to pause the audio data according to the first user setting data, and obtain a first pause judgment result.
  • the first user setting data refers to data preset by the user.
  • the first user setting data is used to characterize the way the user prefers to process the audio data when the headset is unplugged or disconnected.
  • the electronic device may display a selection item to a user through a system setting interface or a setting interface of the audio data program to collect and acquire the first user setting data.
  • the first user setting data may include, but not limited to: 1) when the earphone is unplugged or disconnected, pause playing audio data; 2) when the earphone is unplugged or disconnected, continue playing audio data.
  • S311 specifically includes:
  • the result of the first pause judgment is to continue playing the audio data.
  • the preset pause data refers to the data preset by the user as "when the headset is unplugged or disconnected, the audio data is paused to play". If the first user setting data acquired by the electronic device includes the preset pause data, it indicates that when the headset is unplugged or disconnected, the user prefers to pause playback. Then, the result of the first pause judgment is to pause playing of the audio data; otherwise, the result of the first pause judgment is to continue playing of the audio data. In this embodiment, the first user setting data is used to determine whether to pause playback of the audio data being played, fully considering user settings and requirements, and improving user experience.
  • S312 Determine whether to pause the audio data according to the first user habit data, and obtain a second pause judgment result.
  • the first user habit data refers to data used to characterize user habit.
  • the first user habit data may include the user's habit action data when the earphone is pulled out or disconnected, the user's playing frequency data and playing channel data of the audio data, and so on.
  • the first user habit data can be obtained by collecting and counting data information corresponding to the user's daily operation habits.
  • the first user habit data may be stored in a memory in advance, or may be obtained through a server.
  • the electronic device analyzes the first user habit data to determine whether to pause the playback of the audio data when the headset is unplugged or disconnected to obtain the second pause judgment result. For example, according to the analysis of the first user's habit data, when the headset is unplugged or disconnected, the user is used to click to pause playback or turn off the volume, and the second pause judgment result is to pause playback of the audio data. Or, according to the analysis of the first user's habit data, when the user's audio playback program mostly plays the currently played song by the speaker, the second pause judgment result is that the audio data is paused. Or, according to the first user habit data, the user's frequency of playing the currently playing song is low, and the second pause judgment result is that the audio data is paused.
  • S312 specifically includes:
  • the result of the second pause judgment is to continue playing the audio data.
  • the pause data refers to data in the first user habit data that indicates that the user is used to pause playback when the headset is unplugged or disconnected.
  • the first preset threshold may be set according to actual needs. For example, the first user habit data is obtained, and according to the analysis, when the headset is unplugged or disconnected, when the user clicks to pause the playback data is greater than the first preset threshold, it means that the user is used to unplug or disconnect the headset When on, pause playback. Therefore, the result of the second pause judgment is to pause playing of the audio data. On the contrary, the result of the second pause judgment is to continue to play the audio data.
  • whether to pause the audio data is determined according to the first user habit data, and the audio data is processed differently according to the user's habits, which further improves the intelligence of audio data playback and greatly improves User experience.
  • S313 Determine whether to pause the audio data according to the first surrounding environment data, and obtain a third pause judgment result.
  • the first surrounding environment data refers to data characterizing the surrounding environment conditions in which the electronic device is located.
  • the first surrounding environment data may include environmental noise volume data, time data, and the like.
  • the environmental noise volume data is used to characterize the amount of noise in the environment in which the electronic device is currently located.
  • the environmental noise volume data may be collected by sensors such as a microphone provided in the electronic device.
  • the environmental noise volume data can also be obtained through a server or the like.
  • the time data refers to what time the current time is.
  • the time data may be obtained through a network, or may be obtained through a time module of the electronic device. It can be understood that, according to different requirements, the first surrounding environment data may also include other data characterizing the surrounding environment, which is not specifically limited in this application.
  • the electronic device determines whether to pause playback of the audio data according to the first surrounding environment data in combination with a preset judgment criterion, and obtains a third suspension judgment result.
  • S313 specifically includes:
  • the third pause judgment result is that the audio data is paused
  • the result of the third pause judgment is to continue to play the audio data.
  • the first preset condition may be set according to actual needs.
  • the first surrounding environment data meets the first preset condition, it means that the surrounding environment meets the conditions for pausing playback of the audio data, and the result of the third pause is determined to be pausing playback of the audio data.
  • the third pause judgment result is that the audio data continues to play.
  • the first ambient environment data includes the ambient noise volume data.
  • the third suspension judgment result is Pause the audio data, specifically:
  • the third pause judgment result is that the audio data is paused.
  • the second preset threshold may be set according to actual needs.
  • the ambient noise volume data is less than the second preset threshold, it indicates that the surrounding environment is relatively quiet, and when the headset is unplugged or disconnected, the audio data is suspended.
  • the surrounding environment in which the electronic device is currently located is determined based on the ambient noise volume data, and the audio data is processed differently according to different surrounding environments to prevent the surrounding environment from being quiet and unsuitable for use Play audio data in the environment of speakers or earpieces.
  • the method provided in this embodiment further improves the intelligence of audio playback control and improves the user experience.
  • the first surrounding environment data includes time data.
  • the third pause judgment result is that the audio The data is paused, specifically:
  • the third pause judgment result is that the audio data is paused.
  • the preset range can be set according to actual needs, or can be set and selected by the user.
  • the time data in the preset range represents a period of time suitable for pausing playback of the audio data when the headset is unplugged or disconnected.
  • the preset range may be: a sleep time period of 20: 00-7: 00, or a lunch time period of 12:00-14:00. If the current time is within the preset time period, the third pause judgment result is to pause playing of the audio data. On the contrary, the result of the third pause judgment is to continue playing the audio data.
  • the current surrounding environment of the electronic device is judged by the time data, and the audio data is processed differently according to different surrounding environments, to prevent the use of speakers or nighttime or rest time, etc. Play audio data in the environment of the handset.
  • the method provided in this embodiment further improves the intelligence of audio playback control and improves the user experience.
  • S314 Determine whether to pause playback of the audio data according to the first pause judgment result, the second pause judgment result, and the third pause judgment result, to obtain the first processing strategy.
  • the electronic device obtains the first processing strategy according to a preset algorithm and the judgment results of S311, S312, and S313. According to the judgment results of S311, S312, and S313, the electronic device may derive that there are multiple algorithms for the first processing strategy, which are not specifically limited in this application.
  • S314 includes:
  • the first processing strategy is to The data is paused; otherwise, the first processing strategy is to continue to play the audio data.
  • the method provided in this embodiment fully considers user settings, user habits, and surrounding environment conditions to determine whether the audio data being played is paused when the headset is unplugged or disconnected, which improves intelligence, and further Improve user experience.
  • the judging whether to pause the playback of the audio data to obtain the first processing strategy may also be to sequentially set data according to the first user, the first The user habit data and the first surrounding environment data determine whether to pause the audio data.
  • S310 specifically includes:
  • S311 Determine whether to pause the audio data according to the first user setting data, and obtain a first pause judgment result.
  • the first processing strategy is to pause playback of the audio data.
  • step S40 may be entered, and the electronic device pauses the playback of the audio data.
  • the method further includes:
  • the first processing strategy is to pause playing of the audio data.
  • step S40 may be entered, and the electronic device pauses playing of the audio data.
  • the method further includes:
  • the first processing strategy is to continue to play the audio data.
  • the first processing strategy is obtained according to the third suspension judgment result.
  • the electronic device processes the audio data being played according to the first processing strategy.
  • the method provided in this embodiment sequentially determines whether to pause playback of the audio data according to the first user setting data, the first user habit data, and the first surrounding environment data, and the determination efficiency is high and can be effective Save memory.
  • the above embodiment is a method for controlling the audio data being played when the headset is unplugged or disconnected.
  • a method for controlling the audio data that has been paused when the headset is plugged in or connected again will be described.
  • the method further includes S50, S60, and S70:
  • the audio data being played is paused according to the first processing strategy, and the electronic device further monitors the connection status of the headset and the electronic device.
  • the method for the electronic device to monitor the connection status of the earphone and the electronic device is similar to the above embodiment, and will not be repeated here.
  • the second processing strategy may include multiple specific processing schemes, and the electronic device selects one or more processing schemes according to a preset selection algorithm.
  • the second processing strategy may be to resume playback of the audio data or continue to pause playback through the audio data output program, and the second processing strategy may be to switch the output channel of the audio data, the first
  • the second processing strategy may also be to adjust the output volume of the audio data.
  • S70 Control the playing of the audio data according to the second processing strategy.
  • the electronic device After the earphone is inserted or connected, the electronic device switches the audio output channel to the earphone channel according to a preset switching rule.
  • the electronic device controls the playback of the audio data according to different situations by executing the second processing strategy, thereby improving intelligence.
  • the method provided in this embodiment does not require the user to manually operate the playback of the audio data when the earphone is plugged in or connected, which further improves the intelligence of audio data playback control, thereby improving the user experience.
  • the acquiring the second processing strategy for the audio data includes:
  • S610 Determine whether to resume playing the audio data to obtain the second processing strategy.
  • the second processing strategy includes resuming playback of the paused audio data or continuing pause.
  • the electronic device determines whether to resume playback of the paused audio data or continue to pause according to a preset judgment rule.
  • the judgment rule can be set according to actual needs, and this application is not limited. For example, the judgment rule can be set according to the surrounding environment, according to user settings or according to user habits, etc., so as to meet different use environments and needs.
  • the electronic device executes the second processing strategy to resume the paused audio data without manual operation by the user. If the second processing strategy is to continue to pause the audio data, the electronic device does not process the audio data, and the audio data continues to maintain the pause state.
  • the method determines whether to resume the audio data according to different situations, so as to resume or continue to pause the audio data in a paused state, which improves the intelligence of audio playback processing and improves User experience.
  • S610 includes S611, S612, S613, and S614:
  • S611 Determine whether to resume playing the audio data according to the second user setting data, and obtain a first restoration judgment result.
  • the second user setting data refers to data preset by the user.
  • the second user setting data is used to characterize the way the user prefers to process the audio data when the headset is plugged in or connected.
  • the electronic device may display a selection item to a user through a system setting interface or a setting interface of the audio data program to collect and obtain the second user setting data.
  • the second user setting data may be: 1) when the earphone is plugged in or connected, resume playing audio data; 2) when the earphone is plugged in or connected, continue to pause the audio data.
  • S611 includes:
  • the result of the first restoration judgment is to continue to pause the audio data.
  • the preset recovery data refers to the data preset by the user as "when the earphone is plugged in or connected, the playback of audio data is resumed". If the second user setting data acquired by the electronic device includes the preset recovery data, it indicates that when the earphone is plugged in or connected, the user prefers to resume playback. Then, the first resume judgment result is to resume playing the audio data; otherwise, the first resume judgment result is to continue to pause the audio data. In this embodiment, the second user setting data is used to determine whether to play back the audio data in the suspended state, fully consider the user's settings and requirements, and improve the user experience.
  • S612 Determine whether to resume playing the audio data according to the second user habit data, and obtain a second pause judgment result.
  • the second user habit data refers to data used to characterize user habit.
  • the second user habit data may include the user's habit action data when the earphone is plugged in or connected, the user's playing frequency data and playing channel data of the audio data, and so on.
  • the second user habit data can be obtained by collecting and counting data information corresponding to the user's daily operation habits.
  • the second user habit data may be stored in the memory in advance, or may be obtained through a server.
  • the electronic device analyzes the second user habit data to determine whether to resume playback of the audio data when the headset is plugged in or connected to obtain the second recovery judgment result. For example, according to the analysis of the second user's habit data, when the earphone is plugged in or connected, the user is used to clicking the play button or turning on the volume, then the second recovery judgment result is to resume playing the audio data. Alternatively, according to the analysis of the second user's habit data, when the user's audio playback program mostly plays the currently played song with headphones, the second recovery judgment result is to resume playback of the audio data. Or, according to the second user habit data, the user has a higher frequency of playing the currently playing song, and the second recovery judgment result is to resume the playback of the audio data.
  • S612 includes:
  • the result of the second pause judgment is to continue to pause the audio data.
  • the recovery data refers to data in the second user habit data that characterizes the user's habit of recovering playback when a headset is plugged in or connected.
  • the third preset threshold may be set according to actual needs. For example, the second user habit data is obtained, and according to the analysis, when the headset clicks to resume or play, the data that the user clicks to resume playing is greater than the third preset threshold, indicating that the user is used to resume when the headset is inserted or connected Play. Therefore, the second recovery judgment result is to resume playing the audio data. On the contrary, the second recovery judgment result is to continue to pause the audio data.
  • whether to resume playing the audio data is determined according to the second user habit data, and the audio data is processed differently according to the user's habit, which further improves the intelligence of audio data playback and greatly improves User experience.
  • S613 Determine whether to resume playing the audio data according to the earphone detachment time, and obtain a third restoration judgment result.
  • the earphone detachment time refers to the time difference from the time when the earphone is last unplugged or disconnected to the time when the earphone is inserted or connected. For example, when the user unplugs or disconnects the earphone last time at 14:35, and this time the user inserts or connects the earphone at 14:45, the earphone disconnection time is 10 minutes.
  • the earphone disconnection time may be obtained through a network, or may be obtained through a time module of the electronic device.
  • the electronic device determines whether to resume playback of the audio data according to the earphone disconnection time and a preset judgment criterion, and obtains a third restoration judgment result.
  • S613 includes:
  • the second recovery judgment result is to resume playback of the audio data
  • the second recovery judgment result is to continue to pause the audio data.
  • the preset time threshold may be set according to actual needs, or may be set and selected by a user. For example, if the preset time threshold is 15 minutes, then, when the headset detachment time is less than 15 minutes, the second recovery judgment result is to resume playback of the audio data. Conversely, when the earphone detachment time is greater than 15 minutes, the second recovery judgment result is to continue to pause the audio data.
  • the method provided in this embodiment further improves the intelligence of audio playback control and improves the user experience.
  • S614 Determine whether to resume playback of the audio data according to the first recovery judgment result, the second recovery judgment result, and the third recovery judgment result, to obtain the second processing strategy.
  • the electronic device obtains the second processing strategy according to a preset algorithm and the judgment results of S611, S612, and S613. According to the judgment results of S611, S612, and S613, the electronic device may conclude that there may be multiple algorithms for the second processing strategy, which is not specifically limited in this application.
  • S614 includes:
  • the second processing strategy is to The data is resumed and played
  • the second processing strategy is to continue to pause the audio data.
  • the method provided in this embodiment fully considers user settings, user habits, and headset disconnection time to determine whether to resume playback of the audio data in a paused state when the headset is plugged in or connected, improving intelligence, In turn, the user experience is improved.
  • the judging whether to resume playing the audio data to obtain the second processing strategy may also be setting the data and the second according to the second user in sequence.
  • the user's habit data and the time when the headset is detached determine whether to pause the audio data.
  • S610 specifically includes:
  • S611 Determine whether to resume playing the audio data according to the second user setting data, and obtain a first restoration judgment result.
  • the second processing strategy is to resume playing the audio data.
  • step S70 may be entered, and the electronic device resumes playing the audio data.
  • the method further includes:
  • step S70 may be entered, and the electronic device resumes playing the audio data.
  • the method further includes:
  • the second processing strategy is obtained according to the third recovery judgment result.
  • the electronic device processes the audio data in the suspended state according to the second processing strategy.
  • the method provided in this embodiment sequentially determines whether to resume playback of the audio data based on the second user setting data, the second user habit data, and the headset detachment time, which has high judgment efficiency and can effectively save memory .
  • an embodiment of the present application provides a playback control device 10, which is applied to electronic equipment.
  • the device includes a playback monitoring module 100, a first headset monitoring module 200, a first policy acquisition module 300, and a first playback control Module 400. among them,
  • the playback monitoring module 100 is used to monitor whether there is audio data being played in the electronic device
  • the first earphone monitoring module 200 is used to monitor the connection status of the earphone and the electronic device when there is audio data being played in the electronic device, and determine whether the earphone has unplugged or disconnected behavior;
  • the first strategy obtaining module 300 is used to obtain a first processing strategy for the audio data when the headset is unplugged or disconnected;
  • the first playback control module 400 is used to control the playback of the audio data according to the first processing strategy.
  • the first strategy acquisition module 300 is specifically configured to determine whether to pause the audio data to obtain the first processing strategy.
  • the first policy acquisition module 300 includes:
  • a first pause judgment unit configured to judge whether to pause the audio data according to the first user setting data, and obtain a first pause judgment result
  • a second pause judgment unit configured to judge whether to pause the audio data according to the first user habit data, and obtain a second pause judgment result
  • a third pause judgment unit configured to judge whether to pause the audio data according to the first surrounding environment data, and obtain a third pause judgment result
  • the first comprehensive judgment unit is configured to judge whether to pause playback of the audio data according to the first pause judgment result, the second pause judgment result, and the third pause judgment result, to obtain the first processing strategy.
  • the first comprehensive judgment unit is specifically used to:
  • the first processing strategy is judged to be to the audio data Pause playback; otherwise, determine that the first processing strategy is to continue playing the audio data.
  • the first pause judgment unit includes a first user setting data acquisition subunit and a first user setting data judgment subunit.
  • the first user setting data obtaining sub-unit is used to obtain the first user setting data;
  • the first user setting data judging sub-unit is used when the first user setting data includes preset pause data, Judging that the result of the first pause judgment is to pause playing of the audio data; otherwise, judging that the result of the first pause judgment is to continue playing of the audio data.
  • the second pause judgment unit includes a first user habit data acquisition subunit and a first user habit judgment subunit.
  • the first user habit data obtaining sub-unit is used to obtain the pre-stored first user habit data; the first user habit judgment sub-unit is used when the number of suspended data in the first user habit data is greater than
  • the first preset threshold determines that the second pause judgment result is to pause playing of the audio data; otherwise, judges that the second pause judgment result is to continue playing of the audio data.
  • the third pause judgment unit includes a surrounding environment data acquisition subunit and a surrounding environment data judgment subunit.
  • the surrounding environment data obtaining sub-unit is used to obtain first surrounding environment data;
  • the surrounding environment data judging sub-unit is used to judge the third when the first surrounding environment data meets the first preset condition The pause judgment result is that the audio data is paused; otherwise, it is judged that the third pause judgment result is that the audio data is continued to be played.
  • the first ambient environment data includes ambient noise volume data
  • the ambient environment data acquisition subunit is configured to determine the third pause judgment when the ambient noise volume data is less than a second preset threshold As a result, the audio data is paused.
  • the first surrounding environment data includes time data
  • the surrounding environment data obtaining subunit is configured to judge that the third pause judgment result is pause on audio data when the time data is within a preset range Play.
  • the first pause judgment unit is used to judge whether to pause the audio data according to the first user setting data to obtain a first pause judgment result; when the first pause judgment result is If the audio data is paused, it is determined that the first processing strategy is to pause the audio data.
  • the second pause judgment unit is used to judge whether to pause the audio data according to the first user habit data when the result of the first pause judgment is to continue to play the audio data, A second pause judgment result is obtained; if the second pause judgment result is to pause playback of the audio data, it is judged that the first processing strategy is to pause playback of the audio data.
  • the third pause judgment unit is used to judge whether to pause the audio data according to the first surrounding environment data when the second pause judgment result is to continue playing the audio data, A third pause judgment result is obtained; when the third pause judgment result is to pause playback of the audio data, it is judged that the first processing strategy is to pause playback of the audio data; when the third pause judgment result is If the audio data continues to be played, it is determined that the first processing strategy is to continue playing the audio data.
  • the device further includes a second earphone monitoring module, a second policy acquisition module, and a second playback control module. among them,
  • the second earphone monitoring module is used to monitor the connection status of the earphone and the electronic device when the first processing strategy is to pause the playback of the audio data, and determine whether the earphone has inserted or connected behavior;
  • the second strategy acquisition module is used to acquire a second processing strategy for the audio data when the headset has an insertion or connection behavior
  • the second playback control module is used to control the playback of the audio data according to the second processing strategy.
  • the second strategy acquisition module is used to determine whether to resume playing the audio data to obtain the second processing strategy.
  • the second strategy acquisition module includes:
  • a first restoration judgment unit configured to judge whether to resume playing the audio data according to the second user setting data, and obtain a first restoration judgment result
  • a second resume judgment unit configured to judge whether to resume playing the audio data according to the second user habit data, and obtain a second pause judgment result
  • a third restoration judgment unit configured to judge whether to resume playing the audio data according to the earphone detachment time, and obtain a third restoration judgment result
  • the second comprehensive judgment unit is configured to judge whether to resume playing the audio data according to the first restoration judgment result, the second restoration judgment result, and the third restoration judgment result, to obtain the second processing strategy.
  • the second comprehensive judgment unit is specifically configured to:
  • the second processing strategy is to judge the audio data Resume playback; otherwise, determine that the second processing strategy is to continue to pause the audio data.
  • the first restoration judgment unit includes a second user setting data acquisition subunit and a second user setting data judgment subunit.
  • the second user setting data obtaining subunit is used to obtain the second user setting data;
  • the second user setting data judging subunit is used when the second user setting data includes preset recovery data, It is judged that the first resume judgment result is to resume playing the audio data; otherwise, it is judged that the first resume judgment result is to continue to pause the audio data.
  • the second restoration judgment unit includes a second user habit data acquisition subunit and a second user habit data judgment subunit.
  • the second user habit data acquisition sub-unit is used to obtain the pre-stored second user habit data; the second user habit data judgment sub-unit is used to recover the amount of data in the second user habit data If it is greater than the third preset threshold, it is determined that the second recovery determination result is to resume playing the audio data; otherwise, it is determined that the second recovery determination result is to continue to pause the audio data.
  • the third restoration judgment unit includes a headset detachment time acquisition subunit and a headset detachment time judgment subunit.
  • the headset detachment time obtaining subunit is used to obtain the headset detachment time;
  • the headset detachment time judgment subunit is used to determine that the second recovery judgment result is correct when the headset detachment time is less than a preset time threshold The audio data resumes playing; otherwise, it is judged that the second resume judgment result is to continue to pause the audio data.
  • the first restoration judgment unit is used to judge whether to resume playing the audio data according to the second user setting data to obtain a first restoration judgment result; when the first restoration judgment result is When the audio data resumes playing, it is determined that the second processing strategy is to resume playing the audio data.
  • the second resume judgment unit is used to judge whether to resume playing the audio data according to the second user habit data when the result of the first resume judgment is to continue to pause the audio data, A second recovery judgment result is obtained; if the second recovery judgment result is to resume playing the audio data, the second processing strategy is to resume playing the audio data.
  • the third recovery judgment unit is used to determine whether to resume playback of the audio data according to the earphone off time when the second recovery judgment result is to continue to pause the audio data, and obtain the third Three recovery judgment results; if the third recovery judgment result is to resume playing the audio data, the second processing strategy is to resume playing the audio data; if the third recovery judgment result is to the If the audio data continues to be suspended, the second processing strategy is to continue to pause the audio data.
  • each module in the above-mentioned playback control device is for illustration only. In other embodiments, the playback control device may be divided into different modules as needed to complete all or part of the functions of the above-mentioned playback control device.
  • Each module in the above-mentioned playback control device may be implemented in whole or in part by software, hardware, or a combination thereof.
  • the above modules may be embedded in the hardware or independent of the processor in the electronic device, or may be stored in the memory in the electronic device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
  • 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 when the computer-executable instructions are executed by one or more processors, cause the processors to perform the steps S10-S40 of the above-mentioned playback control method.
  • one or more non-volatile computer-readable storage media containing computer-executable instructions when the computer-executable instructions are executed by one or more processors, may also cause the processor to perform any of the foregoing implementations Example playback control method.
  • the computer-readable storage medium provided by the foregoing embodiments has similar implementation principles and technical effects to the foregoing method embodiments, and will not be repeated here.
  • An embodiment of the present application also provides an electronic device. As shown in FIG. 15, for convenience 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.
  • the electronic device may be any terminal device including a mobile phone, tablet computer, PDA (Personal Digital Assistant), POS (Point of Sales), in-vehicle computer, wearable device, etc. that has a voice call function and has a speaker , Taking an electronic device as a mobile phone as an example:
  • the mobile phone 1000 includes: a radio frequency (Radio Frequency) circuit 1010, a memory 1020, an input unit 1030, a display unit 1040, a sensor 1050, an audio circuit 1060, a wireless fidelity (WiFi) module 1070, a processor 1080, and power supply 1090 and other components.
  • a radio frequency (Radio Frequency) circuit 1010 for detecting radio frequency (Radio Frequency)
  • a memory 1020 includes a memory 1020, an input unit 1030, a display unit 1040, a sensor 1050, an audio circuit 1060, a wireless fidelity (WiFi) module 1070, a processor 1080, and power supply 1090 and other components.
  • WiFi wireless fidelity
  • the structure of the mobile phone shown in FIG. 15 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 1010 can be used to receive and send 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 1080; it can also send 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 1010 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), 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 1020 may be used to store software programs and modules.
  • the processor 1080 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 1020.
  • the memory 1020 may mainly include a program storage area and a data storage area, where the program storage area may store an operating system and at least one function-required application program (such as a sound playback function application program, an image playback function application program, etc.), etc.;
  • the data storage area can store data (such as audio data, address book, etc.) created according to the use of the mobile phone.
  • the memory 1020 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 1030 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 1000.
  • the input unit 1030 may include a touch panel 1031 and other input devices 1032.
  • the touch panel 1031 also known as a touch screen, can collect user's touch operations on or near it (for example, the user uses any suitable objects or accessories such as fingers, stylus, etc. on or near the touch panel 1031 Operation), and drive the corresponding connection device according to the preset program.
  • the touch panel 1031 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 1080, and can receive the commands sent by the processor 1080 and execute them.
  • the touch panel 1031 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves.
  • the input unit 1030 may also include other input devices 1032.
  • other input devices 1032 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), and the like.
  • the display unit 1040 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 1040 may include a display panel 1041.
  • the display panel 1041 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.
  • the touch panel 1031 may cover the display panel 1041, and when the touch panel 1031 detects a touch operation on or near it, it is transmitted to the processor 1080 to determine the type of touch event, and then the processor 1080 according to The type of touch event provides a corresponding visual output on the display panel 1041.
  • the touch panel 1031 and the display panel 1041 are implemented as two independent components to realize the input and input functions of the mobile phone, in some embodiments, the touch panel 1031 and the display panel 1041 may be integrated to Realize the input and output functions of the mobile phone.
  • the mobile phone 1000 may further include at least one sensor 1050, 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 1041 according to the brightness of the ambient light, and the proximity sensor may close the display panel 1041 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 1060, the speaker 1061, and the microphone 1062 may provide an audio interface between the user and the mobile phone.
  • the audio circuit 1060 can transmit the converted electrical signal of the received audio data to the speaker 1061, which converts the speaker 1061 into a sound signal output; on the other hand, the microphone 1062 converts the collected sound signal into an electrical signal, which is converted by the audio circuit 1060 After receiving, it is converted into audio data, and then processed by the audio data output processor 1080, and then sent to another mobile phone through the RF circuit 1010, or the audio data is output to the memory 1020 for subsequent processing.
  • WiFi is a short-range wireless transmission technology. Mobile phones can help users send and receive emails, browse web pages, and access streaming media through the WiFi module 1070. It provides users with wireless broadband Internet access.
  • FIG. 15 shows the WiFi module 1070, it can be understood that it is not a necessary component of the mobile phone 1000, and may be omitted as needed.
  • the processor 1080 is the control center of the mobile phone, and uses various interfaces and lines to connect the various parts of the entire mobile phone, by running or executing the software programs and/or modules stored in the memory 1020, and calling the data stored in the memory 1020 to execute Various functions and processing data of the mobile phone, so as to monitor the mobile phone as a whole.
  • the processor 1080 may include one or more processing units.
  • the processor 1080 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 1080.
  • the mobile phone 1000 further includes a power supply 1090 (such as a battery) for powering various components.
  • a power supply 1090 (such as a battery) for powering various components.
  • the power supply can be logically connected to the processor 1080 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 1000 may further include a camera, a Bluetooth module, and the like.
  • an electronic device includes a memory and a processor.
  • the memory stores computer-readable instructions.
  • the processor is caused to execute any of the foregoing embodiments. Steps of the audio 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)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Headphones And Earphones (AREA)
  • Circuit For Audible Band Transducer (AREA)
  • Reverberation, Karaoke And Other Acoustics (AREA)

Abstract

一种播放控制方法和装置、计算机可读存储介质、电子设备,播放控制方法应用于电子设备,播放控制方法包括:监测所述电子设备中是否有正在播放的音频数据(S10);若所述电子设备中有正在播放的音频数据,则监测耳机与所述电子设备的连接状态,判断所述耳机是否有拔出或断开行为(S20);若所述耳机有拔出或断开行为,则获取对所述音频数据的第一处理策略(S30);及根据所述第一处理策略控制所述音频数据的播放(S40)。

Description

播放控制方法和装置、计算机可读存储介质、电子设备 技术领域
本申请涉及电子设备技术领域,特别是涉及播放控制方法和装置、计算机可读存储介质、电子设备。
背景技术
现代生活中,电子设备已成为人们日常生活中不可或缺的一部分。在利用电子设备观看视频或欣赏音乐时,人们往往会佩戴耳机。
当与电子设备连接的耳机突然拔出或断开时,电子设备的音频输出通道一般切换为扬声器或听筒,而正在观看的视频或正在欣赏的音乐仍然在播放,这会对周围的人造成影响。
发明内容
本申请实施例提供一种播放控制方法和装置、计算机可读存储介质、电子设备,可以根据不同的情况对正在播放的音频数据进行不同的处理,智能性高,提高用户体验。
一种播放控制方法,应用于电子设备,所述方法包括:
监测所述电子设备中是否有正在播放的音频数据;
若所述电子设备中有正在播放的音频数据,则监测耳机与所述电子设备的连接状态,判断所述耳机是否有拔出或断开行为;
若所述耳机有拔出或断开行为,则获取对所述音频数据的第一处理策略;及
根据所述第一处理策略控制所述音频数据的播放。
一种播放控制装置,应用于电子设备,所述装置包括:
播放监测模块,用于监测所述电子设备中是否有正在播放的音频数据;
第一耳机监测模块,用于当所述电子设备中有正在播放的音频数据时,监测耳机与所述电子设备的连接状态,判断所述耳机是否有拔出或断开行为;
第一策略获取模块,用于当所述耳机有拔出或断开行为,获取对所述音频数据的第一处理策略;及
第一播放控制模块,用于根据所述第一处理策略控制所述音频数据的播放。
一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述的播放控制方法的步骤。
一种电子设备,包括存储器及处理器,所述存储器中储存有计算机可读指令,所述指令被所述处理器执行时,使得所述处理器执行上述的播放控制方法。
上述播放控制方法和装置、计算机可读存储介质、电子设备,通过获取对所述音频数据的第一处理策略,并根据所述第一处理策略控制所述音频数据的播放,使得所述电子设备有正在播放的音频数据,且所述耳机有拔出或断开行为时,能够根据不同的场景和情况,及时对正在播放的音频数据进行处理,防止周围对周围环境造成影响。本申请提供的所述播放控制方法提高了所述电子设备的智能性,从而提高了用户体验度。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他实施例的附图。
图1为本申请一个实施例提供的电子设备的内部结构示意图;
图2为本申请一个实施例提供的播放控制方法流程示意图;
图3为本申请一个实施例提供的判断是否对所述音频数据暂停播放,得到所述第一处 理策略的方法流程示意图;
图4为本申请一个实施例提供的根据第一用户设置数据判断是否对所述音频数据暂停播放,得到第一暂停判断结果的方法流程示意图;
图5为本申请一个实施例提供的根据第一用户习惯数据判断是否对所述音频数据暂停播放,得到第二暂停判断结果的方法流程示意图;
图6为本申请一个实施例提供的根据第一周围环境数据判断是否对所述音频数据暂停播放,得到第三暂停判断结果的方法流程示意图;
图7为本申请一个实施例提供的判断是否对所述音频数据暂停播放,得到所述第一处理策略的方法流程示意图;
图8为本申请一个实施例提供的播放控制方法流程示意图;
图9为本申请一个实施例提供的判断是否对所述音频数据恢复播放,得到所述第二处理策略的方法流程示意图;
图10为本申请一个实施例提供的根据第二用户设置数据判断是否对所述音频数据恢复播放,得到第一恢复判断结果的方法流程示意图;
图11为本申请一个实施例提供的根据第二用户习惯数据判断是否对所述音频数据恢复播放,得到第二暂停判断结果的方法流程示意图;
图12为本申请一个实施例提供的根据耳机脱离时间判断是否对所述音频数据恢复播放,得到第三恢复判断结果的方法流程示意图;
图13为本申请一个实施例提供的所述判断是否对所述音频数据恢复播放,得到所述第二处理策略的方法流程示意图;
图14为本申请一个实施例提供的播放控制装置的框架示意图;
图15为与本申请实施例提供的电子设备相关的手机的部分结构的框图。
具体实施方式
为了便于理解本发明,下面将参照相关附图对本发明进行更全面的描述。附图中给出了本发明的较佳实施例。但是,本发明可以以许多不同的形式来实现,并不限于本文所描述的实施例。相反地,提供这些实施例的目的是使对本发明的公开内容的理解更加透彻全面。
在一个实施例中,如图1所示,提供了一种电子设备的内部结构示意图。该电子设备包括通过系统总线连接的处理器、存储器和显示屏。其中,该处理器用于提供计算和控制能力,支撑整个电子设备的运行。存储器用于存储数据、程序、和/或指令代码等,存储器上存储至少一个计算机程序,该计算机程序可被处理器执行,以实现本申请实施例中提供的适用于电子设备的播放控制方法。存储器可包括磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等非易失性存储介质,或随机存储记忆体(Random-Access-Memory,RAM)等。例如,在一个实施例中,存储器包括非易失性存储介质及内存储器。非易失性存储介质存储有操作系统、数据库和计算机程序。该数据库中存储有用于实现以上各个实施例所提供的一种播放控制方法相关的数据,比如可存储有每个进程或应用的名称等信息。该计算机程序可被处理器所执行,以用于实现本申请各个实施例所提供的一种播放控制方法。内存储器为非易失性存储介质中的操作系统、数据库和计算机程序提供高速缓存的运行环境。显示屏可以是触摸屏,比如为电容屏或电子屏,用于显示前台进程对应的应用的界面信息,还可以被用于检测作用于该显示屏的触摸操作,生成相应的指令,比如进行前后台应用的切换指令等。
本领域技术人员可以理解,图1中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的电子设备的限定,具体的电子设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。如该电子设备还包括通过系统总线连接的网络接口,网络接口可以是以太网卡或无线网卡等,用 于与外部的电子设备进行通信,比如可用于同服务器进行通信。
请参见图2,本申请一个实施例提供一种播放控制方法,所述播放控制方法应用于具有耳机通道的电子设备。所述耳机可以是有线耳机,也可以无线耳机,如蓝牙耳机或红外线耳机等。本申请实施例提供的所述播放控制方法主要用于根据所述耳机通道的状态变换,控制所述电子设备音频数据的播放与暂停。在一个实施例中,所述电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、移动互联网设备(Mobile Internet Device,MID)、可穿戴设备(例如智能手表、智能手环、计步器等)或其他等具有音频数据播放功能并可以连接耳机的电子设备。
如图2所示,在一个实施例中,所述播放控制方法包括S10-S40。
S10,监测所述电子设备中是否有正在播放的音频数据。
所述音频数据可以是音频播放中的音频数据,也可以是视频播放中的音频数据,还可以即时通话中的音频数据等。所述电子设备可以通过实时监测当前音频数据输出程序的运行情况,根据所述音频数据输出程序的运行情况判断是否有正在播放的音频数据。例如,所述电子设备实时监测音乐播放软件及视频播放软件的运行情况,并判断是否有音频数据的输出。所述电子设备也可以通过实时监测耳机通道的音频数据输出情况,根据耳机通道是否有音频数据的输出,判断是否有正在播放的音频数据。例如,根据有线耳机输出通道或无线耳机输出通道是否有音频数据传输,并判断是否有正在播放的音频数据。
S20,若所述电子设备中有正在播放的音频数据,则监测耳机与所述电子设备的连接状态,判断所述耳机是否有拔出或断开行为。
根据S20的判断结果,若所述电子设备中有正在播放的音频数据,则所述电子设备进一步监测耳机的连接状态。若所述耳机为有线耳机,可以通过所述有线耳机的接口数据判断所述耳机是否有拔出行为。若所述耳机为无线耳机,可以通过监测所述无线耳机与所述电子设备的连接数据,判断所述耳机是否有断开行为。
S30,若所述耳机有拔出或断开行为,则获取对所述音频数据的第一处理策略。
若所述电子设备中有正在播放的音频数据,且所述耳机有拔出或断开行为,则所述电子设备根据预设的算法,获取对正在播放的所述音频数据的处理策略。所述第一处理策略可以包括多种具体的处理方案,所述电子设备根据预设的选择算法,选择其中一种或多种处理方案。例如,所述第一处理策略可以为通过所述音频数据输出程序对所述音频数据进行暂停或播放,所述第一处理策略可以为切换所述音频数据的输出通道,所述第一处理策略还可以为调整所述音频数据的输出音量等。
S40,根据所述第一处理策略控制所述音频数据的播放。
当所述耳机拔出或断开后,所述电子设备一般根据预设切换规则,将的音频输出通道切换为扬声器或听筒等其他音频通道。所述电子设备通过执行所述第一处理策略,根据不同的情况控制所述音频数据的播放,防止所述耳机拔出或断开后,用扬声器或听筒播放音频数据对周围环境造成影响。
例如,在夜间听歌时,若所述耳机拔出或断开,所述电子设备通过预设的算法获取对正在播放音乐的第一处理策略,并执行所述第一处理策略,控制音乐的播放,防止耳机拔出或断开后,音乐通过扬声器突然播放,影响周围人休息。
本实施例中,所述播放控制方法,通过获取对所述音频数据的第一处理策略,并根据所述第一处理策略控制所述音频数据的播放,使得所述电子设备正在播放的音频数据,且所述耳机有拔出或断开行为时,能够根据不同的场景和情况,及时对正在播放的音频数据进行处理,防止周围对周围环境造成影响。本实施例提供的所述播放控制方法提高了所述电子设备的智能性,从而提高了用户体验度。
在一个实施例中,S30中,所述获取对所述音频数据的第一处理策略中,包括:
S310,判断是否对所述音频数据暂停播放,得到所述第一处理策略。
所述第一处理策略包括对所述音频数据暂停播放或继续播放。当所述电子设备中有正 在播放的音频数据,且所述耳机有拔出或断开行为时,所述电子设备根据预设的判断规则,判断对所述音频数据暂停播放还是继续播放。所述判断规则可以根据实际需求进行设定,本申请不做限定。例如,所述判断规则可以根据周围环境、根据用户设定情况,或者根据用户习惯等进行设定,从而可以满足不同的使用环境和使用需求。
若所述第一处理策略为对所述音频数据暂停播放,则所述电子设备执行所述第一处理策略,将正在播放的所述音频数据暂停播放,防止对周围环境造成影响。若所述第一处理策略为对所述音频数据继续播放,所述电子设备对所述音频数据不做处理,所述音频数据继续播放。
本实施例中,所述方法根据不同情况,判断是否对所述音频数据暂停播放,从而对正在播放的所述音频数据进行暂停播放或继续播放,提高了对音频播放处理的智能性,提高用户的体验度。
请参见图3,在一个实施例中,S310具体包括S311、S312、S313和S314:
S311,根据第一用户设置数据判断是否对所述音频数据暂停播放,得到第一暂停判断结果。
所述第一用户设置数据是指用户预先设置的数据。所述第一用户设置数据用于表征当所述耳机拔出或断开时,用户优先考虑的对所述音频数据的处理方式。所述电子设备可以通过系统设置界面或所述音频数据程序的设置界面,向用户展示选择项目,以收集获取所述第一用户设置数据。
例如,所述第一用户设置数据可以包括但不限于:1)当耳机拔出或断开时,暂停播放音频数据;2)当耳机拔出或断开时,继续播放音频数据。
请参见图4,在一个实施例中,S311具体包括:
S3111,获取所述第一用户设置数据;
S3112,若所述第一用户设置数据中包括预设暂停数据,则所述第一暂停判断结果为对所述音频数据暂停播放;
否则,所述第一暂停判断结果为对所述音频数据继续播放。
所述预设暂停数据是指用户预先设置的数据为“当耳机拔出或断开时,暂停播放音频数据”。若所述电子设备获取的所述第一用户设置数据包括所述预设暂停数据,说明当耳机拔出或断开时,用户优先选择暂停播放。则,所述第一暂停判断结果为对所述音频数据暂停播放;反之,所述第一暂停判断结果为对所述音频数据继续播放。本实施例中,通过所述第一用户设置数据,判断是否对正在播放的所述音频数据进行暂停播放,充分考虑用户的设置和要求,提高用户体验度。
S312,根据第一用户习惯数据判断是否对所述音频数据暂停播放,得到第二暂停判断结果。
所述第一用户习惯数据是指用于表征用户习惯的数据。所述第一用户习惯数据可以包括耳机拔出或断开时用户的习惯动作数据,用户对音频数据的播放频率数据及播放使用通道数据等。所述第一用户习惯数据可以通过收集、统计用户的日常操作习惯对应的数据信息得到。所述第一用户习惯数据可以预先存储于存储器,也可以通过服务器获取。
所述电子设备对所述第一用户习惯数据进行分析,从而判断当所述耳机拔出或断开时,是否对所述音频数据暂停播放,得到所述第二暂停判断结果。例如,根据所述第一用户习惯数据分析,在耳机拔出或断开时,用户习惯点击暂停播放或关掉音量,则,所述第二暂停判断结果为对所述音频数据暂停播放。或者,根据所述第一用户习惯数据分析,用户的音频播放程序中,对当前播放歌曲的播放多为扬声器播放时,则,所述第二暂停判断结果为对所述音频数据暂停播放。又或者,根据所述第一用户习惯数据,用户对当前播放歌曲的播放频率较低,则,所述第二暂停判断结果为对所述音频数据暂停播放。
请参见图5,在一个实施例中,S312具体包括:
S3121,获取预存的所述第一用户习惯数据;
S3122,若所述第一用户习惯数据中暂停数据的数量大于第一预设阈值,则所述第二暂停判断结果为对所述音频数据暂停播放;
否则,所述第二暂停判断结果为对所述音频数据继续播放。
所述暂停数据是指所述第一用户习惯数据中,表征用户习惯在耳机拔出或断开时暂停播放的数据。所述第一预设阈值可以根据实际需求设置。例如,获取所述第一用户习惯数据,根据分析,在所述耳机拔出或断开时,用户点击暂停播放的数据大于所述第一预设阈值时,表示用户习惯在耳机拔出或断开时,暂停播放。因此,所述第二暂停判断结果为对所述音频数据暂停播放。反之,所述第二暂停判断结果为对所述音频数据继续播放。本实施例中,根据所述第一用户习惯数据判断是否对所述音频数据进行暂停播放,结合用户的习惯对所述音频数据进行不同的处理,进一步提高了音频数据播放的智能性,大大提高用户的体验度。
S313,根据第一周围环境数据判断是否对所述音频数据暂停播放,得到第三暂停判断结果。
所述第一周围环境数据是指表征所述电子设备所处的周围环境状况的数据。在一个实施例中,所述第一周围环境数据可以包括环境噪声音量数据、时间数据等。所述环境噪声音量数据用于表征当前所述电子设备所处的环境中噪声的大小。所述环境噪声音量数据可以通过设置于所述电子设备的麦克风等传感器进行收集获得。所述环境噪声音量数据也可以通过服务器等下发获得。所述时间数据是指当前时刻为几点几分。所述时间数据可以通过网络获取,也可以通过所述电子设备的时间模块获取。可以理解,根据不同需求,所述第一周围环境数据也可以包括其他表征周围环境的数据,本申请不做具体限定。
所述电子设备根据所述第一周围环境数据,结合预设的判断准则,判断是否对所述音频数据暂停播放,得到第三暂停判断结果。
请参见图6,在一个实施例中,S313具体包括:
S3131,获取第一周围环境数据;
S3132,若所述第一周围环境数据满足第一预设条件,则所述第三暂停判断结果为对所述音频数据暂停播放;
否则,所述第三暂停判断结果为对所述音频数据继续播放。
所述第一预设条件可以根据实际需求进行设置。当所述第一周围环境数据满足第一预设条件,说明周围环境满足对所述音频数据暂停播放的条件,所述第三暂停被判断结果为对所述音频数据暂停播放。反之,所述第三暂停判断结果为所述音频数据继续播放。
在一个实施例中,所述第一周围环境数据包括所述环境噪音音量数据,S3132中,所述若所述第一周围环境数据满足第一预设条件,则所述第三暂停判断结果为对所述音频数据暂停播放,具体为:
若所述环境噪音音量数据小于第二预设阈值,则所述第三暂停判断结果为对音频数据暂停播放。
所述第二预设阈值可以根据实际需求设定。当所述环境噪音音量数据小于所述第二预设阈值,说明周围环境比较安静,当所述耳机拔出或断开时,对所述音频数据进行暂停。例如在办公环境或会议环境下,所述环境噪音音量数据小于所述第二预设阈值,则,所述第三暂停判断结果为对音频数据暂停播放。否则,所述第三暂停判断结果为对所述音频数据继续播放。本实施例中,通过所述环境噪音音量数据判断所述电子设备当前所处的周围环境,并根据不同的周围环境对所述音频数据进行不同的处理,防止在周围环境比较安静等不适合使用扬声器或听筒的环境下播放音频数据。本实施例提供的所述方法进一步提高了音频播放控制的智能性,提高了用户体验度。
在一个实施例中,所述第一周围环境数据包括时间数据,S3132中,所述若所述第一周围环境数据满足第一预设条件,则所述第三暂停判断结果为对所述音频数据暂停播放,具体为:
若所述时间数据处于预设范围,则所述第三暂停判断结果为对音频数据暂停播放。
所述预设范围可以根据实际需求设定,也可以由用户设置选择。所述预设范围的时间数据表征当所述耳机拔出或断开时,适合对所述音频数据暂停播放的时间段。例如,所述预设范围可以为:20:00-7:00的睡眠时间段,或12:00-14:00的午休时间段。若当前时间处于所述预设时间段,所述第三暂停判断结果为对所述音频数据暂停播放。反之,所述第三暂停判断结果为对所述音频数据继续播放。本实施例中,通过所述时间数据判断所述电子设备当前所处的周围环境,并根据不同的周围环境对所述音频数据进行不同的处理,防止在夜间或休息时间等不适合使用扬声器或听筒的环境下播放音频数据。本实施例提供的所述方法进一步提高了音频播放控制的智能性,提高了用户体验度。
S314,根据所述第一暂停判断结果、所述第二暂停判断结果和所述第三暂停判断结果判断是否对所述音频数据暂停播放,得到所述第一处理策略。
所述电子设备根据预设的算法,以及S311、S312和S313的判断结果,得出所述第一处理策略。所述电子设备根据S311、S312和S313的判断结果得出所述第一处理策略的算法可以有多种,本申请不做具体限定。
在一个实施例中,S314包括:
若所述第一暂停判断结果、所述第二暂停判断结果和所述第三暂停判断结果中至少有一个为对所述音频数据暂停播放,则,所述第一处理策略为对所述音频数据暂停播放;否则,所述第一处理策略为对所述音频数据继续播放。
本实施例提供的所述方法充分考虑用户设置、用户习惯和周围环境情况来判断当所述耳机拔出或断开时,是否对正在播放的所述音频数据暂停播放,提高了智能性,进而提高了用户体验度。
请参见图7,在一个实施例中,S310,所述判断是否对所述音频数据暂停播放,得到所述第一处理策略,还可以为依次根据所述第一用户设置数据、所述第一用户习惯数据和所述第一周围环境数据判断是否对所述音频数据暂停播放。S310具体包括:
S311,根据第一用户设置数据判断是否对所述音频数据暂停播放,得到第一暂停判断结果。
此步骤的具体过程与上述S311过程相同,在此不再赘述。
S312’若所述第一暂停判断结果为对所述音频数据暂停播放,则所述第一处理策略为对所述音频数据暂停播放。
也就是说,若所述第一暂停判断结果为对所述音频数据暂停播放,则可进入步骤S40,所述电子设备对所述音频数据进行暂停播放。
在一个实施例中,S311之后,所述方法还包括:
S313’,若所述第一暂停判断结果为对所述音频数据继续播放,则,根据第一用户习惯数据判断是否对所述音频数据暂停播放,得到第二暂停判断结果。
根据所述第一用户习惯数据判断是否对所述音频数据暂停播放,得到第二暂停判断结果的具体过程与上述S312过程相同,在此不再赘述。
S314’,若所述第二暂停判断结果为对所述音频数据暂停播放,则所述第一处理策略为对所述音频数据暂停播放。
也就是说,若所述第二暂停判断结果为对所述音频数据暂停播放,则可进入步骤S40,所述电子设备对所述音频数据进行暂停播放。
在一个实施例中,S313’之后,所述方法还包括:
S315’,若所述第二暂停判断结果为对所述音频数据继续播放,则,根据第一周围环境数据判断是否对所述音频数据暂停播放,得到第三暂停判断结果。
根据所述第一周围环境数据判断是否对所述音频数据暂停播放,得到第三暂停判断结果的具体过程与上述S313过程相同,在此不再赘述。
S316’,若所述第三暂停判断结果为对所述音频数据暂停播放,则所述第一处理策略为 对所述音频数据暂停播放;
S317’,若所述第三暂停判断结果为对所述音频数据继续播放,则所述第一处理策略为对所述音频数据继续播放。
根据所述第三暂停判断结果得出所述第一处理策略。所述电子设备根据所述第一处理策略对正在播放的所述音频数据进行处理。
本实施例提供的所述方法依次根据所述第一用户设置数据、所述第一用户习惯数据和所述第一周围环境数据判断是否对所述音频数据暂停播放,判断效率高,且能够有效节省内存。
以上实施例为当所述耳机拔出或断开时,对正在播放的所述音频数据的控制方法。以下结合实施例,对当所述耳机再次插入或连接时,对已经暂停播放的所述音频数据的控制方法进行说明。
请参见图8,在一个实施例中,S40之后,所述方法还包括S50、S60和S70:
S50,若所述第一处理策略为对所述音频数据暂停播放,则,
监测所述耳机与所述电子设备的连接状态,判断所述耳机是否有插入或连接行为。
当所述耳机拔出或断开后,根据所述第一处理策略对正在播放的所述音频数据进行了暂停播放,则所述电子设备进一步监测所述耳机与所述电子设备的连接状态。所述电子设备监测所述耳机与所述电子设备连接状态的方法与上述实施例相似,在此不再赘述。
S60,若所述耳机有插入或连接行为,则获取对所述音频数据的第二处理策略。
所述第二处理策略可以包括多种具体的处理方案,所述电子设备根据预设的选择算法,选择其中一种或多种处理方案。例如,所述第二处理策略可以为通过所述音频数据输出程序对所述音频数据进行恢复播放或继续暂停播放,所述第二处理策略可以为切换所述音频数据的输出通道,所述第二处理策略还可以为调整所述音频数据的输出音量等。
S70,根据所述第二处理策略控制所述音频数据的播放。
当所述耳机插入或连接后,所述电子设备根据预设切换规则,将音频输出通道切换为耳机通道。所述电子设备通过执行所述第二处理策略,根据不同的情况控制所述音频数据的播放,提高智能性。
本实施例提供的所述方法无需用户在耳机插回或连接时手动操作所述音频数据的播放,进一步提高了对音频数据播放控制的智能性,从而提高了用户体验度。
在一个实施例中,S60中,所述获取对所述音频数据的第二处理策略,包括:
S610,判断是否对所述音频数据恢复播放,得到所述第二处理策略。
所述第二处理策略包括对暂停的所述音频数据恢复播放或继续暂停。所述电子设备根据预设的判断规则,判断贵暂停的所述音频数据恢复播放还是继续暂停。所述判断规则可以根据实际需求进行设定,本申请不做限定。例如,所述判断规则可以根据周围环境、根据用户设定情况或者根据用户习惯等进行设定,从而可以满足不同的使用环境和使用需求。
若所述第二处理策略为对所述音频数据恢复播放,则所述电子设备执行所述第二处理策略,将暂停的所述音频数据恢复播放,无需用户手动操作。若所述第二处理策略为对所述音频数据继续暂停,所述电子设备对所述音频数据不做处理,所述音频数据继续维持暂停状态。
本实施例中,所述方法根据不同情况,判断是否对所述音频数据恢复播放,从而对处于暂停状态的所述音频数据进行恢复播放或继续暂停,提高了对音频播放处理的智能性,提高用户的体验度。
请参见图9,在一个实施例中,S610包括S611、S612、S613和S614:
S611,根据第二用户设置数据判断是否对所述音频数据恢复播放,得到第一恢复判断结果。
所述第二用户设置数据是指用户预先设置的数据。所述第二用户设置数据用于表征当 所述耳机插入或连接时,用户优先考虑的对所述音频数据的处理方式。所述电子设备可以通过系统设置界面或所述音频数据程序的设置界面,向用户展示选择项目,以收集、获取所述第二用户设置数据。
例如,所述第二用户设置数据可以为:1)当耳机插入或连接时,恢复播放音频数据;2)当耳机插入或连接时,继续暂停音频数据。
请参见图10,在一个实施例中,S611包括:
S6111,获取所述第二用户设置数据;
S6112,若所述第二用户设置数据中包括预设恢复数据,则所述第一恢复判断结果为对所述音频数据恢复播放;
否则,所述第一恢复判断结果为对所述音频数据继续暂停。
所述预设恢复数据是指用户预先设置的数据为“当耳机插入或连接时,恢复播放音频数据”。若所述电子设备获取的所述第二用户设置数据包括所述预设恢复数据,说明当耳机插入或连接时,用户优先选择恢复播放。则,所述第一恢复判断结果为对所述音频数据恢复播放;反之,所述第一恢复判断结果为对所述音频数据继续暂停。本实施例中,通过所述第二用户设置数据,判断是否对处于暂停状态的所述音频数据进行回复播放,充分考虑用户的设置和要求,提高用户体验度。
S612,根据第二用户习惯数据判断是否对所述音频数据恢复播放,得到第二暂停判断结果。
所述第二用户习惯数据是指用于表征用户习惯的数据。所述第二用户习惯数据可以包括耳机插入或连接时用户的习惯动作数据,用户对音频数据的播放频率数据及播放使用通道数据等。所述第二用户习惯数据可以通过收集、统计用户的日常操作习惯对应的数据信息得到。所述第二用户习惯数据可以预先存储于存储器,也可以通过服务器获取。
所述电子设备对所述第二用户习惯数据进行分析,从而判断当所述耳机插入或连接时,是否对所述音频数据恢复播放,得到所述第二恢复判断结果。例如,根据所述第二用户习惯数据分析,在耳机插入或连接时,用户习惯点击播放按钮或开启音量,则,所述第二恢复判断结果为对所述音频数据恢复播放。或者,根据所述第二用户习惯数据分析,用户的音频播放程序中,对当前播放歌曲的播放多为耳机播放时,则,所述第二恢复判断结果为对所述音频数据恢复播放。又或者,根据所述第二用户习惯数据,用户对当前播放歌曲的播放频率较高,则,所述第二恢复判断结果为对所述音频数据恢复播放。
请参见图11,在一个实施例中,S612包括:
S6121,获取预存的所述第二用户习惯数据;
S6122,若所述第二用户习惯数据中恢复数据的数量大于第三预设阈值,则所述第二恢复判断结果为对所述音频数据恢复播放;
否则,所述第二暂停判断结果为对所述音频数据进行继续暂停。
所述恢复数据是指所述第二用户习惯数据中,表征用户习惯在耳机插入或连接时恢复播放的数据。所述第三预设阈值可以根据实际需求设置。例如,获取所述第二用户习惯数据,根据分析,在所述耳机插入或连接时,用户点击恢复播放的数据大于所述第三预设阈值时,表示用户习惯在耳机插入或连接时,恢复播放。因此,所述第二恢复判断结果为对所述音频数据恢复播放。反之,所述第二恢复判断结果为对所述音频数据继续暂停。本实施例中,根据所述第二用户习惯数据判断是否对所述音频数据进行恢复播放,结合用户的习惯对所述音频数据进行不同的处理,进一步提高了音频数据播放的智能性,大大提高用户的体验度。
S613,根据耳机脱离时间判断是否对所述音频数据恢复播放,得到第三恢复判断结果。
所述耳机脱离时间是指自最近一次耳机拔出或断开时刻至本次耳机插入或连接时刻的时间差。例如,用户最近一次将耳机拔出或断开时在14时35分,本次用户将耳机插入或连接是在14时45分,则所述耳机脱离时间为10分钟。所述耳机脱离时间可以通过网 络获取,也可以通过所述电子设备的时间模块获取。
所述电子设备根据所述耳机脱离时间,结合预设的判断准则,判断是否对所述音频数据恢复播放,得到第三恢复判断结果。
请参见图12,在一个实施例中,S613包括:
S6131,获取耳机脱离时间;
S6132,若所述耳机脱离时间小于预设时间阈值,则所述第二恢复判断结果为对所述音频数据恢复播放;
否则,所述第二恢复判断结果为对所述音频数据进行继续暂停。
所述预设时间阈值可以根据实际需求设定,也可以由用户设置选择。例如,所述预设时间阈值为15分钟,则,当所述耳机脱离时间小于15分钟,则所述第二恢复判断结果为对所述音频数据恢复播放。反之,当所述耳机脱离时间大于15分钟,则所述第二恢复判断结果为对所述音频数据继续暂停。本实施例提供的所述方法进一步提高了音频播放控制的智能性,提高了用户体验度。
S614,根据所述第一恢复判断结果、所述第二恢复判断结果和所述第三恢复判断结果判断是否对所述音频数据恢复播放,得到所述第二处理策略。
所述电子设备根据预设的算法,以及S611、S612和S613的判断结果,得出所述第二处理策略。所述电子设备根据S611、S612和S613的判断结果得出所述第二处理策略的算法可以有多种,本申请不做具体限定。
在一个实施例中,S614包括:
若所述第一恢复判断结果、所述第二恢复判断结果和所述第三恢复判断结果中至少有一个为对所述音频数据恢复播放,则,所述第二处理策略为对所述音频数据进行恢复播放;
否则,所述第二处理策略为对所述音频数据继续暂停。
本实施例提供的所述方法充分考虑用户设置、用户习惯和耳机脱离时间等情况来判断当所述耳机插入或连接时,是否对处于暂停状态的所述音频数据恢复播放,提高了智能性,进而提高了用户体验。
请参见图13,在一个实施例中,S610,所述判断是否对所述音频数据恢复播放,得到所述第二处理策略,还可以为依次根据所述第二用户设置数据、所述第二用户习惯数据和所述耳机脱离时间判断是否对所述音频数据暂停播放。S610具体包括:
S611,根据第二用户设置数据判断是否对所述音频数据恢复播放,得到第一恢复判断结果。
此步骤的具体过程与上述S611过程相同,在此不再赘述。
S612’,若所述第一恢复判断结果为对所述音频数据恢复播放,则所述第二处理策略为对所述音频数据恢复播放。
也就是说,若所述第一恢复判断结果为对所述音频数据恢复播放,则可进入步骤S70,所述电子设备对所述音频数据进行恢复播放。
在一个实施例中,S611之后,所述方法还包括:
S613’,若所述第一恢复判断结果为对所述音频数据继续暂停,则,根据第二用户习惯数据判断是否对所述音频数据恢复播放,得到第二恢复判断结果。
根据所述第二用户习惯数据判断是否对所述音频数据恢复播放,得到第二恢复判断结果的具体过程与上述S612过程相同,在此不再赘述。
S614’,若所述第二恢复判断结果为对所述音频数据恢复播放,则所述第二处理策略为对所述音频数据恢复播放。
也就是说,若所述第二恢复判断结果为对所述音频数据恢复播放,则可进入步骤S70,所述电子设备对所述音频数据进行恢复播放。
在一个实施例中,S613’之后,所述方法还包括:
S615’,若所述第二恢复判断结果为对所述音频数据继续暂停,则,根据耳机脱离时间 判断是否对所述音频数据恢复播放,得到第三恢复判断结果。
根据所述耳机脱离时间判断是否对所述音频数据恢复播放,得到第三恢复判断结果的具体过程与上述S613过程相同,在此不再赘述。
S616’,若所述第三恢复判断结果为对所述音频数据恢复播放,则所述第二处理策略为对所述音频数据恢复播放;
S617’,若所述第三恢复判断结果为对所述音频数据继续暂停,则所述第二处理策略为对所述音频数据继续暂停。
根据所述第三恢复判断结果得出所述第二处理策略。所述电子设备根据所述第二处理策略对处于暂停状态的所述音频数据进行处理。
本实施例提供的所述方法依次根据所述第二用户设置数据、所述第二用户习惯数据和所述耳机脱离时间判断是否对所述音频数据恢复播放,判断效率高,且能够有效节省内存。
请参见图14,本申请一个实施例提供一种播放控制装置10,应用于电子设备,所述装置包括播放监测模块100、第一耳机监测模块200、第一策略获取模块300和第一播放控制模块400。其中,
所述播放监测模块100用于监测所述电子设备中是否有正在播放的音频数据;
所述第一耳机监测模块200用于当所述电子设备中有正在播放的音频数据时,监测耳机与所述电子设备的连接状态,判断所述耳机是否有拔出或断开行为;
所述第一策略获取模块300用于当所述耳机有拔出或断开行为,获取对所述音频数据的第一处理策略;
所述第一播放控制模块400用于根据所述第一处理策略控制所述音频数据的播放。
在一个实施例中,所述第一策略获取模块300具体用于判断是否对所述音频数据暂停播放,得到所述第一处理策略。
在一个实施例中,所述第一策略获取模块300包括:
第一暂停判断单元,用于根据第一用户设置数据判断是否对所述音频数据暂停播放,得到第一暂停判断结果;
第二暂停判断单元,用于根据第一用户习惯数据判断是否对所述音频数据暂停播放,得到第二暂停判断结果;
第三暂停判断单元,用于根据第一周围环境数据判断是否对所述音频数据暂停播放,得到第三暂停判断结果;
第一综合判断单元,用于根据所述第一暂停判断结果、所述第二暂停判断结果和所述第三暂停判断结果判断是否对所述音频数据暂停播放,得到所述第一处理策略。
在一个实施例中,所述第一综合判断单元具体用于:
当所述第一暂停判断结果、所述第二暂停判断结果和所述第三暂停判断结果中至少有一个为对所述音频数据暂停播放,判断所述第一处理策略为对所述音频数据暂停播放;否则,判断所述第一处理策略为对所述音频数据继续播放。
在一个实施例中,所述第一暂停判断单元包括第一用户设置数据获取子单元和第一用户设置数据判断子单元。其中,所述第一用户设置数据获取子单元用于获取所述第一用户设置数据;所述第一用户设置数据判断子单元用于当所述第一用户设置数据中包括预设暂停数据,判断所述第一暂停判断结果为对所述音频数据暂停播放;否则,判断所述第一暂停判断结果为对所述音频数据继续播放。
在一个实施例中,所述第二暂停判断单元包括第一用户习惯数据获取子单元和第一用户习惯判断子单元。其中,所述第一用户习惯数据获取子单元用于获取预存的所述第一用户习惯数据;所述第一用户习惯判断子单元用于当所述第一用户习惯数据中暂停数据的数量大于第一预设阈值,判断所述第二暂停判断结果为对所述音频数据暂停播放;否则,判断所述第二暂停判断结果为对所述音频数据继续播放。
在一个实施例中,所述第三暂停判断单元包括周围环境数据获取子单元和周围环境数 据判断子单元。其中,所述周围环境数据获取子单元用于获取第一周围环境数据;所述周围环境数据判断子单元用于当所述第一周围环境数据满足第一预设条件,则判断所述第三暂停判断结果为对所述音频数据暂停播放;否则,判断所述第三暂停判断结果为对所述音频数据继续播放。
在一个实施例中,所述第一周围环境数据包括环境噪音音量数据,所述周围环境数据获取子单元用于当所述环境噪音音量数据小于第二预设阈值,判断所述第三暂停判断结果为对音频数据暂停播放。
在一个实施例中,所述第一周围环境数据包括时间数据,所述周围环境数据获取子单元用于当所述时间数据处于预设范围,判断所述第三暂停判断结果为对音频数据暂停播放。
在一个实施例中,所述第一暂停判断单元用于根据第一用户设置数据判断是否对所述音频数据暂停播放,得到第一暂停判断结果;当所述第一暂停判断结果为对所述音频数据暂停播放,则判断所述第一处理策略为对所述音频数据暂停播放。
在一个实施例中,所述第二暂停判断单元用于当所述第一暂停判断结果为对所述音频数据继续播放,则,根据第一用户习惯数据判断是否对所述音频数据暂停播放,得到第二暂停判断结果;若所述第二暂停判断结果为对所述音频数据暂停播放,则判断所述第一处理策略为对所述音频数据暂停播放。
在一个实施例中,所述第三暂停判断单元用于当所述第二暂停判断结果为对所述音频数据继续播放,则,根据第一周围环境数据判断是否对所述音频数据暂停播放,得到第三暂停判断结果;当所述第三暂停判断结果为对所述音频数据暂停播放,则判断所述第一处理策略为对所述音频数据暂停播放;当所述第三暂停判断结果为对所述音频数据继续播放,则判断所述第一处理策略为对所述音频数据继续播放。
在一个实施例中,所述装置还包括第二耳机监测模块、第二策略获取模块和第二播放控制模块。其中,
所述第二耳机监测模块用于当所述第一处理策略为对所述音频数据暂停播放,监测所述耳机与所述电子设备的连接状态,判断所述耳机是否有插入或连接行为;
所述第二策略获取模块用于当所述耳机有插入或连接行为,获取对所述音频数据的第二处理策略;
第二播放控制模块用于根据所述第二处理策略控制所述音频数据的播放。
在一个实施例中,所述第二策略获取模块用于判断是否对所述音频数据恢复播放,得到所述第二处理策略。
在一个实施例中,所述第二策略获取模块包括:
第一恢复判断单元,用于根据第二用户设置数据判断是否对所述音频数据恢复播放,得到第一恢复判断结果;
第二恢复判断单元,用于根据第二用户习惯数据判断是否对所述音频数据恢复播放,得到第二暂停判断结果;
第三恢复判断单元,用于根据耳机脱离时间判断是否对所述音频数据恢复播放,得到第三恢复判断结果;
第二综合判断单元,用于根据所述第一恢复判断结果、所述第二恢复判断结果和所述第三恢复判断结果判断是否对所述音频数据恢复播放,得到所述第二处理策略。
在一个实施例中,所述第二综合判断单元具体用于:
当所述第一恢复判断结果、所述第二恢复判断结果和所述第三恢复判断结果中至少有一个为对所述音频数据恢复播放,判断所述第二处理策略为对所述音频数据进行恢复播放;否则,判断所述第二处理策略为对所述音频数据继续暂停。
在一个实施例中,所述第一恢复判断单元包括第二用户设置数据获取子单元和第二用户设置数据判断子单元。其中,所述第二用户设置数据获取子单元用于获取所述第二用户 设置数据;所述第二用户设置数据判断子单元用于当所述第二用户设置数据中包括预设恢复数据,则判断所述第一恢复判断结果为对所述音频数据恢复播放;否则,判断所述第一恢复判断结果为对所述音频数据继续暂停。
在一个实施例中,所述第二恢复判断单元包括第二用户习惯数据获取子单元和第二用户习惯数据判断子单元。其中,所述第二用户习惯数据获取子单元用于获取预存的所述第二用户习惯数据;所述第二用户习惯数据判断子单元用于当所述第二用户习惯数据中恢复数据的数量大于第三预设阈值,则判断所述第二恢复判断结果为对所述音频数据恢复播放;否则,判断所述第二恢复判断结果为对所述音频数据进行继续暂停。
在一个实施例中,所述第三恢复判断单元包括耳机脱离时间获取子单元和耳机脱离时间判断子单元。其中,所述耳机脱离时间获取子单元用于获取耳机脱离时间;所述耳机脱离时间判断子单元用于当所述耳机脱离时间小于预设时间阈值,则判断所述第二恢复判断结果为对所述音频数据恢复播放;否则,判断所述第二恢复判断结果为对所述音频数据进行继续暂停。
在一个实施例中,所述第一恢复判断单元用于根据第二用户设置数据判断是否对所述音频数据恢复播放,得到第一恢复判断结果;当所述第一恢复判断结果为对所述音频数据恢复播放,则判断所述第二处理策略为对所述音频数据恢复播放。
在一个实施例中,所述第二恢复判断单元用于当所述第一恢复判断结果为对所述音频数据继续暂停,则,根据第二用户习惯数据判断是否对所述音频数据恢复播放,得到第二恢复判断结果;若所述第二恢复判断结果为对所述音频数据恢复播放,则所述第二处理策略为对所述音频数据恢复播放。
在一个实施例中,所述第三恢复判断单元用于当所述第二恢复判断结果为对所述音频数据继续暂停,则,根据耳机脱离时间判断是否对所述音频数据恢复播放,得到第三恢复判断结果;若所述第三恢复判断结果为对所述音频数据恢复播放,则所述第二处理策略为对所述音频数据恢复播放;若所述第三恢复判断结果为对所述音频数据继续暂停,则所述第二处理策略为对所述音频数据继续暂停。
上述实施例提供的播放控制装置,其实现原理和技术效果与上述方法实施例类似,在此不再赘述。
上述播放控制装置中各个模块的划分仅用于举例说明,在其他实施例中,可将播放控制装置按照需要划分为不同的模块,以完成上述播放控制装置的全部或部分功能。
上述播放控制装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于电子设备中的处理器中,也可以以软件形式存储于电子设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
本申请实施例还提供了一种计算机可读存储介质。一个或多个包含计算机可执行指令的非易失性计算机可读存储介质,当计算机可执行指令被一个或多个处理器执行时,使得处理器执行上述播放控制方法的S10-S40步骤。
需要说明的是,一个或多个包含计算机可执行指令的非易失性计算机可读存储介质,当计算机可执行指令被一个或多个处理器执行时,还可以使得处理器执行上述任一实施例中的播放控制方法。
上述实施例提供的计算机可读存储介质,其实现原理和技术效果与上述方法实施例类似,在此不再赘述。
本申请实施例还提供了一种电子设备。如图15所示,为了便于说明,仅示出了与本申请实施例相关的部分,具体技术细节未揭示的,请参照本申请实施例方法部分。该电子设备可以为包括手机、平板电脑、PDA(Personal Digital Assistant,个人数字助理)、POS(Point of Sales,销售终端)、车载电脑、穿戴式设备等具有语音通话功能并具有扬声器的任意终端设备,以电子设备为手机为例:
图15为与本申请实施例提供的电子设备相关的手机的部分结构的框图。参考图15, 手机1000包括:射频(Radio Frequency,RF)电路1010、存储器1020、输入单元1030、显示单元1040、传感器1050、音频电路1060、无线保真(wireless fidelity,WiFi)模块1070、处理器1080、以及电源1090等部件。本领域技术人员可以理解,图15所示的手机结构并不构成对手机的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
其中,RF电路1010可用于收发信息或通话过程中,信号的接收和发送,可将基站的下行信息接收后,给处理器1080处理;也可以将上行的数据发送给基站。通常,RF电路包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器(Low Noise Amplifier,LNA)、双工器等。此外,RF电路1010还可以通过无线通信与网络和其他设备通信。上述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(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)等。
存储器1020可用于存储软件程序以及模块,处理器1080通过运行存储在存储器1020的软件程序以及模块,从而执行手机的各种功能应用以及数据处理。存储器1020可主要包括程序存储区和数据存储区,其中,程序存储区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能的应用程序、图像播放功能的应用程序等)等;数据存储区可存储根据手机的使用所创建的数据(比如音频数据、通讯录等)等。此外,存储器1020可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。
输入单元1030可用于接收输入的数字或字符信息,以及产生与手机1000的用户设置以及功能控制有关的键信号输入。具体地,输入单元1030可包括触控面板1031以及其他输入设备1032。触控面板1031,也可称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板1031上或在触控面板1031附近的操作),并根据预先设定的程式驱动相应的连接装置。在一个实施例中,触控面板1031可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器1080,并能接收处理器1080发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板1031。除了触控面板1031,输入单元1030还可以包括其他输入设备1032。具体地,其他输入设备1032可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)等中的一种或多种。
显示单元1040可用于显示由用户输入的信息或提供给用户的信息以及手机的各种菜单。显示单元1040可包括显示面板1041。在一个实施例中,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板1041。在一个实施例中,触控面板1031可覆盖显示面板1041,当触控面板1031检测到在其上或附近的触摸操作后,传送给处理器1080以确定触摸事件的类型,随后处理器1080根据触摸事件的类型在显示面板1041上提供相应的视觉输出。虽然在图15中,触控面板1031与显示面板1041是作为两个独立的部件来实现手机的输入和输入功能,但是在某些实施例中,可以将触控面板1031与显示面板1041集成而实现手机的输入和输出功能。
手机1000还可包括至少一种传感器1050,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板1041的亮度,接近传感器可在手机移动到耳边时,关闭显示面板1041和/或背光。运动传感器可包括加速度传感器,通过加速度传感器可检测各个 方向上加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换)、振动识别相关功能(比如计步器、敲击)等;此外,手机还可配置陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器等。
音频电路1060、扬声器1061和传声器1062可提供用户与手机之间的音频接口。音频电路1060可将接收到的音频数据转换后的电信号,传输到扬声器1061,由扬声器1061转换为声音信号输出;另一方面,传声器1062将收集的声音信号转换为电信号,由音频电路1060接收后转换为音频数据,再将音频数据输出处理器1080处理后,经RF电路1010可以发送给另一手机,或者将音频数据输出至存储器1020以便后续处理。
WiFi属于短距离无线传输技术,手机通过WiFi模块1070可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。虽然图15示出了WiFi模块1070,但是可以理解的是,其并不属于手机1000的必须构成,可以根据需要而省略。
处理器1080是手机的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器1020内的软件程序和/或模块,以及调用存储在存储器1020内的数据,执行手机的各种功能和处理数据,从而对手机进行整体监控。在一个实施例中,处理器1080可包括一个或多个处理单元。在一个实施例中,处理器1080可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等;调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器1080中。
手机1000还包括给各个部件供电的电源1090(比如电池),优选的,电源可以通过电源管理系统与处理器1080逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。
在一个实施例中,手机1000还可以包括摄像头、蓝牙模块等。
在本申请实施例中,该电子设备所包括的处理器1080执行存储在存储器上的计算机程序时实现上述S10-S40的步骤。
需要说明的是,一种电子设备,包括存储器及处理器,所述存储器中储存有计算机可读指令,所述指令被所述处理器执行时,使得所述处理器执行上述任一实施例中的音频处理方法的步骤。
上述实施例提供的电子设备,其实现原理和技术效果与上述方法实施例类似,在此不再赘述。
本申请所使用的对存储器、存储、数据库或其它介质的任何引用可包括非易失性和/或易失性存储器。合适的非易失性存储器可包括只读存储器(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 (25)

  1. 一种播放控制方法,应用于电子设备,所述方法包括:
    监测所述电子设备中是否有正在播放的音频数据;
    若所述电子设备中有正在播放的音频数据,则监测耳机与所述电子设备的连接状态,判断所述耳机是否有拔出或断开行为;
    若所述耳机有拔出或断开行为,则获取对所述音频数据的第一处理策略;及根据所述第一处理策略控制所述音频数据的播放。
  2. 根据权利要求1所述的方法,其中,所述获取对所述音频数据的第一处理策略,包括:
    判断是否对所述音频数据暂停播放,得到所述第一处理策略。
  3. 根据权利要求2所述的方法,其中,所述判断是否对所述音频数据暂停播放,得到所述第一处理策略,包括:
    根据第一用户设置数据判断是否对所述音频数据暂停播放,得到第一暂停判断结果;
    根据第一用户习惯数据判断是否对所述音频数据暂停播放,得到第二暂停判断结果;
    根据第一周围环境数据判断是否对所述音频数据暂停播放,得到第三暂停判断结果;
    根据所述第一暂停判断结果、所述第二暂停判断结果和所述第三暂停判断结果判断是否对所述音频数据暂停播放,得到所述第一处理策略。
  4. 根据权利要求3所述的方法,其中,所述根据所述第一暂停判断结果、所述第二暂停判断结果和所述第三暂停判断结果判断是否对所述音频数据暂停播放,得到所述第一处理策略,包括:
    若所述第一暂停判断结果、所述第二暂停判断结果和所述第三暂停判断结果中至少有一个为对所述音频数据暂停播放,则,所述第一处理策略为对所述音频数据暂停播放;
    否则,所述第一处理策略为对所述音频数据继续播放。
  5. 根据权利要求3所述的方法,其中,所述根据第一用户设置数据判断是否对所述音频数据暂停播放,得到第一暂停判断结果,包括:
    获取所述第一用户设置数据;
    若所述第一用户设置数据中包括预设暂停数据,则所述第一暂停判断结果为对所述音频数据暂停播放;
    否则,所述第一暂停判断结果为对所述音频数据继续播放。
  6. 根据权利要求3所述的方法,其中,所述根据第一用户习惯数据判断是否对所述音频数据暂停播放,得到第二暂停判断结果,包括:
    获取预存的所述第一用户习惯数据;
    若所述第一用户习惯数据中暂停数据的数量大于第一预设阈值,则所述第二暂停判断结果为对所述音频数据暂停播放;
    否则,所述第二暂停判断结果为对所述音频数据继续播放。
  7. 根据权利要求3所述的方法,其中,所述根据第一周围环境数据判断是否对所述音频数据暂停播放,得到第三暂停判断结果,包括:
    获取第一周围环境数据;
    若所述第一周围环境数据满足第一预设条件,则所述第三暂停判断结果为对所述音频数据暂停播放;
    否则,所述第三暂停判断结果为对所述音频数据继续播放。
  8. 根据权利要求7所述的方法,其中,所述第一周围环境数据包括环境噪音音量数据,所述若所述第一周围环境数据满足第一预设条件,则所述第三暂停判断结果为对所述音频数据暂停播放,包括:
    若所述环境噪音音量数据小于第二预设阈值,则所述第三暂停判断结果为对音频数据暂停播放。
  9. 根据权利要求7所述的方法,其中,所述第一周围环境数据包括时间数据,所述若所述第一周围环境数据满足第一预设条件,则所述第三暂停判断结果为对所述音频数据暂停播放,包括:
    若所述时间数据处于预设范围,则所述第三暂停判断结果为对音频数据暂停播放。
  10. 根据权利要求2所述的方法,其中,所述判断是否对所述音频数据暂停播放,得到所述第一处理策略,包括:
    根据第一用户设置数据判断是否对所述音频数据暂停播放,得到第一暂停判断结果;
    若所述第一暂停判断结果为对所述音频数据暂停播放,则所述第一处理策略为对所述音频数据暂停播放。
  11. 根据权利要求10所述的方法,其中,所述根据第一用户设置数据判断是否对所述音频数据暂停播放,得到第一暂停判断结果之后,所述方法还包括:
    若所述第一暂停判断结果为对所述音频数据继续播放,则,根据第一用户习惯数据判断是否对所述音频数据暂停播放,得到第二暂停判断结果;
    若所述第二暂停判断结果为对所述音频数据暂停播放,则所述第一处理策略为对所述音频数据暂停播放。
  12. 根据权利要求11所述的方法,其中,所述根据第一用户习惯数据判断是否对所述音频数据暂停播放,得到第二暂停判断结果之后,所述方法还包括:
    若所述第二暂停判断结果为对所述音频数据继续播放,则,根据第一周围环境数据判断是否对所述音频数据暂停播放,得到第三暂停判断结果;
    若所述第三暂停判断结果为对所述音频数据暂停播放,则所述第一处理策略为对所述音频数据暂停播放;
    若所述第三暂停判断结果为对所述音频数据继续播放,则所述第一处理策略为对所述音频数据继续播放。
  13. 根据权利要求1所述的方法,其中,所述根据所述第一处理策略控制所述音频数据的播放之后,所述方法还包括:
    若所述第一处理策略为对所述音频数据暂停播放,则,
    监测所述耳机与所述电子设备的连接状态,判断所述耳机是否有插入或连接行为;
    若所述耳机有插入或连接行为,则获取对所述音频数据的第二处理策略;
    根据所述第二处理策略控制所述音频数据的播放。
  14. 根据权利要求13所述的方法,其中,所述获取对所述音频数据的第二处理策略,包括:
    判断是否对所述音频数据恢复播放,得到所述第二处理策略。
  15. 根据权利要求14所述的方法,其中,所述判断是否对所述音频数据恢复播放,得到所述第二处理策略,包括:
    根据第二用户设置数据判断是否对所述音频数据恢复播放,得到第一恢复判 断结果;
    根据第二用户习惯数据判断是否对所述音频数据恢复播放,得到第二暂停判断结果;
    根据耳机脱离时间判断是否对所述音频数据恢复播放,得到第三恢复判断结果;
    根据所述第一恢复判断结果、所述第二恢复判断结果和所述第三恢复判断结果判断是否对所述音频数据恢复播放,得到所述第二处理策略。
  16. 根据权利要求15所述的方法,其中,所述根据所述第一恢复判断结果、所述第二恢复判断结果和所述第三恢复判断结果判断是否对所述音频数据恢复播放,得到所述第二处理策略,包括:
    若所述第一恢复判断结果、所述第二恢复判断结果和所述第三恢复判断结果中至少有一个为对所述音频数据恢复播放,则,所述第二处理策略为对所述音频数据进行恢复播放;
    否则,所述第二处理策略为对所述音频数据继续暂停。
  17. 根据权利要求15所述的方法,其中,所述根据第二用户设置数据判断是否对所述音频数据恢复播放,得到第一恢复判断结果,包括:
    获取所述第二用户设置数据;
    若所述第二用户设置数据中包括预设恢复数据,则所述第一恢复判断结果为对所述音频数据恢复播放;
    否则,所述第一恢复判断结果为对所述音频数据继续暂停。
  18. 根据权利要求15所述的方法,其中,所述根据第二用户习惯数据判断是否对所述音频数据恢复播放,得到第二暂停判断结果,包括:
    获取预存的所述第二用户习惯数据;
    若所述第二用户习惯数据中恢复数据的数量大于第三预设阈值,则所述第二恢复判断结果为对所述音频数据恢复播放;
    否则,所述第二恢复判断结果为对所述音频数据进行继续暂停。
  19. 根据权利要求15所述的方法,其中,所述根据耳机脱离时间判断是否对所述音频数据恢复播放,得到第三恢复判断结果,包括:
    获取耳机脱离时间;
    若所述耳机脱离时间小于预设时间阈值,则所述第二恢复判断结果为对所述音频数据恢复播放;
    否则,所述第二恢复判断结果为对所述音频数据进行继续暂停。
  20. 根据权利要求14所述的方法,其中,所述判断是否对所述音频数据恢复播放,得到所述第二处理策略,包括:
    根据第二用户设置数据判断是否对所述音频数据恢复播放,得到第一恢复判断结果;
    若所述第一恢复判断结果为对所述音频数据恢复播放,则所述第二处理策略为对所述音频数据恢复播放。
  21. 根据权利要求20所述的方法,其中,所述根据第二用户设置数据判断是否对所述音频数据恢复播放,得到第一恢复判断结果之后,所述方法还包括:
    若所述第一恢复判断结果为对所述音频数据继续暂停,则,根据第二用户习惯数据判断是否对所述音频数据恢复播放,得到第二恢复判断结果;
    若所述第二恢复判断结果为对所述音频数据恢复播放,则所述第二处理策略为对所述音频数据恢复播放。
  22. 根据权利要求21所述的方法,其中,所述根据第二用户习惯数据判断是否对所述音频数据恢复播放,得到第二恢复判断结果之后,所述方法还包括:
    若所述第二恢复判断结果为对所述音频数据继续暂停,则,根据耳机脱离时间判断是否对所述音频数据恢复播放,得到第三恢复判断结果;
    若所述第三恢复判断结果为对所述音频数据恢复播放,则所述第二处理策略为对所述音频数据恢复播放;
    若所述第三恢复判断结果为对所述音频数据继续暂停,则所述第二处理策略为对所述音频数据继续暂停。
  23. 一种播放控制装置,应用于电子设备,所述装置包括:
    播放监测模块,用于监测所述电子设备中是否有正在播放的音频数据;
    第一耳机监测模块,用于当所述电子设备中有正在播放的音频数据时,监测耳机与所述电子设备的连接状态,判断所述耳机是否有拔出或断开行为;
    第一策略获取模块,用于当所述耳机有拔出或断开行为,获取对所述音频数据的第一处理策略;及
    第一播放控制模块,用于根据所述第一处理策略控制所述音频数据的播放。
  24. 一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至22中任一项所述的播放控制方法的步骤。
  25. 一种电子设备,包括存储器及处理器,所述存储器中储存有计算机可读指令,所述指令被所述处理器执行时,使得所述处理器执行如权利要求1至22中任一项所述的播放控制方法。
PCT/CN2018/119608 2018-12-06 2018-12-06 播放控制方法和装置、计算机可读存储介质、电子设备 WO2020113525A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201880098660.4A CN113039518B (zh) 2018-12-06 2018-12-06 播放控制方法和装置、计算机可读存储介质、电子设备
PCT/CN2018/119608 WO2020113525A1 (zh) 2018-12-06 2018-12-06 播放控制方法和装置、计算机可读存储介质、电子设备

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/119608 WO2020113525A1 (zh) 2018-12-06 2018-12-06 播放控制方法和装置、计算机可读存储介质、电子设备

Publications (1)

Publication Number Publication Date
WO2020113525A1 true WO2020113525A1 (zh) 2020-06-11

Family

ID=70974088

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/119608 WO2020113525A1 (zh) 2018-12-06 2018-12-06 播放控制方法和装置、计算机可读存储介质、电子设备

Country Status (2)

Country Link
CN (1) CN113039518B (zh)
WO (1) WO2020113525A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113496707A (zh) * 2021-06-29 2021-10-12 Tcl通力电子(惠州)有限公司 噪声抑制方法、噪声抑制装置、噪声抑制设备及存储介质
CN114115793A (zh) * 2021-12-01 2022-03-01 维沃移动通信有限公司 音频调节方法和音频调节装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008082939A1 (en) * 2006-12-28 2008-07-10 Motorola Inc. Method of operating a wireless headset
CN106293602A (zh) * 2016-08-09 2017-01-04 广州三星通信技术研究有限公司 耳机中的音频数据播放控制方法和设备
CN108307271A (zh) * 2018-01-25 2018-07-20 潍坊歌尔电子有限公司 一种智能设备的音量调节方法、装置及智能设备
CN108509176A (zh) * 2018-04-10 2018-09-07 Oppo广东移动通信有限公司 一种播放音频数据的方法、装置、存储介质及智能终端

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008082939A1 (en) * 2006-12-28 2008-07-10 Motorola Inc. Method of operating a wireless headset
CN106293602A (zh) * 2016-08-09 2017-01-04 广州三星通信技术研究有限公司 耳机中的音频数据播放控制方法和设备
CN108307271A (zh) * 2018-01-25 2018-07-20 潍坊歌尔电子有限公司 一种智能设备的音量调节方法、装置及智能设备
CN108509176A (zh) * 2018-04-10 2018-09-07 Oppo广东移动通信有限公司 一种播放音频数据的方法、装置、存储介质及智能终端

Also Published As

Publication number Publication date
CN113039518B (zh) 2023-12-05
CN113039518A (zh) 2021-06-25

Similar Documents

Publication Publication Date Title
US11043980B2 (en) Method for controlling earphone switching, earphone, and earphone system
US20200008124A1 (en) Method for Controlling Earphone Switching and Earphone
CN107231473B (zh) 一种音频输出调控方法、设备及计算机可读存储介质
CN108391205B (zh) 左右声道切换方法和装置、可读存储介质、终端
WO2017181365A1 (zh) 一种耳机声道控制方法、相关设备及系统
CN108540900B (zh) 音量调节方法及相关产品
CN109918039B (zh) 一种音量调节方法及移动终端
WO2020107290A1 (zh) 音频输出控制方法和装置、计算机可读存储介质、电子设备
CN109088997B (zh) 一种游戏音频控制方法、终端及计算机可读存储介质
CN109067965B (zh) 翻译方法、翻译装置、可穿戴装置及存储介质
WO2020025034A1 (zh) 一种可穿戴设备主从切换方法及相关产品
WO2022033176A1 (zh) 音频播放控制方法、装置、电子设备及存储介质
WO2021129835A1 (zh) 音量控制方法、设备及计算机可读存储介质
WO2020118496A1 (zh) 音频通路切换方法和装置、可读存储介质、电子设备
JP2021521737A (ja) アクセス制御方法、メッセージ放送方法及び関連装置
WO2020113525A1 (zh) 播放控制方法和装置、计算机可读存储介质、电子设备
WO2020097927A1 (zh) 通话控制方法和装置、计算机可读存储介质、电子设备
CN106126170B (zh) 一种终端的音效设置方法及终端
WO2021208893A1 (zh) 音频输出方式的切换方法及电子设备
WO2020124541A1 (zh) 音频处理方法和装置、计算机可读存储介质、电子设备
CN109618062B (zh) 语音交互方法、装置、设备以及计算机可读存储介质
CN115037831A (zh) 一种模式控制方法、装置、电子设备及耳机
CN109218504B (zh) 一种声音的输出方法和终端设备
CN109040425B (zh) 信息处理方法及相关产品
WO2020107169A1 (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: 18942478

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

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 1205A DATED 15.10.2021)

122 Ep: pct application non-entry in european phase

Ref document number: 18942478

Country of ref document: EP

Kind code of ref document: A1