WO2020097927A1 - Call control method and device, computer-readable storage medium and electronic device - Google Patents

Call control method and device, computer-readable storage medium and electronic device Download PDF

Info

Publication number
WO2020097927A1
WO2020097927A1 PCT/CN2018/115984 CN2018115984W WO2020097927A1 WO 2020097927 A1 WO2020097927 A1 WO 2020097927A1 CN 2018115984 W CN2018115984 W CN 2018115984W WO 2020097927 A1 WO2020097927 A1 WO 2020097927A1
Authority
WO
WIPO (PCT)
Prior art keywords
channel
target application
audio transmission
transmission channel
function
Prior art date
Application number
PCT/CN2018/115984
Other languages
French (fr)
Chinese (zh)
Inventor
李亚军
Original Assignee
深圳市欢太科技有限公司
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市欢太科技有限公司, Oppo广东移动通信有限公司 filed Critical 深圳市欢太科技有限公司
Priority to PCT/CN2018/115984 priority Critical patent/WO2020097927A1/en
Priority to CN201880097707.5A priority patent/CN112805988B/en
Publication of WO2020097927A1 publication Critical patent/WO2020097927A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/725Cordless telephones

Abstract

A call control method and device, a computer-readable storage medium and an electronic device, the call control method being applied to an electronic device which has a plurality of audio transmission channels, and the method comprising: acquiring a first audio transmission channel of the electronic device which is in a calling state (302); monitoring whether a target application program in the calling state generates an operation used to configure a second audio transmission channel (304); and when the target application program generates the operation while running in the background, preventing the target application program from enabling the second audio transmission channel so as to maintain the carrying out of the call by the first audio transmission channel (306).

Description

通话控制方法和装置、计算机可读存储介质、电子设备Call control method and device, computer readable storage medium, electronic equipment 技术领域Technical field
本申请涉及电子设备技术领域,特别是涉及通话控制方法和装置、电子设备、计算机可读存储介质。The present application relates to the technical field of electronic equipment, in particular to a call control method and device, electronic equipment, and computer-readable storage medium.
背景技术Background technique
随着电子设备的广泛应用和其功能的日益丰富,电子设备已成为人们日常生活中不可或缺的一部分,尤其是电子设备的通话功能。用户在通话过程中可以选择听筒、扬声器和耳机等音频输出通道来输出通话语音。With the wide application of electronic devices and their increasingly rich functions, electronic devices have become an indispensable part of people's daily lives, especially the call function of electronic devices. During the call, the user can select audio output channels such as earpiece, speaker, and earphone to output the call voice.
但是,在通话过程中,由于三方应用程序的误操作,会使当前通话的音频输出通道发生改变,例如,由听筒变为扬声器外放,或者由扬声器外放变听筒等,影响了用户的通话体验。However, during the call, due to the misoperation of the three-party application, the audio output channel of the current call will be changed, for example, from the receiver to the speaker, or from the speaker to the receiver, etc., affecting the user's call Experience.
发明内容Summary of the invention
本申请实施例提供一种通话控制方法和装置、计算机可读存储介质、电子设备,可以在通话状态时禁止其他应用程序改变通话时的音频传输通道,提供用户的通话体验度。The embodiments of the present application provide a call control method and apparatus, a computer-readable storage medium, and an electronic device, which can prohibit other applications from changing the audio transmission channel during a call during a call state to provide a user's call experience.
一种通话控制方法,应用于具有多个音频传输通道的电子设备,包括:A call control method applied to electronic equipment with multiple audio transmission channels, including:
获取所述电子设备处于通话状态的第一音频传输通道;Acquiring the first audio transmission channel where the electronic device is in a call state;
监听目标应用程序在所述通话状态中是否产生用于设置第二音频传输通道的操作;Monitoring whether the target application program generates an operation for setting a second audio transmission channel in the call state;
当所述目标应用程序在后台运行且产生所述操作时,禁止所述目标应用程序开启所述第二音频传输通道,以维持所述第一音频传输通道进行通话。When the target application is running in the background and the operation is generated, the target application is prohibited from opening the second audio transmission channel to maintain the first audio transmission channel for calling.
一种通话控制装置,应用于具有多个音频传输通道的电子设备,包括:A call control device applied to electronic equipment with multiple audio transmission channels, including:
获取模块,用于获取所述电子设备处于通话状态的第一音频传输通道;An obtaining module, configured to obtain the first audio transmission channel where the electronic device is in a call state;
监听模块,用于监听目标应用程序在所述通话状态中是否产生用于设置第二音频传输通道的操作;A monitoring module, configured to monitor whether the target application program generates an operation for setting a second audio transmission channel in the call state;
处理模块,用于当所述目标应用程序在后台运行且产生所述操作时,禁止所述目标应用程序开启所述第二音频传输通道,以维持所述第一音频传输通道进行通话。The processing module is configured to, when the target application is running in the background and generating the operation, prohibit the target application from opening the second audio transmission channel to maintain the first audio transmission channel for calling.
一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被 处理器执行时实现上述的通话控制方法的步骤。A computer-readable storage medium on which a computer program is stored, which when executed by a processor implements the steps of the call control method described above.
一种电子设备,包括存储器及处理器,所述存储器中储存有计算机可读指令,所述指令被所述处理器执行时,使得所述处理器执行如权利要求上述的通话控制方法。An electronic device includes a memory and a processor. Computer-readable instructions are stored in the memory. When the instructions are executed by the processor, the processor is caused to execute the call control method according to the claims.
上述通话控制方法和装置、计算机可读存储介质、电子设备,可以获取所述电子设备处于通话状态的第一音频传输通道;监听目标应用程序在所述通话状态中是否产生用于设置第二音频传输通道的操作;当所述目标应用程序在后台运行且产生所述操作时,禁止所述目标应用程序开启所述第二音频传输通道,以维持所述第一音频传输通道进行通话,以维持当前通话语音还是以第一音频传输通道,可以避免通话过程中音频输出通道发生改变的情况发生,提高用户的通话体验度。The above call control method and apparatus, computer readable storage medium, and electronic device can acquire the first audio transmission channel where the electronic device is in a call state; monitor whether the target application program generates the second audio in the call state Operation of the transmission channel; when the target application is running in the background and the operation is generated, the target application is prohibited from turning on the second audio transmission channel to maintain the first audio transmission channel for calling to maintain The current call voice is still the first audio transmission channel, which can prevent the audio output channel from being changed during the call and improve the user's call experience.
附图说明BRIEF DESCRIPTION
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他实施例的附图。In order to more clearly explain the embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required in the embodiments or the description of the prior art. Obviously, the drawings in the following description are only These are some embodiments of the present invention. For those of ordinary skill in the art, without paying any creative labor, drawings of other embodiments can be obtained based on these drawings.
图1为一实施例中的电子设备的内部结构示意图;1 is a schematic diagram of the internal structure of an electronic device in an embodiment;
图2为一实施例中的安卓音频系统的部分架构示意图;2 is a schematic diagram of a part of the architecture of an Android audio system in an embodiment;
图3为一实施例中的通话控制方法的流程示意图;3 is a schematic flowchart of a call control method in an embodiment;
图4为另一实施例中的通话控制方法的流程示意图;4 is a schematic flowchart of a call control method in another embodiment;
图5为又一实施例中的通话控制方法的流程示意图;5 is a schematic flowchart of a call control method in another embodiment;
图6为一个实施例中允许目标应用程序启用第二音频传输通道,以使目标应用程序通过第二音频传输通道进行音频传输的流程示意图;FIG. 6 is a schematic flow chart of allowing the target application to enable the second audio transmission channel in one embodiment, so that the target application can perform audio transmission through the second audio transmission channel;
图7为一个实施例中的通话控制装置的框架示意图;7 is a schematic diagram of a call control device in an embodiment;
图8为与本申请实施例提供的电子设备相关的手机的部分结构的框图。8 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.
具体实施方式detailed description
为了便于理解本发明,下面将参照相关附图对本发明进行更全面的描述。附图中给出了本发明的较佳实施例。但是,本发明可以以许多不同的形式来实现,并不限于本文所描述的实施例。相反地,提供这些实施例的目的是使对本发明的公开内容的理解更加透彻全面。In order to facilitate understanding of the present invention, the present invention will be described more fully below with reference to related drawings. The drawings show preferred embodiments of the invention. However, the present invention can be implemented in many different forms, and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present invention more thorough and comprehensive.
可以理解,本发明所使用的术语“第一”、“第二”等可在本文中用于描述 各种元件,但这些元件不受这些术语限制。这些术语仅用于将第一个元件与另一个元件区分。举例来说,在不脱离本发明的范围的情况下,可以将第一音频传输通道称为第二音频传输通道,且类似地,可将第二音频传输通道称为第一音频传输通道。第一音频传输通道和第二音频传输通道两者都是音频传输通道,但其不是同一音频传输通道。It is understood that the terms "first", "second", etc. used in the present invention may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from another element. For example, without departing from the scope of the present invention, the first audio transmission channel may be referred to as the second audio transmission channel, and similarly, the second audio transmission channel may be referred to as the first audio transmission channel. Both the first audio transmission channel and the second audio transmission channel are audio transmission channels, but they are not the same audio transmission channel.
在一个实施例中,如图1所示,提供了一种电子设备的内部结构示意图。该电子设备包括通过系统总线连接的处理器、存储器和显示屏。其中,该处理器用于提供计算和控制能力,支撑整个电子设备的运行。存储器用于存储数据、程序、和/或指令代码等,存储器上存储至少一个计算机程序,该计算机程序可被处理器执行,以实现本申请实施例中提供的适用于电子设备的通话控制方法。存储器可包括磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等非易失性存储介质,或随机存储记忆体(Random-Access-Memory,RAM)等。例如,在一个实施例中,存储器包括非易失性存储介质及内存储器。非易失性存储介质存储有操作系统、数据库和计算机程序。该数据库中存储有用于实现以上各个实施例所提供的一种通话控制方法相关的数据,比如可存储有每个进程或应用的名称等信息。该计算机程序可被处理器所执行,以用于实现本申请各个实施例所提供的一种通话控制方法。内存储器为非易失性存储介质中的操作系统、数据库和计算机程序提供高速缓存的运行环境。显示屏可以是触摸屏,比如为电容屏或电子屏,用于显示前台进程对应的应用的界面信息,还可以被用于检测作用于该显示屏的触摸操作,生成相应的指令,比如进行前后台应用的切换指令等。In one embodiment, as shown in 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. Among them, 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 call 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). For example, in one embodiment, 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 a call control method provided by the above embodiments, for example, information such as the name of each process or application may be stored. The computer program can be executed by the processor to implement a call 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 may be a touch screen, such as a capacitive screen or an electronic screen, which is used to display interface information of applications corresponding to the foreground process, and may also be used to detect a touch operation acting on the display screen, and generate corresponding instructions, such as performing front and background Application switching instructions, etc.
本领域技术人员可以理解,图1中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的电子设备的限定,具体的电子设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。如该电子设备还包括通过系统总线连接的网络接口,网络接口可以是以太网卡或无线网卡等,用于与外部的电子设备进行通信,比如可用于同服务器进行通信。Those skilled in the art may understand that 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. For example, 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., and is used to communicate with external electronic devices, for example, it may be used to communicate with a server.
在一个实施例中,如图2所示,提供了一种Android音频系统的部分架构图。其中,该Android音频系统的架构系统中包括内核(Kernel)空间层210、本地层220、框架层230以及Client层240。In one embodiment, as shown in FIG. 2, a partial architecture diagram of an Android audio system is provided. The architecture system of the Android audio system includes a kernel space layer 210, a local layer 220, a framework layer 230, and a client layer 240.
内核(Kernel)空间层210上可包含Audio驱动模块211,其中,Audio驱动模块是与硬件进行交互,并且实现本地层的接口供上层正常调用,这里可以选择ALSA,OSS以及自定义的音频驱动。本地层220中包含AtlasService_Jni 模块221、AtlasService Interface模块223以及AtlasService模块225。框架层230中包含AtlasManager模块231和AtlasService模块233。其中,AtlasManager模块231中设有常规接口和注册回调接口。本地层220中的AtlasService模块225以及框架层230中的AtlasService模块233用于事件接收和处理、信息收集、异常反馈以及日志收集,其中,信息收集可包括显示信息的收集和音频信息的收集。其中,音频信息包括播放信息、录音信息、音频模式设置信息等。由于该AtlasService模块设立在系统级的框架层中,可方便与其他系统服务进行交互,同时无需担心系统调用时的权限问题。通过上述的架构,可实现本申请各个实施例中的通话控制方法。The Kernel space layer 210 may include an Audio driver module 211, where the Audio driver module interacts with the hardware and implements the local layer interface for the upper layer to call normally. Here, ALSA, OSS, and a custom audio driver can be selected. The local layer 220 includes an AtlasService_Jni module 221, an AtlasService Interface module 223, and an AtlasService module 225. The framework layer 230 includes an AtlasManager module 231 and an AtlasService module 233. Among them, the AtlasManager module 231 is provided with a conventional interface and a registration callback interface. The AtlasService module 225 in the local layer 220 and the AtlasService module 233 in the framework layer 230 are used for event reception and processing, information collection, abnormal feedback, and log collection, where the information collection may include the collection of display information and the collection of audio information. Among them, the audio information includes playback information, recording information, audio mode setting information, and so on. Because the AtlasService module is set up in the system-level framework layer, it can facilitate interaction with other system services, and at the same time, there is no need to worry about permissions during system calls. Through the above-mentioned architecture, the call control method in each embodiment of the present application can be implemented.
在一个实施例中,如图3所示,提供了一种通话控制方法,该通话控制方法应用于具有多个音频传输通道的电子设备。在一个实施例中,电子设备可以为包括手机、平板电脑、笔记本电脑、掌上电脑、移动互联网设备(Mobile Internet Device,MID)、可穿戴设备(例如智能手表、智能手环、计步器等)或其他等具有语音通话功能并具有扬声器的电子设备。In one embodiment, as shown in FIG. 3, a call control method is provided. The call control method is applied to an electronic device having multiple audio transmission channels. In one embodiment, the electronic device may include 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 with voice call function and speakers.
音频传输通道包括听筒通道、扬声器通道、耳机通道;还可以包括麦克风通道,在本申请实施例中,字音频传输通道可以为听筒通道、扬声器通道和耳机通道,其中,耳机通道可以包括有线耳机通道和蓝牙耳机通道。当音频传输通道为听筒通道时,通话语音由听筒发出;当音频传输通道为扬声器通道时,通话语音由外放扬声器发出;当音频传输通道为耳机通道时,通话语音可通过有线耳机或蓝牙耳机发出。The audio transmission channel includes an earpiece channel, a speaker channel, and a headphone channel; it may also include a microphone channel. In the embodiment of the present application, the word audio transmission channel may be an earphone channel, a speaker channel, and a headphone channel, where the headphone channel may include a wired headphone channel And Bluetooth headset channel. When the audio transmission channel is the earpiece channel, the call voice is issued by the earpiece; when the audio transmission channel is the speaker channel, the call voice is issued by the external speaker; when the audio transmission channel is the earphone channel, the call voice can be through a wired headset or a Bluetooth headset issue.
如图3所示,在一个实施例中,通话控制方法,包括步骤302-步骤306。As shown in FIG. 3, in one embodiment, the call control method includes steps 302-306.
步骤302,获取电子设备处于通话状态的第一音频传输通道。Step 302: Obtain the first audio transmission channel where the electronic device is in a call state.
当电子设备处于通话状态时,可以获取当前通话状态所占用的第一音频传输通道。例如,可以基于电子设备中内置的安卓操作系统,新建一个Java类用来监听电子设备是否处于通话状态,具体地可以通过BroadcastReceiver的重载进行监听。When the electronic device is in a call state, it can acquire the first audio transmission channel occupied by the current call state. For example, based on the Android operating system built in the electronic device, a new Java class can be created to monitor whether the electronic device is in a call state. Specifically, it can be monitored through the overload of BroadcastReceiver.
当电子设备处于通话状态时,电子设备可以获取当前通话状态的第一音频传输通道。其中,第一音频传输通道包括听筒通道、扬声器通道、有线耳机通道和蓝牙耳机通道。若第一音频传输通道为听筒通道时,则表明电子设备的通话语音由听筒输出;若第一音频传输通道为扬声器通道时,则表明电子设备的通话语音由扬声器输出;若第一音频传输通道为耳机通道时,则表明电子设备的通话语音由耳机输出。例如,可以基于电子设备中内置的安卓操作系统,可调用系统函数AudioModeProvider.getAudioMode()来获取当前通 话状态所占用的第一音频传输通道。When the electronic device is in a call state, the electronic device can obtain the first audio transmission channel in the current call state. Among them, the first audio transmission channel includes an earphone channel, a speaker channel, a wired headset channel, and a Bluetooth headset channel. If the first audio transmission channel is a receiver channel, it means that the voice of the electronic device is output from the receiver; if the first audio transmission channel is a speaker channel, it indicates that the voice of the electronic device is output from the speaker; if the first audio transmission channel When it is the earphone channel, it means that the voice of the electronic device is output from the earphone. For example, based on the Android operating system built in the electronic device, the system function AudioModeProvider.getAudioMode () can be called to obtain the first audio transmission channel occupied by the current call state.
步骤304,监听目标应用程序在通话状态中是否产生用于设置第二音频传输通道的操作。Step 304: Monitor whether the target application generates an operation for setting the second audio transmission channel in the call state.
电子设备在通话状态时,还可以实时检测目标应用程序在通话状态中是否产生用于设置第二音频传输通道的操作。其中,目标应用程序可以理解为能够输出和/或输出音频信号的应用程序,且目标应用程序的数量可以为1个2个、3个或更多个。例如,目标应用程序可包括即时通信类、音频播放类、视频播放类、声音控制类、语音输入类等应用程序。When the electronic device is in the call state, it can also detect in real time whether the target application generates an operation for setting the second audio transmission channel in the call state. The target application program may be understood as an application program capable of outputting and / or outputting audio signals, and the number of target application programs may be 1, 2, 3 or more. For example, the target application may include applications such as instant messaging, audio playback, video playback, sound control, and voice input.
在一个实施例中,电子设备可以预设构建包括所有目标应用程序的列表或数据库,用于存储目标应用程序的标识信息等。In one embodiment, the electronic device may preset to construct a list or database including all target applications, for storing identification information of the target applications, and the like.
在一个实施例中,电子设备可通过内置的监听函数对目标应用程序的音频行为进行监听。该音频行为包括播放行为、录音行为以及音频模式设置等行为。其中,音频模式设置可以理解为产生了用于设置第二音频传输通道的操作。以具有安卓操作系统的电子设备为例,可在系统框架层(native/framework层)创建系统级的监听模块,通过所述监听模块对目标应用程序的音频行为进行监听。例如,可在框架层设立监听模块并运行在系统服务程序(system_server)中,由于该监听模块设立在系统级的服务框架层中,可方便与其他系统服务进行交互,同时无需担心系统调用时的权限问题。In one embodiment, the electronic device can monitor the audio behavior of the target application through the built-in monitoring function. The audio behavior includes playback behavior, recording behavior, and audio mode settings. The audio mode setting may be understood as an operation for setting the second audio transmission channel. Taking an electronic device with an Android operating system as an example, a system-level monitoring module can be created at the system framework layer (native / framework layer), and the audio behavior of the target application program can be monitored through the monitoring module. For example, you can set up a listener module in the framework layer and run it in the system service program (system_server). Since the listener module is established in the system-level service framework layer, you can easily interact with other system services without worrying about system calls. Permissions issue.
可选的,电子设备也可以创建独立的监听进程,在该进程中设立并调用单独的监听函数,可设置为开机自启动,并实时对其他任何一个目标应用程序的音频模式设置行为进行监控。Optionally, the electronic device can also create an independent monitoring process, set up and call a separate monitoring function in the process, which can be set to start automatically after power-on, and monitor the audio mode setting behavior of any other target application in real time.
步骤306,当目标应用程序在后台运行且产生操作时,禁止目标应用程序开启第二音频传输通道,以维持第一音频传输通道进行通话。Step 306: When the target application runs in the background and generates an operation, the target application is prohibited from opening the second audio transmission channel to maintain the first audio transmission channel for calling.
在一个实施例中,电子设备可以获取目标应用程序的运行状态,该运行状态可包括前台运行或后台运行。例如,电子设备可以监听目标应用程序的进程信息,并根据进程信息来确定目标应用程序的运行状态。电子设备还可以基于使用ActivityLifecycleCallbacks来监听目标应用程序是否运行在后台的行为,根据Activity的生命周期,其中,onStart()表示一个Activity处于前台,onStop()表示Activity在后台不可见。当然,电子设备还可以通过getRunningTasks获取目标应用程序的运行状态,还可以通过getRunningTasks和RunningAppProcessInfo结合获取目标应用程序的运行状态。在此,对电子设备如何获取目标应用程序的运行状态不做进一步的限定,也不限于上述举例说明。In one embodiment, the electronic device may obtain the running state of the target application, and the running state may include foreground operation or background operation. For example, the electronic device can monitor the process information of the target application program and determine the running state of the target application program according to the process information. The electronic device can also monitor whether the target application is running in the background based on the use of ActivityLifecycleCallbacks. According to the life cycle of the Activity, onStart () indicates that an Activity is in the foreground and onStop () indicates that the Activity is not visible in the background. Of course, the electronic device can also obtain the running state of the target application through getRunningTasks, and can also obtain the running state of the target application through the combination of getRunningTasks and RunningAppProcessInfo. Here, there is no further limitation on how the electronic device obtains the running state of the target application program, nor is it limited to the above example.
当电子设备监听到,目标应用程序当前处于后台运行,且在目标应用程序产生了用于设置第二音频传输通道的操作时,则该电子设备可以禁止目标应用程序开启第二音频传输通道,以维持第一音频传输通道进行通话。也即,虽然目标应用程序在后台设置了第二音频传输通道,但是该设置动作不会被执行,也即,该目标应用程序不会开启第二音频出传输通道,以维持当前通话状态的第一音频传输通道。其中,第二音频传输通道也可包括听筒通道、扬声器通道、有线耳机通道和蓝牙耳机通道。其中,第一音频传输通道与第二音频传输通道不同。When the electronic device monitors that the target application is currently running in the background and the target application generates an operation for setting the second audio transmission channel, the electronic device may prohibit the target application from turning on the second audio transmission channel to Maintain the first audio transmission channel to talk. That is, although the target application sets the second audio transmission channel in the background, the setting action will not be performed, that is, the target application will not turn on the second audio output transmission channel to maintain the current call status of the first An audio transmission channel. Wherein, the second audio transmission channel may also include a receiver channel, a speaker channel, a wired headset channel and a Bluetooth headset channel. The first audio transmission channel is different from the second audio transmission channel.
例如,通话状态的第一音频传输通道为听筒通道时,而目标应用程序运行在后台,且设置了第二音频传输通道,其中,第二音频传输通道为扬声器通道或耳机通道,也即,目标应用程序设置第二音频传输通道的目的是为了调用扬声器通道或耳机通道。若目标应用程序开启该第二音频传输通道时,其电子设备的通话语音则回从扬声器或耳机通道输出。电子设备可通过禁止目标应用程序开启第二音频传输通道,以维持第一音频传输通道进行通话,也即,当前的通话语音还是以第一音频传输通道输出,进而可以避免通话过程中,音频输出通道发生改变的情况发生。For example, when the first audio transmission channel in the call state is a receiver channel, and the target application is running in the background, and a second audio transmission channel is set, wherein the second audio transmission channel is a speaker channel or a headphone channel, that is, the target The purpose of the application setting the second audio transmission channel is to call the speaker channel or the headphone channel. If the target application opens the second audio transmission channel, the call voice of its electronic device is output from the speaker or headset channel. The electronic device can prevent the target application from opening the second audio transmission channel to maintain the first audio transmission channel for the call, that is, the current call voice is still output through the first audio transmission channel, which can avoid audio output during the call Channel changes occur.
上述通话控制方法,可以获取所述电子设备处于通话状态的第一音频传输通道;监听目标应用程序在所述通话状态中是否产生用于设置第二音频传输通道的操作;当所述目标应用程序在后台运行且产生所述操作时,禁止所述目标应用程序开启所述第二音频传输通道,以维持所述第一音频传输通道进行通话,以维持当前通话语音还是以第一音频传输通道,可以避免通话过程中音频输出通道发生改变的情况发生,提高用户体验度。The above call control method can obtain the first audio transmission channel where the electronic device is in a call state; monitor whether the target application generates an operation for setting a second audio transmission channel in the call state; when the target application When running in the background and generating the operation, prohibit the target application from opening the second audio transmission channel to maintain the first audio transmission channel for the call to maintain the current call voice or the first audio transmission channel, The situation that the audio output channel is changed during a call can be avoided, and the user experience can be improved.
如图4所示,在一个实施例中,通话控制方法包括步骤402-步骤410。其中,As shown in FIG. 4, in one embodiment, the call control method includes steps 402-410. among them,
步骤402,获取电子设备处于通话状态的第一音频传输通道。Step 402: Obtain the first audio transmission channel where the electronic device is in a call state.
步骤404,监听目标应用程序在通话状态中是否调用预设接口函数。Step 404: Monitor whether the target application program calls the preset interface function in the call state.
电子设备可以监听目标应用程序在通话状态中是否调用预设接口函数,其中,预设接口函数用于设置传输音频的第二音频传输通道。任何目标应用程序均可以调用该预设接口函数时,当预设接口函数的功能有效时,则该目标应用程序可开启该第二音频传输通道,而当预设接口函数的功能无效时,则该目标应用程序可调用但不开启该第二音频传输通道。具体的,电子设备可以通过对预设接口函数进行设置,以确定该预设接口函数功能的有效或无效性。The electronic device may monitor whether the target application program calls the preset interface function in the call state, where the preset interface function is used to set a second audio transmission channel for transmitting audio. When any target application can call the preset interface function, when the function of the preset interface function is valid, the target application can open the second audio transmission channel, and when the function of the preset interface function is invalid, then The target application can call but does not turn on the second audio transmission channel. Specifically, the electronic device can determine the validity or invalidity of the preset interface function by setting the preset interface function.
进一步的,预设接口函数至少包括setSpeakerphoneOn()接口函数、setMode(AudioManager.MODE_IN_CALL)接口函数、isWiredHeadsetOn()接口函数或其他用于设置听筒通道、耳机通道的接口函数等。Further, the preset interface functions include at least the setSpeakerphoneOn () interface function, setMode (AudioManager.MODE_IN_CALL) interface function, isWiredHeadsetOn () interface function or other interface functions for setting the earphone channel and the headphone channel, etc.
例如,基于安卓操作系统的电子设备中,电子设备可以通过调用AudioManager中的接口函数setSpeakerphoneOn()来设置扬声器通道,也即,可以开启或关闭扬声器通道。电子设备可以通过调用AudioManager中的函数setMode(AudioManager.MODE_IN_CALL)或构造参数streamType(STREAM_VOICE_CALL)设置听筒通道;电子设备可以通过调用AudioManager中的函数isWiredHeadsetOn()来设置并检测听筒通道。For example, in an electronic device based on the Android operating system, the electronic device can set the speaker channel by calling the interface function setSpeakerphoneOn () in the AudioManager, that is, the speaker channel can be turned on or off. The electronic device can set the earpiece channel by calling the function setMode (AudioManager.MODE_IN_CALL) in AudioManager or the construction parameter streamType (STREAM_VOICE_CALL); the electronic device can set and detect the earpiece channel by calling the function isWiredHeadsetOn () in AudioManager.
预设接口函数不限于上述举例说明,还可以根据实际需求来设定不同形式的预设接口函数。The preset interface functions are not limited to the above examples, and different forms of preset interface functions can also be set according to actual needs.
进一步的,电子设备可以监听目标应用程序调用预设接口函数是否向音频设备状态管理器申请使用音频传输通道。若向音频设备状态管理器发出了申请,该表明该目标应用程序调用了预设接口函数,也即,目标应用程序用产生了用于设置第二音频传输通道的操作。Further, the electronic device can monitor whether the target application program calls the preset interface function to apply to the audio device state manager to use the audio transmission channel. If an application is sent to the audio device status manager, it indicates that the target application program has called a preset interface function, that is, the target application program has generated an operation for setting a second audio transmission channel.
步骤406,判断目标应用程序是否在后台运行。Step 406: Determine whether the target application is running in the background.
在一个实施例中,电子设备可以获取目标应用程序的运行状态,该运行状态可包括前台运行或后台运行,进而可以判断目标应用程序是否在后台运行。具体地,电子设备可以监听目标应用程序的进程信息,并根据进程信息来确定目标应用程序的运行状态。例如,电子设备可以基于ActivityManager.RunningAppProcessInfo来获取目标应用程序运行中进程信息。其中,进程信息包括常量类型信息和变量类型信息,根据获取的进程信息就可以判断目标应用程序是否在后台运行。In one embodiment, the electronic device can obtain the running state of the target application, and the running state can include foreground running or background running, and then can determine whether the target application is running in the background. Specifically, the electronic device can monitor the process information of the target application program and determine the running state of the target application program according to the process information. For example, the electronic device may obtain the running process information of the target application based on ActivityManager.RunningAppProcessInfo. Among them, the process information includes constant type information and variable type information, and according to the acquired process information, it can be determined whether the target application program is running in the background.
可选的,电子设备还可以基于ActivityLifecycleCallbacks来监听目标应用程序是否运行在后台的行为,根据Activity的生命周期,其中,onStart()表示一个Activity处于前台,onStop()表示Activity在后台不可见。Optionally, the electronic device can also monitor whether the target application is running in the background based on ActivityLifecycleCallbacks. According to the life cycle of the Activity, onStart () indicates that an Activity is in the foreground, and onStop () indicates that the Activity is not visible in the background.
可选的,电子设备还可以通过getRunningTasks获取目标应用程序的运行状态,还可以通过getRunningTasks和RunningAppProcessInfo结合获取目标应用程序的运行状态。Optionally, the electronic device can also obtain the running state of the target application through getRunningTasks, and can also obtain the running state of the target application through a combination of getRunningTasks and RunningAppProcessInfo.
在此,对电子设备如何获取目标应用程序的运行状态不做进一步的限定,也不限于上述举例说明。Here, there is no further limitation on how the electronic device obtains the running state of the target application program, nor is it limited to the above example.
步骤408,当目标应用程序在后台运行且产生操作时,允许目标应用程序调用预设接口函数,且预设接口函数的功能失效,以维持第一音频传输通 道进行通话。Step 408: When the target application is running in the background and generating an operation, the target application is allowed to call the preset interface function, and the function of the preset interface function is disabled, so as to maintain the first audio transmission channel for calling.
在一个实施例中,若目标应用程序在后台运行时产生了用于设置第二音频传输通道的操作时,其允许目标应用程序调用该预设接口函数,且该预设接口函数的功能失效,以维持第一音频传输通道进行通话。In one embodiment, if the target application program generates an operation for setting the second audio transmission channel while running in the background, it allows the target application program to call the preset interface function, and the function of the preset interface function is invalid, To maintain the first audio transmission channel for talking.
在一个实施例中,当通话状态的第一音频通道为听筒通道时,允许目标应用程序调用第二预设函数,且第二预设函数功能失效,以维持听筒通道进行通话,其中,第二预设函数用于设置扬声器通道,或,第二预设函数还用于设置耳机通道。例如,当通话语音为听筒通道输出时,其在后台运行的目标应用程序调用了用于设置扬声器通道或耳机通道的预设函数功能时,电子设备可以是该预设接口函数的功能无效,仍维持当前通话语音的听筒通道输出,能够使通话语音从听筒通道输出,而避免改变通话语音的输出通道。In one embodiment, when the first audio channel in the call state is the earpiece channel, the target application is allowed to call the second preset function, and the second preset function is disabled to maintain the earphone channel for the call, where the second The preset function is used to set the speaker channel, or, the second preset function is also used to set the headphone channel. For example, when the call voice is output from the earphone channel, and the target application running in the background calls the preset function function for setting the speaker channel or the headphone channel, the electronic device may be that the function of the preset interface function is invalid, still Maintain the output of the receiver channel of the current call voice, so that the call voice can be output from the receiver channel, and avoid changing the output channel of the call voice.
在一个实施例中,当第一音频通道为扬声器通道时,允许目标应用程序调用第二预设函数,且第二预设函数功能失效,以维持扬声器通道进行通话;其中,第二预设函数用于设置听筒通道,还用于设置耳机通道。例如,当通话语音为扬声器通道输出时,其在后台运行的目标应用程序调用了用于设置听筒通道或耳机通道的预设函数功能时,电子设备可以是该预设接口函数的功能无效,仍维持当前通话语音的扬声器通道输出,能够使通话语音从扬声器通道输出,而避免改变通话语音的输出通道。In one embodiment, when the first audio channel is a speaker channel, the target application is allowed to call the second preset function, and the function of the second preset function is disabled to maintain the speaker channel for calling; wherein, the second preset function It is used to set the earpiece channel and also used to set the earphone channel. For example, when the call voice is output from the speaker channel, when the target application running in the background calls the preset function function for setting the earphone channel or the headphone channel, the electronic device may be that the function of the preset interface function is invalid and still Maintain the speaker channel output of the current call voice, so that the call voice can be output from the speaker channel, and avoid changing the output channel of the call voice.
当第一音频通道为耳机通道时,允许目标应用程序调用第二预设函数,且第二预设函数功能失效,以维持耳机道进行通话,其中,第二预设函数用于设置听筒通道,还用于设置扬声器通道。例如,当通话语音为耳机通道输出时,其在后台运行的目标应用程序调用了用于设置听筒通道或扬声器通道的预设函数功能时,电子设备可以是该预设接口函数的功能无效,仍维持当前通话语音的耳机通道输出,能够使通话语音从耳机通道输出,而避免改变通话语音的输出通道。When the first audio channel is a headphone channel, the target application is allowed to call the second preset function, and the function of the second preset function is disabled to maintain the earphone channel for calling, wherein the second preset function is used to set the earphone channel, It is also used to set up speaker channels. For example, when the call voice is output from the earphone channel, and the target application running in the background calls the preset function function for setting the earphone channel or the speaker channel, the electronic device may be that the function of the preset interface function is invalid, and still Maintain the current channel output of the voice of the call, so that the voice of the call can be output from the headset channel, and avoid changing the output channel of the voice of the call.
本实施例中的通话控制方法,在通话过程中,处于后台运行的目标应用程序虽然能够调用用于设置第二音频传输通道的预设接口函数,但是可以控制该调用的预设接口函数的功能无效,以维持当前通话语音的第一音频传输通道,能够使第一音频传输通道状态及相关参数均正常,从而避免改变通话语音的输出通道的情况发生,提高了用户通话过程中的体验度。In the call control method in this embodiment, during the call, although the target application running in the background can call the preset interface function for setting the second audio transmission channel, it can control the function of the called preset interface function Disabled to maintain the first audio transmission channel of the current call voice, can make the state of the first audio transmission channel and related parameters normal, thereby avoiding the situation of changing the output channel of the call voice, and improving the user's experience during the call.
如图5所示,在一个实施例中,通话控制方法包括步骤502-步骤506:As shown in FIG. 5, in one embodiment, the call control method includes steps 502-506:
步骤502:获取终端处于通话状态的第一音频传输通道。Step 502: Obtain the first audio transmission channel where the terminal is in a call state.
步骤504:监听目标应用程序在通话状态中是否产生用于设置第二音频 传输通道的操作。Step 504: Monitor whether the target application generates an operation for setting the second audio transmission channel in the call state.
上述步骤502、步骤504与前述实施例中步骤302、步骤304一一对应,在此,不再赘述。The above step 502 and step 504 correspond to step 302 and step 304 in the foregoing embodiment one by one, and will not be repeated here.
步骤506:当目标应用程序在前台运行且设置的第二传输通道符合预设条件时,允许目标应用程序启用第二音频传输通道,以使目标应用程序通过第二音频传输通道进行音频传输。Step 506: When the target application runs in the foreground and the set second transmission channel meets the preset condition, the target application is allowed to enable the second audio transmission channel, so that the target application performs audio transmission through the second audio transmission channel.
电子设备可以基于ActivityLifecycleCallbacks来监听目标应用程序是否运行在前台的行为。同时,电子设备可以监听在前台运行的目标应用程序在通话状态中是否调用预设接口函数,其中,预设接口函数用于设置传输音频的第二音频传输通道。当在前台运行的目标应用程序在通话状态中调用了预设接口函数,也即目标应用程序在前台运行时产生了用于设置第二音频传输通道的操作时,可以判断设置的第二传输通道是否符合预设条件。The electronic device can monitor whether the target application is running in the foreground based on ActivityLifecycleCallbacks. At the same time, the electronic device can monitor whether the target application running in the foreground calls the preset interface function in the call state, where the preset interface function is used to set a second audio transmission channel for transmitting audio. When the target application running in the foreground calls the preset interface function during the call state, that is, when the target application generates an operation for setting the second audio transmission channel while running in the foreground, the set second transmission channel can be judged Whether it meets the preset conditions.
在一个实施例中,预设条件包括第二音频传输通道与第一音频传输通道不一致。也即,当目标应用程序在前台运行且设置的第二传输通道与第一音频传输通道不一致时,允许目标应用程序启用第二音频传输通道,以使目标应用程序通过第二音频传输通道进行音频传输。In one embodiment, the preset condition includes that the second audio transmission channel is inconsistent with the first audio transmission channel. That is, when the target application is running in the foreground and the set second transmission channel is inconsistent with the first audio transmission channel, the target application is allowed to enable the second audio transmission channel to enable the target application to perform audio through the second audio transmission channel transmission.
例如,当通话状态的第一音频通道为听筒通道时,前台运行的目标应用程序设置的第二传输通道为扬声器通道,此时,目标应用程序若需要播放音频信号时,允许目标应用程序启用扬声器通道,以使目标应用程序通过扬声器通道进行音频传输。For example, when the first audio channel in the call state is the earpiece channel, the second transmission channel set by the target application running in the foreground is the speaker channel. At this time, if the target application needs to play an audio signal, the target application is allowed to enable the speaker Channel to enable the target application to transmit audio through the speaker channel.
进一步的,当第一音频传输通道的无通话语音输入时,允许目标应用程序启用扬声器通道时,并播放目标应用程序待播放的语音。Further, when there is no call voice input of the first audio transmission channel, the target application is allowed to play the voice to be played by the target application when the speaker channel is enabled.
在一个实施例中,预设条件包括第二音频传输通道与第一音频传输通道一致且目标应用程序的使用优先级高于通话的使用优先级。也即,当目标应用程序在前台运行且设置的第二传输通道与第一音频传输通道一致且目标应用程序的使用优先级高于通话的使用优先级时,允许目标应用程序启用第二音频传输通道,以使目标应用程序通过第二音频传输通道进行音频传输。其中,使用优先级可以理解的是,当通话与目标应用程序都需要使用同一音频传输通道时,能够优先使用的等级。In one embodiment, the preset condition includes that the second audio transmission channel is consistent with the first audio transmission channel and that the usage priority of the target application is higher than the usage priority of the call. That is, when the target application is running in the foreground and the set second transmission channel is consistent with the first audio transmission channel and the use priority of the target application is higher than the use priority of the call, the target application is allowed to enable the second audio transmission Channel, so that the target application performs audio transmission through the second audio transmission channel. Among them, the use priority can be understood as the priority level that can be used when both the call and the target application need to use the same audio transmission channel.
具体的,当目标应用程序的使用优先级高于通话的使用优先级时,其该使用优先级为使用听筒通道时的优先级。也即,目标应用程序和通话在同时使用听筒通道时,在一定情况下,其目标应用程序的使用优先级高于通话的使用优先级时,可以在允许目标应用程序先使用听筒通道,以使目标应用程 序通过听筒通道进行音频传输。例如,当该目标应用程序为即时通信类应用程序,该目标应用程序中当前处于通讯状态的联系人A的重要性高于当前通话联系人B时,则可以认为目标应用程序的使用优先级高于通话的使用优先级。Specifically, when the usage priority of the target application is higher than the usage priority of the call, the usage priority is the priority when using the receiver channel. That is, when the target application and the call use the receiver channel at the same time, under certain circumstances, when the use priority of the target application is higher than the use priority of the call, the target application can be allowed to use the receiver channel first, so that The target application transmits audio through the earpiece channel. For example, when the target application is an instant messaging application, and the contact A currently in communication in the target application is more important than the current call contact B, the target application can be considered to have a high priority Use priority for calls.
如图6所示,在一个实施例中,允许目标应用程序启用第二音频传输通道,以使目标应用程序通过第二音频传输通道进行音频传输,包括步骤602-步骤604。其中,As shown in FIG. 6, in one embodiment, allowing the target application to enable the second audio transmission channel to enable the target application to perform audio transmission through the second audio transmission channel includes steps 602-604. among them,
步骤602,检测通话状态的闲置时间段。Step 602: Detect the idle time period of the call state.
在一个实施例中,电子设备可以在通话状态检测通话状态的闲置时间段。其中,在预设时间段内未检测出输入或输出语音信号的时间段称之为闲置时间段。可选的,若在预设时间段内输入和输出语音信号的超出人声范围的时间段称之为闲置时间段。其中,人声范围可以理解为声波的频率范围为20HZ-20KHZ,其中,人说话的声音范围只在人能够听到的声音范围中占较窄的一部分,一般在100HZ-8KHZ以内,而200-4000HZ被称为人声基频,大部分人说话的频率都在该范围内。当输入和输出语音信号的频率均不在人声范围内时,则认为该时间段为闲置时间段。In one embodiment, the electronic device may detect the idle period of the call state during the call state. Among them, the time period during which no input or output voice signal is detected within a preset time period is referred to as an idle time period. Optionally, if the time period in which the input and output voice signals exceed the vocal range within a preset time period is called an idle time period. Among them, the vocal range can be understood as the frequency range of sound waves is 20HZ-20KHZ, where the voice range of human speech only occupies a narrow part of the sound range that humans can hear, generally within 100HZ-8KHZ, and 200- 4000HZ is called the fundamental frequency of human voice, and the frequency of most people speaking is within this range. When the frequency of the input and output voice signals is not within the range of human voice, the time period is considered as an idle time period.
步骤604,在闲置时间段允许目标应用程序启用第二音频传输通道,以使目标应用程序通过第二音频传输通道进行音频传输。Step 604: Allow the target application to enable the second audio transmission channel during the idle period, so that the target application can perform audio transmission through the second audio transmission channel.
电子设备能够在在闲置时间段允许目标应用程序启用第二音频传输通道,以使目标应用程序通过第二音频传输通道进行音频传输。也即,电子设备的通话状态的第一音频传输通道不会改变,同时在闲置时间段允许目标应用程序启用第二音频传输通道,以使目标应用程序通过第二音频传输通道进行音频传输。当目标应用程序通过第二音频传输通道进行音频传输完毕后,可以以第一音频传输通道恢复当前的通话状态,仍然不会改变第一音频传输通道状态及相关参数,提高了用户通话过程中的体验度以及使用目标应用程序的灵活性。The electronic device can allow the target application to enable the second audio transmission channel during the idle time period, so that the target application can perform audio transmission through the second audio transmission channel. That is, the first audio transmission channel of the communication state of the electronic device will not change, and at the same time, the target application is allowed to enable the second audio transmission channel during the idle time period, so that the target application performs audio transmission through the second audio transmission channel. After the target application completes the audio transmission through the second audio transmission channel, the first audio transmission channel can be used to restore the current call state, and the first audio transmission channel state and related parameters will not be changed, which improves the user's call process. Experience and flexibility in using the target application.
应该理解的是,虽然图3-6的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图3-6中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者 交替地执行。It should be understood that although the steps in the flowcharts of FIGS. 3-6 are displayed in order according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless clearly stated in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least some of the steps in FIGS. 3-6 may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but may be executed at different times. These sub-steps or stages The execution order of is not necessarily sequential, but may be executed in turn or alternately with at least a part of other steps or sub-steps or stages of other steps.
如图7所示,本申请还提供一种通话控制装置,包括:获取模块710、监听模块720以及处理模块730。其中,As shown in FIG. 7, the present application also provides a call control device, including: an obtaining module 710, a listening module 720, and a processing module 730. among them,
获取模块710,用于获取终端处于通话状态的第一音频传输通道;The obtaining module 710 is used to obtain the first audio transmission channel where the terminal is in a call state;
监听模块720,用于监听目标应用程序在通话状态中是否产生用于设置第二音频传输通道的操作;The monitoring module 720 is configured to monitor whether the target application program generates an operation for setting a second audio transmission channel in a call state;
处理模块730,用于当目标应用程序在后台运行且产生操作时,禁止目标应用程序开启第二音频传输通道,以维持第一音频传输通道进行通话。The processing module 730 is configured to prohibit the target application from opening the second audio transmission channel when the target application is running in the background and generates an operation, so as to maintain the first audio transmission channel for calling.
上述通话控制装置,可以获取所述电子设备处于通话状态的第一音频传输通道;监听目标应用程序在所述通话状态中是否产生用于设置第二音频传输通道的操作;当所述目标应用程序在后台运行且产生所述操作时,禁止所述目标应用程序开启所述第二音频传输通道,以维持所述第一音频传输通道进行通话,以维持当前通话语音还是以第一音频传输通道,可以避免通话过程中音频输出通道发生改变的情况发生,提高用户体验度。The above call control device can acquire the first audio transmission channel where the electronic device is in a call state; monitor whether the target application generates an operation for setting a second audio transmission channel in the call state; when the target application When running in the background and generating the operation, prohibit the target application from opening the second audio transmission channel to maintain the first audio transmission channel for the call to maintain the current call voice or the first audio transmission channel, The situation that the audio output channel is changed during a call can be avoided, and the user experience can be improved.
在一个实施例中,监听模块720,包括:In one embodiment, the monitoring module 720 includes:
监听单元,用于监听目标应用程序在通话状态中是否调用预设接口函数,其中,预设接口函数用于设置传输音频的第二音频传输通道;A monitoring unit, configured to monitor whether the target application program calls a preset interface function in a call state, wherein the preset interface function is used to set a second audio transmission channel for transmitting audio;
产生单元,用于当调用预设接口函数时,则产生操作。The generating unit is used for generating an operation when the preset interface function is called.
在一个实施例中,监听单元,还用于监听目标应用程序调用预设接口函数是否向音频设备状态管理器申请使用音频传输通道。In one embodiment, the monitoring unit is further configured to monitor whether the target application program calls the preset interface function to apply to the audio device state manager to use the audio transmission channel.
在一个实施例中,处理模块还用于允许目标应用程序调用预设接口函数,且预设接口函数的功能失效,以维持第一音频传输通道进行通话。In one embodiment, the processing module is further configured to allow the target application to call the preset interface function, and the function of the preset interface function is invalid, so as to maintain the first audio transmission channel for calling.
在一个实施例中,第一音频传输通道包括听筒通道、扬声器通道、耳机通道;In one embodiment, the first audio transmission channel includes an earpiece channel, a speaker channel, and a headphone channel;
当第一音频通道为听筒通道时,允许目标应用程序调用第二预设函数,且第二预设函数功能失效,以维持听筒通道进行通话,其中,第二预设函数用于设置扬声器通道,还用于设置耳机通道;When the first audio channel is an earphone channel, the target application is allowed to call the second preset function, and the second preset function is disabled to maintain the earphone channel for calling, wherein the second preset function is used to set the speaker channel, It is also used to set the earphone channel;
当第一音频通道为扬声器通道时,允许目标应用程序调用第二预设函数,且第二预设函数功能失效,以维持扬声器通道进行通话;其中,第二预设函数用于设置听筒通道,还用于设置耳机通道;When the first audio channel is a speaker channel, the target application is allowed to call the second preset function, and the function of the second preset function is disabled to maintain the speaker channel for calling; wherein, the second preset function is used to set the receiver channel, It is also used to set the earphone channel;
当第一音频通道为耳机通道时,允许目标应用程序调用第二预设函数,且第二预设函数功能失效,以维持耳机道进行通话,其中,第二预设函数用于设置听筒通道,还用于设置扬声器通道。When the first audio channel is a headphone channel, the target application is allowed to call the second preset function, and the function of the second preset function is disabled to maintain the earphone channel for calling, wherein the second preset function is used to set the earphone channel, It is also used to set up speaker channels.
本实施例中的通话控制装置,在通话过程中,处于后台运行的目标应用程序虽然能够调用用于设置第二音频传输通道的预设接口函数,但是可以控制该调用的预设接口函数的功能无效,以维持当前通话语音的第一音频传输通道,能够使第一音频传输通道状态及相关参数均正常,从而避免改变通话语音的输出通道的情况发生,提高了用户通话过程中的体验度。In the call control device in this embodiment, during the call, although the target application running in the background can call the preset interface function for setting the second audio transmission channel, it can control the function of the called preset interface function Disabled to maintain the first audio transmission channel of the current call voice, can make the state of the first audio transmission channel and related parameters normal, thereby avoiding the situation of changing the output channel of the call voice, and improving the user's experience during the call.
在一个实施例中,通话控制装置进一步包括:In one embodiment, the call control device further includes:
运行模块,用于获取目标应用程序的进程信息并根据进程信息判断目标应用程序是否在后台运行。The running module is used to obtain the process information of the target application and determine whether the target application is running in the background according to the process information.
在一个实施例中,处理模块730,还用于当目标应用程序在前台运行且设置的第二传输通道符合预设条件时,允许目标应用程序启用第二音频传输通道,以使目标应用程序通过第二音频传输通道进行音频传输。In one embodiment, the processing module 730 is further configured to allow the target application to enable the second audio transmission channel when the target application is running in the foreground and the set second transmission channel meets the preset condition, so that the target application can pass The second audio transmission channel performs audio transmission.
在一个实施例中,预设条件为第二音频传输通道与第一音频传输通道不一致,或,In one embodiment, the preset condition is that the second audio transmission channel is inconsistent with the first audio transmission channel, or,
预设条件包括第二音频传输通道与第一音频传输通道一致且目标应用程序的使用优先级高于通话的使用优先级。The preset condition includes that the second audio transmission channel is consistent with the first audio transmission channel and the use priority of the target application is higher than the use priority of the call.
在一个实施例中,处理模块730包括:In one embodiment, the processing module 730 includes:
检测单元,用于检测通话状态的闲置时间段;The detection unit is used to detect the idle time period of the call state;
处理单元,用于在闲置时间段允许目标应用程序启用第二音频传输通道,以使目标应用程序通过第二音频传输通道进行音频传输。The processing unit is configured to allow the target application to enable the second audio transmission channel during the idle time period, so that the target application can perform audio transmission through the second audio transmission channel.
本实施例中的通话控制装置,可以在闲置时间段允许目标应用程序启用第二音频传输通道,以使目标应用程序通过第二音频传输通道进行音频传输。也即,电子设备的通话状态的第一音频传输通道不会改变,同时在闲置时间段允许目标应用程序启用第二音频传输通道,以使目标应用程序通过第二音频传输通道进行音频传输。当目标应用程序通过第二音频传输通道进行音频传输完毕后,可以以第一音频传输通道恢复当前的通话状态,仍然不会改变第一音频传输通道状态及相关参数,提高了用户通话过程中的体验度以及使用目标应用程序的灵活性。The call control device in this embodiment may allow the target application to enable the second audio transmission channel during the idle period, so that the target application performs audio transmission through the second audio transmission channel. That is, the first audio transmission channel of the communication state of the electronic device will not change, and at the same time, the target application is allowed to enable the second audio transmission channel during the idle time period, so that the target application performs audio transmission through the second audio transmission channel. After the target application completes the audio transmission through the second audio transmission channel, the first audio transmission channel can be used to restore the current call state, and the first audio transmission channel state and related parameters will not be changed, which improves the user's call process. Experience and flexibility in using the target application.
上述通话控制装置中各个模块的划分仅用于举例说明,在其他实施例中,可将通话控制装置按照需要划分为不同的模块,以完成上述通话控制装置的全部或部分功能。The division of each module in the above call control device is for illustration only. In other embodiments, the call control device may be divided into different modules as needed to complete all or part of the functions of the above call control device.
上述通话控制装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于电子设备中的处理器中,也可以以软件形式存储于电子设备中的存储器中,以便于处理器调用执行以 上各个模块对应的操作。Each module in the above call 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 processor to perform the steps of the following call control method:
获取终端处于通话状态的第一音频传输通道;Obtain the first audio transmission channel where the terminal is in a call state;
监听目标应用程序在通话状态中是否产生用于设置第二音频传输通道的操作;Monitor whether the target application generates an operation for setting the second audio transmission channel in the call state;
当目标应用程序在后台运行且产生操作时,禁止目标应用程序开启第二音频传输通道,以维持第一音频传输通道进行通话。When the target application runs in the background and generates an operation, the target application is prohibited from turning on the second audio transmission channel to maintain the first audio transmission channel for calling.
需要说明的是,一个或多个包含计算机可执行指令的非易失性计算机可读存储介质,当计算机可执行指令被一个或多个处理器执行时,还可以使得处理器执行上述任一实施例中的通话控制方法。It should be noted that 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 call control method.
一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行通话控制方法的步骤:A computer program product containing instructions that, when run on a computer, causes the computer to perform the steps of the call control method:
获取终端处于通话状态的第一音频传输通道;Obtain the first audio transmission channel where the terminal is in a call state;
监听目标应用程序在通话状态中是否产生用于设置第二音频传输通道的操作;Monitor whether the target application generates an operation for setting the second audio transmission channel in the call state;
当目标应用程序在后台运行且产生操作时,禁止目标应用程序开启第二音频传输通道,以维持第一音频传输通道进行通话。When the target application runs in the background and generates an operation, the target application is prohibited from turning on the second audio transmission channel to maintain the first audio transmission channel for calling.
需要说明的是,一种包含指令的计算机程序产品,当其在计算机上运行时使得计算机执行上述任一实施例中的通话控制方法。It should be noted that a computer program product containing instructions, when run on a computer, causes the computer to execute the call control method in any of the above embodiments.
本申请实施例还提供了一种电子设备。如图8所示,为了便于说明,仅示出了与本申请实施例相关的部分,具体技术细节未揭示的,请参照本申请实施例方法部分。该电子设备可以为包括手机、平板电脑、PDA(Personal Digital Assistant,个人数字助理)、POS(Point of Sales,销售终端)、车载电脑、穿戴式设备等具有语音通话功能并具有扬声器的任意终端设备,以电子设备为手机为例:An embodiment of the present application also provides an electronic device. As shown in FIG. 8, for ease of description, only parts related to the embodiments of the present application are shown, and specific technical details are not disclosed, please refer to the method part of the embodiments of the present application. 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:
图8为与本申请实施例提供的电子设备相关的手机的部分结构的框图。参考图8,手机包括:射频(Radio Frequency,RF)电路810、存储器820、输入单元830、显示单元840、传感器850、音频电路860、无线保真(wireless fidelity,WiFi)模块870、处理器880、以及电源890等部件。本领域技术人员可以理解,图8所示的手机结构并不构成对手机的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。8 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. 8, the mobile phone includes: a radio frequency (Radio Frequency) circuit 810, a memory 820, an input unit 830, a display unit 840, a sensor 850, an audio circuit 860, a wireless fidelity (WiFi) module 870, and a processor 880 , And power supply 890 and other components. Those skilled in the art may understand that the structure of the mobile phone shown in FIG. 8 does not constitute a limitation on the mobile phone, and may include more or fewer components than those shown in the figure, or a combination of certain components, or a different component arrangement.
其中,RF电路810可用于收发信息或通话过程中,信号的接收和发送,可将基站的下行信息接收后,给处理器880处理;也可以将上行的数据发送给基站。通常,RF电路包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器(Low Noise Amplifier,LNA)、双工器等。此外,RF电路810还可以通过无线通信与网络和其他设备通信。上述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(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)等。Among them, the RF circuit 810 can be used to receive and send signals during the sending and receiving of information or during a call. It can receive the downlink information of the base station and process it to the processor 880; it can also send the uplink data to the base station. Generally, 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. In addition, the RF circuit 810 can also communicate with other devices through a wireless communication network. The above wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile (GSM), General Packet Radio Service (GPRS), and Code Division Multiple Access (Code Division) Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), e-mail, Short Message Service (SMS), etc.
存储器820可用于存储软件程序以及模块,处理器880通过运行存储在存储器820的软件程序以及模块,从而执行手机的各种功能应用以及数据处理。存储器820可主要包括程序存储区和数据存储区,其中,程序存储区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能的应用程序、图像播放功能的应用程序等)等;数据存储区可存储根据手机的使用所创建的数据(比如音频数据、通讯录等)等。此外,存储器820可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory 820 may be used to store software programs and modules. The processor 880 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 820. The memory 820 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. In addition, the memory 820 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.
输入单元830可用于接收输入的数字或字符信息,以及产生与手机800的用户设置以及功能控制有关的键信号输入。具体地,输入单元830可包括触控面板831以及其他输入设备832。触控面板831,也可称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板831上或在触控面板831附近的操作),并根据预先设定的程式驱动相应的连接装置。在一个实施例中,触控面板831可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器880,并能接收处理器880发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板831。除了触控面板831,输入单元830还可以包括其他输入设备832。具体地,其他输入设备832可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)等中的一种或多种。The input unit 830 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 800. Specifically, the input unit 830 may include a touch panel 831 and other input devices 832. The touch panel 831, also known as a touch screen, can collect user's touch operations on or near it (such as the user using any finger, stylus, or any other suitable object or accessory on or near the touch panel 831 Operation), and drive the corresponding connection device according to the preset program. In one embodiment, the touch panel 831 may include a touch detection device and a touch controller. Among them, 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 880, and can receive the command sent by the processor 880 and execute it. In addition, the touch panel 831 may be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 831, the input unit 830 may also include other input devices 832. Specifically, other input devices 832 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.
显示单元840可用于显示由用户输入的信息或提供给用户的信息以及手机的各种菜单。显示单元840可包括显示面板841。在一个实施例中,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板841。在一个实施例中,触控面板831可覆盖显示面板841,当触控面板831检测到在其上或附近的触摸操作后,传送给处理器880以确定触摸事件的类型,随后处理器880根据触摸事件的类型在显示面板841上提供相应的视觉输出。虽然在图8中,触控面板831与显示面板841是作为两个独立的部件来实现手机的输入和输入功能,但是在某些实施例中,可以将触控面板831与显示面板841集成而实现手机的输入和输出功能。The display unit 840 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 840 may include a display panel 841. In one embodiment, the display panel 841 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. In one embodiment, the touch panel 831 may cover the display panel 841, and when the touch panel 831 detects a touch operation on or near it, it is transmitted to the processor 880 to determine the type of touch event, and then the processor 880 according to The type of touch event provides a corresponding visual output on the display panel 841. Although in FIG. 8, the touch panel 831 and the display panel 841 are implemented as two independent components to realize the input and input functions of the mobile phone, in some embodiments, the touch panel 831 and the display panel 841 may be integrated and Realize the input and output functions of the mobile phone.
手机800还可包括至少一种传感器850,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板841的亮度,接近传感器可在手机移动到耳边时,关闭显示面板841和/或背光。运动传感器可包括加速度传感器,通过加速度传感器可检测各个方向上加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换)、振动识别相关功能(比如计步器、敲击)等;此外,手机还可配置陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器等。The mobile phone 800 may further include at least one sensor 850, such as a light sensor, a motion sensor, and other sensors. Specifically, 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 841 according to the brightness of the ambient light, and the proximity sensor may close the display panel 841 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. In addition, the mobile phone can also be equipped with other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared sensor and so on.
音频电路860、扬声器861和传声器862可提供用户与手机之间的音频接口。音频电路860可将接收到的音频数据转换后的电信号,传输到扬声器861,由扬声器861转换为声音信号输出;另一方面,传声器862将收集的声音信号转换为电信号,由音频电路860接收后转换为音频数据,再将音频数据输出处理器880处理后,经RF电路810可以发送给另一手机,或者将音频数据输出至存储器820以便后续处理。The audio circuit 860, the speaker 861, and the microphone 862 may provide an audio interface between the user and the mobile phone. The audio circuit 860 can transmit the converted electrical signal of the received audio data to the speaker 861, which converts the speaker 861 into a sound signal output; on the other hand, the microphone 862 converts the collected sound signal into an electrical signal, which After receiving, it is converted into audio data, and then processed by the audio data output processor 880, and then sent to another mobile phone via the RF circuit 810, or the audio data is output to the memory 820 for subsequent processing.
WiFi属于短距离无线传输技术,手机通过WiFi模块870可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。虽然图8示出了WiFi模块870,但是可以理解的是,其并不属于手机800的必须构成,可以根据需要而省略。WiFi is a short-range wireless transmission technology. The mobile phone can help users send and receive e-mails, browse web pages, and access streaming media through the WiFi module 870. It provides users with wireless broadband Internet access. Although FIG. 8 shows the WiFi module 870, it can be understood that it is not a necessary component of the mobile phone 800, and may be omitted as needed.
处理器880是手机的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器820内的软件程序和/或模块,以及调用存储在存储器820内的数据,执行手机的各种功能和处理数据,从而对手机进行整体监控。在一个实施例中,处理器880可包括一个或多个处理单元。在一个实施例中,处理器880可集成应用处理器和调制解调处理器,其中, 应用处理器主要处理操作系统、用户界面和应用程序等;调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器880中。The processor 880 is the control center of the mobile phone, and uses various interfaces and lines to connect the various parts of the entire mobile phone. Various functions and processing data of the mobile phone, so as to monitor the mobile phone as a whole. In one embodiment, the processor 880 may include one or more processing units. In one embodiment, the processor 880 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, user interface, application programs, etc .; the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor may not be integrated into the processor 880.
手机800还包括给各个部件供电的电源890(比如电池),优选的,电源可以通过电源管理系统与处理器880逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。The mobile phone 800 further includes a power supply 890 (such as a battery) for powering various components. Preferably, the power supply can be logically connected to the processor 880 through the power management system, so as to realize functions such as charging, discharging, and power management through the power management system.
在一个实施例中,手机800还可以包括摄像头、蓝牙模块等。In one embodiment, the mobile phone 800 may further include a camera, a Bluetooth module, and the like.
在本申请实施例中,该电子设备所包括的处理器880执行存储在存储器上的计算机程序时实现以下步骤:In the embodiment of the present application, the processor 880 included in the electronic device implements the following steps when executing the computer program stored on the memory:
获取所述终端处于通话状态的第一音频传输通道;Acquiring the first audio transmission channel where the terminal is in a call state;
监听目标应用程序在所述通话状态中是否产生用于设置第二音频传输通道的操作;Monitoring whether the target application program generates an operation for setting a second audio transmission channel in the call state;
当所述目标应用程序在后台运行且产生所述操作时,禁止所述目标应用程序开启所述第二音频传输通道,以维持所述第一音频传输通道进行通话。When the target application is running in the background and the operation is generated, the target application is prohibited from opening the second audio transmission channel to maintain the first audio transmission channel for calling.
需要说明的是,电子设备所包括的处理器880执行存储在存储器上的计算机程序时实现上述任一实施例中的通话控制方法。It should be noted that, when the processor 880 included in the electronic device executes the computer program stored in the memory, the call control method in any of the foregoing embodiments is implemented.
本申请所使用的对存储器、存储、数据库或其它介质的任何引用可包括非易失性和/或易失性存储器。合适的非易失性存储器可包括只读存储器(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)。Any references to memory, storage, databases, or other media used in this application may include non-volatile and / or volatile memory. Suitable 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. By way of illustration and not limitation, 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).
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above-mentioned embodiments can be combined arbitrarily. To simplify the description, all possible combinations of the technical features in the above-mentioned embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, All should be considered within the scope of this description.
以上所述实施例仅表达了本发明的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进,这些都属于本发明的保护范围。因此,本发明专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only express several embodiments of the present invention, and their descriptions are more specific and detailed, but they should not be construed as limiting the scope of the invention patent. It should be noted that, for a person of ordinary skill in the art, without departing from the concept of the present invention, several modifications and improvements can also be made, which all fall within the protection scope of the present invention. Therefore, the protection scope of the invention patent shall be subject to the appended claims.

Claims (23)

  1. 一种通话控制方法,应用于具有多个音频传输通道的电子设备,包括:A call control method applied to electronic equipment with multiple audio transmission channels, including:
    获取所述电子设备处于通话状态的第一音频传输通道;Acquiring the first audio transmission channel where the electronic device is in a call state;
    监听目标应用程序在所述通话状态中是否产生用于设置第二音频传输通道的操作;Monitoring whether the target application program generates an operation for setting a second audio transmission channel in the call state;
    当所述目标应用程序在后台运行且产生所述操作时,禁止所述目标应用程序开启所述第二音频传输通道,以维持所述第一音频传输通道进行通话。When the target application is running in the background and the operation is generated, the target application is prohibited from opening the second audio transmission channel to maintain the first audio transmission channel for calling.
  2. 根据权利要求1所述的方法,其中,所述监听目标应用程序在所述通话状态中是否产生用于设置第二音频传输通道的操作,包括:The method according to claim 1, wherein whether the monitoring target application generates an operation for setting a second audio transmission channel in the call state includes:
    监听所述目标应用程序在所述通话状态中是否调用预设接口函数,其中,所述预设接口函数用于设置传输音频的所述第二音频传输通道;Monitoring whether the target application program calls a preset interface function in the call state, wherein the preset interface function is used to set the second audio transmission channel for transmitting audio;
    当调用所述预设接口函数时,则产生所述操作。When the preset interface function is called, the operation is generated.
  3. 根据权利要求2所述的方法,其中,所述监听所述目标应用程序在所述通话状态中是否调用所述预设接口函数,包括:The method according to claim 2, wherein the monitoring whether the target application calls the preset interface function in the call state includes:
    监听所述目标应用程序调用所述预设接口函数是否向音频设备状态管理器申请使用所述音频传输通道。Monitoring whether the target application program calls the preset interface function to apply to the audio device state manager to use the audio transmission channel.
  4. 根据权利要求2所述的方法,其中,所述禁止所述目标应用程序开启所述第二音频传输通道,以维持所述第一音频传输通道进行通话,包括:The method according to claim 2, wherein the prohibiting the target application from opening the second audio transmission channel to maintain the first audio transmission channel for calling includes:
    允许所述目标应用程序调用所述预设接口函数,且所述预设接口函数的功能失效,以维持所述第一音频传输通道进行通话。The target application program is allowed to call the preset interface function, and the function of the preset interface function is disabled to maintain the first audio transmission channel for calling.
  5. 根据权利要求4所述的方法,其中,所述第一音频传输通道包括听筒通道、扬声器通道、耳机通道;The method according to claim 4, wherein the first audio transmission channel includes an earphone channel, a speaker channel, and a headphone channel;
    当所述第一音频通道为听筒通道时,允许所述目标应用程序调用第二预设函数,且所述第二预设函数功能失效,以维持听筒通道进行通话,其中,所述第二预设函数用于设置所述扬声器通道,或,用于设置所述耳机通道。When the first audio channel is an earpiece channel, the target application is allowed to call a second preset function, and the function of the second preset function is disabled to maintain the earphone channel for calling. Let the function be used to set the speaker channel or the earphone channel.
  6. 根据权利要求5所述的方法,其中,当所述第一音频通道为扬声器通道时,允许所述目标应用程序调用第二预设函数,且所述第二预设函数功能失效,以维持扬声器通道进行通话;其中,所述第二预设函数用于设置所述听筒通道,或,用于设置所述耳机通道。The method according to claim 5, wherein, when the first audio channel is a speaker channel, the target application is allowed to call a second preset function, and the function of the second preset function is invalid to maintain the speaker Channel to talk; wherein, the second preset function is used to set the receiver channel, or to set the headset channel.
  7. 根据权利要求5所述的方法,其中,当所述第一音频通道为耳机通道时,允许所述目标应用程序调用第二预设函数,且所述第二预设函数功能失效,以维持耳机道进行通话,其中,所述第二预设函数用于设置所述听筒通道,或,用于设置所述扬声器通道。The method according to claim 5, wherein, when the first audio channel is a headphone channel, the target application is allowed to call a second preset function, and the function of the second preset function is invalid to maintain the headset Channel, where the second preset function is used to set the receiver channel, or to set the speaker channel.
  8. 根据权利要求1所述的方法,其中,所述方法进一步包括:The method of claim 1, wherein the method further comprises:
    获取所述目标应用程序的进程信息;Acquiring process information of the target application;
    根据所述进程信息判断所述目标应用程序是否在后台运行。According to the process information, determine whether the target application is running in the background.
  9. 根据权利要求1所述的方法,其中,所述方法进一步包括:The method of claim 1, wherein the method further comprises:
    当所述目标应用程序在前台运行且设置的所述第二传输通道符合预设条件时,允许所述目标应用程序启用所述第二音频传输通道,以使所述目标应用程序通过所述第二音频传输通道进行音频传输。When the target application is running in the foreground and the set second transmission channel meets a preset condition, the target application is allowed to enable the second audio transmission channel, so that the target application passes the first Two audio transmission channels for audio transmission.
  10. 根据权利要求9所述的方法,其中,所述预设条件包括所述第二音频传输通道与所述第一音频传输通道不一致。The method according to claim 9, wherein the preset condition includes that the second audio transmission channel is inconsistent with the first audio transmission channel.
  11. 根据权利要求9所述的方法,其中,预设条件包括所述第二音频传输通道与所述第一音频传输通道一致且所述目标应用程序的使用优先级高于所述通话的使用优先级。The method according to claim 9, wherein the preset condition includes that the second audio transmission channel is consistent with the first audio transmission channel and the use priority of the target application is higher than the use priority of the call .
  12. 根据权利要求9所述的方法,其中,所述允许所述目标应用程序启用所述第二音频传输通道,以使所述目标应用程序通过所述第二音频传输通道进行音频传输,包括:The method according to claim 9, wherein the allowing the target application to enable the second audio transmission channel to enable the target application to perform audio transmission through the second audio transmission channel includes:
    检测所述通话状态的闲置时间段;Detect the idle time period of the call state;
    在所述闲置时间段允许所述目标应用程序启用所述第二音频传输通道,以使所述目标应用程序通过所述第二音频传输通道进行音频传输。Allowing the target application to enable the second audio transmission channel during the idle time period, so that the target application performs audio transmission through the second audio transmission channel.
  13. 一种通话控制装置,应用于具有多个音频传输通道的电子设备,包括:A call control device applied to electronic equipment with multiple audio transmission channels, including:
    获取模块,用于获取所述电子设备处于通话状态的第一音频传输通道;An obtaining module, configured to obtain the first audio transmission channel where the electronic device is in a call state;
    监听模块,用于监听目标应用程序在所述通话状态中是否产生用于设置第二音频传输通道的操作;A monitoring module, configured to monitor whether the target application program generates an operation for setting a second audio transmission channel in the call state;
    处理模块,用于当所述目标应用程序在后台运行且产生所述操作时,禁止所述目标应用程序开启所述第二音频传输通道,以维持所述第一音频传输通道进行通话。The processing module is configured to, when the target application is running in the background and generating the operation, prohibit the target application from opening the second audio transmission channel to maintain the first audio transmission channel for calling.
  14. 根据权利要求13所述的装置,其中,所述监听模块,包括:The apparatus according to claim 13, wherein the monitoring module comprises:
    监听单元,用于监听所述目标应用程序在所述通话状态中是否调用预设接口函数,其中,所述预设接口函数用于设置传输音频的所述第二音频传输通道;A monitoring unit, configured to monitor whether the target application program calls a preset interface function in the call state, wherein the preset interface function is used to set the second audio transmission channel for transmitting audio;
    产生单元,用于当调用所述预设接口函数时,则产生所述操作。The generating unit is configured to generate the operation when the preset interface function is called.
  15. 根据权利要求14所述的装置,其中,所述监听单元还用于监听所述目标应用程序调用所述预设接口函数是否向音频设备状态管理器申请使用所述音频传输通道。The apparatus according to claim 14, wherein the monitoring unit is further configured to monitor whether the target application program calls the preset interface function to apply to the audio device state manager to use the audio transmission channel.
  16. 根据权利要求14所述的装置,其中,所述处理模块还用于允许所述目 标应用程序调用所述预设接口函数,且所述预设接口函数的功能失效,以维持所述第一音频传输通道进行通话。The apparatus according to claim 14, wherein the processing module is further configured to allow the target application to call the preset interface function, and the function of the preset interface function is invalid to maintain the first audio Talk through the transmission channel.
  17. 根据权利要求16所述的装置,其中,所述第一音频传输通道包括听筒通道、扬声器通道、耳机通道;The device according to claim 16, wherein the first audio transmission channel includes an earphone channel, a speaker channel, and a headphone channel;
    当所述第一音频通道为听筒通道时,允许所述目标应用程序调用第二预设函数,且所述第二预设函数功能失效,以维持听筒通道进行通话,其中,所述第二预设函数用于设置所述扬声器通道,还用于设置所述耳机通道;When the first audio channel is an earpiece channel, the target application is allowed to call a second preset function, and the function of the second preset function is disabled to maintain the earphone channel for calling. Set the function to set the speaker channel, and also to set the headphone channel;
    当所述第一音频通道为扬声器通道时,允许所述目标应用程序调用第二预设函数,且所述第二预设函数功能失效,以维持扬声器通道进行通话;其中,所述第二预设函数用于设置所述听筒通道,还用于设置所述耳机通道;When the first audio channel is a speaker channel, the target application is allowed to call a second preset function, and the function of the second preset function is disabled to maintain the speaker channel for calling; wherein, the second Set the function to set the earpiece channel, and also to set the earphone channel;
    当所述第一音频通道为耳机通道时,允许所述目标应用程序调用第二预设函数,且所述第二预设函数功能失效,以维持耳机道进行通话,其中,所述第二预设函数用于设置所述听筒通道,还用于设置所述扬声器通道。When the first audio channel is a headset channel, the target application is allowed to call a second preset function, and the function of the second preset function is disabled to maintain the headset channel for calling. Let the function be used to set the earpiece channel and also to set the speaker channel.
  18. 根据权利要求13所述的装置,其中,进一步包括:The device of claim 13, further comprising:
    运行模块,用于获取所述目标应用程序的进程信息并根据所述进程信息判断所述目标应用程序是否在后台运行。The running module is used to obtain the process information of the target application program and determine whether the target application program is running in the background according to the process information.
  19. 根据权利要求13所述的装置,其中,所述处理模块,还用于当所述目标应用程序在前台运行且设置的所述第二传输通道符合预设条件时,允许所述目标应用程序启用所述第二音频传输通道,以使所述目标应用程序通过所述第二音频传输通道进行音频传输。The apparatus according to claim 13, wherein the processing module is further configured to allow the target application to be enabled when the target application is running in the foreground and the set second transmission channel meets a preset condition The second audio transmission channel, so that the target application program performs audio transmission through the second audio transmission channel.
  20. 根据权利要求19所述的装置,其中,所述预设条件为所述第二音频传输通道与所述第一音频传输通道不一致,或,The apparatus according to claim 19, wherein the preset condition is that the second audio transmission channel is inconsistent with the first audio transmission channel, or,
    预设条件包括所述第二音频传输通道与所述第一音频传输通道一致且所述目标应用程序的使用优先级高于所述通话的使用优先级。The preset condition includes that the second audio transmission channel is consistent with the first audio transmission channel and the use priority of the target application is higher than the use priority of the call.
  21. 根据权利要求19所述的装置,其中,所述处理模块包括:The apparatus of claim 19, wherein the processing module comprises:
    检测单元,用于检测所述通话状态的闲置时间段;A detection unit, configured to detect the idle time period of the conversation state;
    处理单元,用于在所述闲置时间段允许所述目标应用程序启用所述第二音频传输通道,以使所述目标应用程序通过所述第二音频传输通道进行音频传输。The processing unit is configured to allow the target application to enable the second audio transmission channel during the idle time period, so that the target application performs audio transmission through the second audio transmission channel.
  22. 一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至12中任一项所述的通话控制方法的步骤。A computer-readable storage medium on which a computer program is stored, which when executed by a processor implements the steps of the call control method according to any one of claims 1 to 12.
  23. 一种电子设备,包括存储器及处理器,所述存储器中储存有计算机可读指令,所述指令被所述处理器执行时,使得所述处理器执行如权利要求1至12中任一项所述的通话控制方法。An electronic device includes a memory and a processor, and the memory stores computer-readable instructions, and when the instructions are executed by the processor, the processor is caused to perform as described in any one of claims 1 to 12. The call control method described above.
PCT/CN2018/115984 2018-11-16 2018-11-16 Call control method and device, computer-readable storage medium and electronic device WO2020097927A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2018/115984 WO2020097927A1 (en) 2018-11-16 2018-11-16 Call control method and device, computer-readable storage medium and electronic device
CN201880097707.5A CN112805988B (en) 2018-11-16 2018-11-16 Call control method and device, computer readable storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/115984 WO2020097927A1 (en) 2018-11-16 2018-11-16 Call control method and device, computer-readable storage medium and electronic device

Publications (1)

Publication Number Publication Date
WO2020097927A1 true WO2020097927A1 (en) 2020-05-22

Family

ID=70730396

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/115984 WO2020097927A1 (en) 2018-11-16 2018-11-16 Call control method and device, computer-readable storage medium and electronic device

Country Status (2)

Country Link
CN (1) CN112805988B (en)
WO (1) WO2020097927A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112286856A (en) * 2020-10-29 2021-01-29 维沃移动通信有限公司 Control method and electronic device
CN113852780A (en) * 2021-09-18 2021-12-28 联想(北京)有限公司 Audio data processing method and electronic equipment

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113535113A (en) * 2021-07-19 2021-10-22 上海月猫科技有限公司 Audio sharing method, system and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090177965A1 (en) * 2008-01-04 2009-07-09 International Business Machines Corporation Automatic manipulation of conflicting media presentations
CN103596641A (en) * 2012-10-18 2014-02-19 华为终端有限公司 Audio frequency managing method and device
CN105843466A (en) * 2016-03-14 2016-08-10 广州趣丸网络科技有限公司 Real-time voice method and device
CN106528735A (en) * 2016-10-27 2017-03-22 北京小米移动软件有限公司 Method and device for controlling browser to play media resources
CN107707728A (en) * 2017-07-25 2018-02-16 努比亚技术有限公司 A kind of audio transmission switching method, terminal and computer-readable recording medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9716957B2 (en) * 2013-04-28 2017-07-25 Innovation Sound Technology Co., Ltd. Headset capable of converting sound channels
CN107229448A (en) * 2017-06-30 2017-10-03 联想(北京)有限公司 Audio frequency playing method and electronic equipment
CN108769431A (en) * 2018-07-03 2018-11-06 Oppo(重庆)智能科技有限公司 Audio play control method, device, storage medium and mobile terminal

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090177965A1 (en) * 2008-01-04 2009-07-09 International Business Machines Corporation Automatic manipulation of conflicting media presentations
CN103596641A (en) * 2012-10-18 2014-02-19 华为终端有限公司 Audio frequency managing method and device
CN105843466A (en) * 2016-03-14 2016-08-10 广州趣丸网络科技有限公司 Real-time voice method and device
CN106528735A (en) * 2016-10-27 2017-03-22 北京小米移动软件有限公司 Method and device for controlling browser to play media resources
CN107707728A (en) * 2017-07-25 2018-02-16 努比亚技术有限公司 A kind of audio transmission switching method, terminal and computer-readable recording medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112286856A (en) * 2020-10-29 2021-01-29 维沃移动通信有限公司 Control method and electronic device
CN113852780A (en) * 2021-09-18 2021-12-28 联想(北京)有限公司 Audio data processing method and electronic equipment
CN113852780B (en) * 2021-09-18 2023-03-21 联想(北京)有限公司 Audio data processing method and electronic equipment

Also Published As

Publication number Publication date
CN112805988A (en) 2021-05-14
CN112805988B (en) 2022-04-12

Similar Documents

Publication Publication Date Title
US11102697B2 (en) Method for controlling earphone switching and earphone
CN112997470B (en) Audio output control method and device, computer readable storage medium and electronic equipment
CN111083684B (en) Method for controlling electronic equipment and electronic equipment
CN108391205B (en) Left and right channel switching method and device, readable storage medium and terminal
CN107231473B (en) Audio output regulation and control method, equipment and computer readable storage medium
WO2021036711A1 (en) Network control method and related product
WO2018049934A1 (en) Data migration method and terminals
WO2020097927A1 (en) Call control method and device, computer-readable storage medium and electronic device
CN108958695B (en) Audio output method, device and computer readable storage medium
CN109067965B (en) Translation method, translation device, wearable device and storage medium
US11800431B2 (en) Access control method, message broadcasting method, and related devices
WO2020103070A1 (en) Method and apparatus for processing application program, and electronic device
JP2021508989A (en) Service processing method and mobile communication terminal
WO2020103045A1 (en) Application processing method and apparatus and electronic device
WO2020118496A1 (en) Audio path switching method and device, readable storage medium and electronic equipment
WO2020124541A1 (en) Audio processing method and apparatus, computer readable storage medium, and electronic device
WO2018049936A2 (en) Data migration method and terminals
WO2020113525A1 (en) Playing control method and apparatus, and computer-readable storage medium and electronic device
CN109933187B (en) Wearing equipment operation control method, wearing equipment and computer readable storage medium
WO2020107177A1 (en) Audio resource invoking method and apparatus, and electronic device
WO2020103073A1 (en) Method and device for processing audio resources, computer readable storage medium and electronic device
JP7379714B2 (en) Multicast service processing method, multicast service configuration method, terminal and network equipment
WO2018166089A1 (en) Method for controlling audio and mobile terminal
US11637921B2 (en) Enabling vibration notification based on environmental noise
WO2020107169A1 (en) Audio mode correction method and apparatus, and electronic device

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: 18939965

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18939965

Country of ref document: EP

Kind code of ref document: A1

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

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

122 Ep: pct application non-entry in european phase

Ref document number: 18939965

Country of ref document: EP

Kind code of ref document: A1