WO2020135655A1 - Audio processing method, apparatus, terminal, and storage medium - Google Patents

Audio processing method, apparatus, terminal, and storage medium Download PDF

Info

Publication number
WO2020135655A1
WO2020135655A1 PCT/CN2019/128958 CN2019128958W WO2020135655A1 WO 2020135655 A1 WO2020135655 A1 WO 2020135655A1 CN 2019128958 W CN2019128958 W CN 2019128958W WO 2020135655 A1 WO2020135655 A1 WO 2020135655A1
Authority
WO
WIPO (PCT)
Prior art keywords
audio
communication application
application
focus
task
Prior art date
Application number
PCT/CN2019/128958
Other languages
French (fr)
Chinese (zh)
Inventor
张思超
张金芹
Original Assignee
广州市百果园信息技术有限公司
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 广州市百果园信息技术有限公司 filed Critical 广州市百果园信息技术有限公司
Publication of WO2020135655A1 publication Critical patent/WO2020135655A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/16Sound input; Sound output
    • G06F3/167Audio in a user interface, e.g. using voice commands for navigating, audio feedback
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/16Sound input; Sound output
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • G11B20/10009Improvement or modification of read or write signals
    • G11B20/10018Improvement or modification of read or write signals analog processing for digital recording or reproduction
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • G11B20/10527Audio or video recording; Data buffering arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/04Real-time or near real-time messaging, e.g. instant messaging [IM]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/439Processing of audio elementary streams
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • G11B20/10527Audio or video recording; Data buffering arrangements
    • G11B2020/10537Audio or video recording
    • G11B2020/10546Audio or video recording specifically adapted for audio data

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Human Computer Interaction (AREA)
  • General Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Telephone Function (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

An audio processing method, apparatus, terminal, and storage medium, the method comprising: acquiring an audio sharing instruction, the audio sharing instruction being used to instruct to share audio with a chat object of a current user of a communication application (S110); according to the audio sharing instruction, generating an audio playback task (S120); when detected that the communication application has started up a recording function, executing the audio playback task such that the communication application carries out recording.

Description

音频处理方法、装置、终端和存储介质Audio processing method, device, terminal and storage medium
本申请要求在2018年12月28日提交中国专利局、申请号为201811629805.7的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。This application requires the priority of the Chinese patent application with the application number 201811629805.7 submitted to the China Patent Office on December 28, 2018. The entire content of this application is incorporated by reference in this application.
技术领域Technical field
本申请实施例涉及音频处理技术领域,例如涉及一种音频处理方法、装置、终端和存储介质。The embodiments of the present application relate to the technical field of audio processing, for example, to an audio processing method, device, terminal, and storage medium.
背景技术Background technique
相关技术中,若用户想在第三方即时通讯应用上录制来自音频播放应用播放的音频并发送给好友,需要事先开启音频播放应用的悬浮窗权限。由于Android系统版本繁多以及官方对权限的逐步收紧,且受限于厂商对系统的深度定制,影响悬浮窗权限开启,用控制代码引导用户开启悬浮窗权限难度较大,且一旦悬浮窗权限开启失败,上述音频发送方法则无法进行。另外,对于用户而言,需要通过预先设置、在音频播放应用对应的悬浮窗中选择相应音频以及点击播放等操作,步骤繁琐且流程过长,容易导致音频的录制缺失,影响用户体验。综上,相关技术提供的方案容易受到较多因素的影响,例如依赖于设备和系统版本,导致方案的稳定性不高。In the related art, if a user wants to record audio played from an audio playback application on a third-party instant messaging application and send it to a friend, he needs to open the floating window permission of the audio playback application in advance. Due to the many versions of the Android system and the gradual tightening of permissions by the official, and limited by the manufacturer's in-depth customization of the system, affecting the opening of the floating window permissions, it is more difficult to use the control code to guide the user to open the floating window permissions, and once the floating window permissions are opened Failure, the above audio sending method cannot be performed. In addition, for users, it is necessary to pre-set, select the corresponding audio in the floating window corresponding to the audio playback application, and click to play. The steps are cumbersome and the process is too long, which may easily lead to the lack of audio recording and affect the user experience. In summary, the solutions provided by the related technologies are susceptible to many factors, such as depending on the device and system version, resulting in low stability of the solutions.
发明内容Summary of the invention
本申请提供一种音频处理方法、装置、终端和存储介质,使得在通讯应用上可以直接录制播放中的音频,而无需弹出悬浮窗发送音频,操作简单,稳定,可靠性高。The present application provides an audio processing method, device, terminal, and storage medium, so that audio in playback can be directly recorded on a communication application without popping up a floating window to send audio. The operation is simple, stable, and highly reliable.
在一实施例中,本申请实施例提供了一种音频处理方法,包括:In an embodiment, an embodiment of the present application provides an audio processing method, including:
获取音频分享指令,所述音频分享指令用于指示将所述音频分享给通讯应用当前用户的聊天对象;Acquiring an audio sharing instruction, the audio sharing instruction is used to instruct to share the audio to a chat object of the current user of the communication application;
根据所述音频分享指令生成音频播放任务;Generate an audio playback task according to the audio sharing instruction;
检测到所述通讯应用启动录音功能时,执行所述音频播放任务,供所述通信应用录制。When it is detected that the communication application starts the recording function, the audio playback task is executed for the communication application to record.
在一实施例中,本发明实施例提供了一种音频处理方法,包括:In an embodiment, an embodiment of the present invention provides an audio processing method, including:
根据检测到的录音选中操作生成启动录音指令;Generate a recording start instruction based on the detected recording selection operation;
根据启动录音指令启动录音功能,录制播放中的音频。Start the recording function according to the instruction to start recording, and record the audio during playback.
在一实施例中,本申请实施例还提供了一种音频处理装置,包括:In an embodiment, an embodiment of the present application further provides an audio processing device, including:
获取模块,配置为获取音频分享指令,所述音频分享指令用于指示将音频分享给通讯应用当前用户的聊天对象;The acquisition module is configured to acquire an audio sharing instruction, which is used to instruct to share audio to the chat object of the current user of the communication application;
音频播放任务生成模块,配置为根据所述音频分享指令生成音频播放任务;An audio playback task generation module configured to generate an audio playback task according to the audio sharing instruction;
播放模块,配置为检测到所述通讯应用启动录音功能时,执行所述音频播放任务,供所述通信应用录制。The playback module is configured to perform the audio playback task when it detects that the communication application starts the recording function for the communication application to record.
在一实施例中,本申请实施例还提供了一种音频处理系统,包括:语音包应用和通讯应用;In an embodiment, an embodiment of the present application further provides an audio processing system, including: a voice packet application and a communication application;
所述语音包应用用于实现如上述方法;The voice packet application is used to implement the above method;
所述通讯应用用于实现如上述方法。The communication application is used to implement the method as described above.
在一实施例中,本申请实施例还提供了一种终端,所述终端包括:In an embodiment, an embodiment of the present application further provides a terminal, and the terminal includes:
一个或多个处理器;One or more processors;
存储器,配置为存储一个或多个程序,Memory, configured to store one or more programs,
当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现上述方法。When the one or more programs are executed by the one or more processors, the one or more processors implement the above method.
在一实施例中,本申请实施例还提供了一种计算机可读存储介质,存储有计算机程序,该程序被处理装置执行时实现上述方法。In an embodiment, an embodiment of the present application further provides a computer-readable storage medium that stores a computer program, and when the program is executed by a processing device, the above method is implemented.
附图说明BRIEF DESCRIPTION
图1是本申请实施例中的一种音频处理方法的流程图;1 is a flowchart of an audio processing method in an embodiment of the present application;
图2是本申请实施例中的音频选择的界面示意图;2 is a schematic diagram of an interface for audio selection in an embodiment of the present application;
图3是本申请实施例中的选择通讯应用界面示意图;3 is a schematic diagram of an interface for selecting a communication application in an embodiment of the present application;
图4是本申请实施例中的另一种音频处理方法的流程图;4 is a flowchart of another audio processing method in an embodiment of the present application;
图5是本申请实施例中的又一种音频处理方法的流程图;5 is a flowchart of still another audio processing method in an embodiment of the present application;
图6是本申请实施例中的音频焦点机制的抢占的流程图;6 is a flowchart of preemption of an audio focus mechanism in an embodiment of the present application;
图7是本申请实施例中的再一种音频处理方法的流程图;7 is a flowchart of still another audio processing method in an embodiment of the present application;
图8是本申请实施例中的通讯应用录制音频的界面示意图;8 is a schematic diagram of an interface for recording audio by a communication application in an embodiment of the present application;
图9是本申请实施例中的音频处理方法的交互示意图;9 is an interactive schematic diagram of an audio processing method in an embodiment of the present application;
图10是本申请实施例中的任务状态机的工作状态示意图;10 is a schematic diagram of the working state of the task state machine in the embodiment of the present application;
图11是本申请实施例中的一种音频处理装置的结构示意图,11 is a schematic structural diagram of an audio processing device in an embodiment of the present application,
图12是本申请实施例中的另一种音频处理装置的结构示意图12 is a schematic structural diagram of another audio processing device in an embodiment of the present application
图13是本申请实施例中的一种终端的结构示意图。13 is a schematic structural diagram of a terminal in an embodiment of the present application.
具体实施方式detailed description
下面结合附图和实施例对本申请进行说明。此处所描述的实施例仅仅用于解释本申请,而非对本申请的限定。附图中仅示出了与本申请相关的部分而非全部。The application will be described below with reference to the drawings and embodiments. The embodiments described here are only used to explain the present application, not to limit the present application. Only some parts related to this application but not all are shown in the drawings.
实施例一Example one
图1是本申请实施例中的一种音频处理方法的流程图。本实施例可适用于音频分享至通讯应用的情况,本实施例提供的音频处理方法可以由音频处理装置执行,该音频处理装置可以通过软件和/或硬件的方式实现。设定音频处理的装置集成在终端设备中,即音频处理的方法由终端设备来执行。上述终端设备是指具有向计算机输入程序和数据或接收计算机输出处理结果功能的设备。上述终端设备包括笔记本电脑、智能手机、平板电脑和便携式多媒体播放设备等移动终端以及数字电视(television,TV)、台式计算机等固定终端。FIG. 1 is a flowchart of an audio processing method in an embodiment of the present application. This embodiment is applicable to the case where audio is shared to a communication application. The audio processing method provided in this embodiment may be executed by an audio processing device, and the audio processing device may be implemented by software and/or hardware. The device for setting audio processing is integrated in the terminal device, that is, the audio processing method is executed by the terminal device. The above-mentioned terminal device refers to a device having a function of inputting programs and data to a computer or receiving a computer to output a processing result. The above terminal devices include mobile terminals such as notebook computers, smart phones, tablet computers and portable multimedia playback devices, as well as fixed terminals such as digital television (TV) and desktop computers.
如图1所示,本申请实施例提供的音频处理的方法,应用于语音包应用(音频播放应用),所述方法包括S110。As shown in FIG. 1, the audio processing method provided by the embodiment of the present application is applied to a voice packet application (audio playback application), and the method includes S110.
S110、获取音频分享指令,所述音频分享指令用于指示将所述音频分享给通讯应用当前用户的聊天对象。S110: Acquire an audio sharing instruction, where the audio sharing instruction is used to instruct to share the audio with a chat object of a current user of a communication application.
在一实施例中,其中,所述通讯应用为安装在终端设备中非系统本身自带的应用程序,所述通讯应用配置为在启动录音功能的情况下,录制播放中的音频。In an embodiment, wherein the communication application is an application program installed in the terminal device and not provided by the system itself, and the communication application is configured to record audio during playback when the recording function is activated.
在本实施例中,音频分享是指将音频指示至通讯应用,音频分享指令是指用于指示将所述音频分享给通讯应用当前用户的聊天对象的指令。通讯应用是指安装在终端设备中非系统本身自带的应用程序。可选的,通讯应用是指安装在终端设备中可以录制和发送音频的通讯应用。示例性的,通讯应用可以是具备语音包沟通功能的通信应用,例如为Whatsapp、微信、QQ、微博等社交软件或有录制和发送音频功能的游戏软件等。可选的,音频是已经录制完成或者通过服务器下载存储在终端设备中的音频。可选的,音频分享指令为延时指示指令。在一实施例中,延时指示指令是指选中音频后,选中的音频并不会马上播放,而是处于一种待播放的状态,当满足预定阈值或者当通讯应用在启动录音功能的情况下,播放选中的音频。In this embodiment, audio sharing refers to indicating audio to the communication application, and audio sharing instructions refer to instructions for sharing the audio to the chat object of the current user of the communication application. The communication application refers to an application program that is installed in the terminal device and not included in the system itself. Optionally, the communication application refers to a communication application installed in the terminal device and capable of recording and sending audio. Exemplarily, the communication application may be a communication application with a voice packet communication function, such as social software such as Whatsapp, WeChat, QQ, Weibo, or game software with recording and sending audio functions. Optionally, the audio is audio that has been recorded or downloaded in the terminal device through the server. Optionally, the audio sharing instruction is a delay instruction. In one embodiment, the delay instruction indicates that the selected audio will not be played immediately after being selected, but will be in a state to be played when the predetermined threshold is met or when the communication application starts the recording function To play the selected audio.
其中,所述音频播放任务为延时播放任务。延时播放任务是指选中音频后,选中的音频并不会马上播放,而是处于一种待播放的状态,当满足预定阈值或者当通讯应用在启动录音功能的情况下,播放选中的音频。Wherein, the audio playback task is a delayed playback task. Delayed playback task means that the selected audio will not be played immediately after it is selected, but will be in a state to be played. When the predetermined threshold is met or when the communication application starts the recording function, the selected audio is played.
在本实施例中,获取音频分享指令为:根据在所述语音包应用上的音频选中操作以及由此关联的通讯应用选中操作获取所述音频分享指令。In this embodiment, acquiring the audio sharing instruction is: acquiring the audio sharing instruction according to the audio selection operation on the voice packet application and the associated communication application selection operation.
在一实施例中,所述根据在所述语音包应用上的音频选中操作以及由此关联的通讯应用选中操作获取所述音频分享指令,包括:In an embodiment, the acquiring the audio sharing instruction according to the audio selection operation on the voice packet application and the associated communication application selection operation includes:
根据所述音频选中操作确定基于所述语音包应用的语音包详情页面的选中的音频,其中,所述语音包详情页面包括至少一个音频;Determining the selected audio based on the voice package details page of the voice package application according to the audio selection operation, wherein the voice package details page includes at least one audio;
提供选项栏,并接收基于所述选项栏的通讯应用选中操作,其中,所述选项栏包括至少一个通讯应用选择对象。An option bar is provided, and a communication application selection operation based on the option bar is received, wherein the option bar includes at least one communication application selection object.
在一实施例中,图2是本申请实施例中的音频选择的界面示意图,如图2所示,接收用户点击音频选择按钮201的操作,即获取到音频选中操作,将音频选择按钮201对应的音频确定为选中音频。此外,用户还可以点击音频试听按钮203,若接收到用户点击音频试听按钮203操作,则通过终端设备内置的播放器播放音频。用户还可以点击音频收藏按钮203,若接收到用户点击音频收藏按钮202操作,则将音频收藏至语音包应用的收藏夹中。In an embodiment, FIG. 2 is a schematic diagram of an audio selection interface in an embodiment of the present application. As shown in FIG. 2, receiving an operation of clicking an audio selection button 201 by a user, that is, acquiring an audio selection operation, corresponding to the audio selection button 201 Is determined as the selected audio. In addition, the user can also click the audio preview button 203, and if it is received that the user clicks the audio preview button 203, the audio is played through the player built in the terminal device. The user can also click on the audio collection button 203, and if it is received that the user clicks on the audio collection button 202, the audio will be collected into the favorites of the voice package application.
获取到音频选中操作之后,根据用户的点击操作获取通讯应用选中操作。根据音频选中操作和通讯应用选中操作获取音频选中指令。图3是本申请实施例中的选择通讯应用的界面示意图,如图3所示,若获取到用户对通讯应用选择按钮301的点击操作,根据对通讯应用选择按钮的点击操作生成音频选中指令并获取音频选中指令。在一实施例中,通讯应用选择按钮301对应不同通讯应用,若点击通讯应用A对应的通讯应用选择按钮301,则生成并获取通讯应用A对应的音频选中指令,通讯应用A音频选中指令用于指示将音频发送至通讯应用A;若点击通讯应用B对应的通讯应用选择按钮301,则生成并获取通讯应用B对应的音频选中指令,通讯应用B音频选中指令用于指示将音频发送至通讯应用B。本实施例中,仅以通讯应用A和通讯应用B为例进行说明,并不是限定。可以根据需求设计其他通讯应用对应的音频发送按钮301,例如:通讯应用C对应的通讯应用选择按钮301等。After the audio selection operation is acquired, the communication application selection operation is acquired according to the user's click operation. Obtain the audio selection instruction according to the audio selection operation and the communication application selection operation. FIG. 3 is a schematic diagram of an interface for selecting a communication application in an embodiment of the present application. As shown in FIG. 3, if a user’s click operation on the communication application selection button 301 is acquired, an audio selection instruction is generated according to the click operation on the communication application selection button and Get audio selection instructions. In one embodiment, the communication application selection button 301 corresponds to different communication applications. If the communication application selection button 301 corresponding to the communication application A is clicked, an audio selection instruction corresponding to the communication application A is generated and obtained. The audio selection instruction of the communication application A is used to Instruct to send audio to the communication application A; if the communication application selection button 301 corresponding to the communication application B is clicked, an audio selection instruction corresponding to the communication application B is generated and obtained, and the audio selection instruction of the communication application B is used to instruct to send audio to the communication application B. In this embodiment, the communication application A and the communication application B are only used as examples for description, which is not a limitation. The audio sending button 301 corresponding to other communication applications can be designed according to requirements, for example: the communication application selection button 301 corresponding to the communication application C, and so on.
在一实施例中,若获取到所述通讯应用选中操作,则跳转至选中的通讯应用的界面。在一实施例中,在所述跳转至选中的通讯应用的界面之前,检测是否安装选中的通讯应用;若终端安装选中的通讯应用,则跳转至选中的通讯应用的界面。跳转至选中的通讯应用的界面,包括:跳转至所述选中的通讯应用 的聊天对象选择界面。若终备中未安装通讯应用,则提示用户未安装通讯应用,停止执行所述音频播放任务。同时配置提示框,询问用户是否安装通讯应用。在本实施例中,不对检测终端中是否安装通讯应用的方法进行限定,可以根据需求采用任一种方法检测终端中是否安装通讯应用。In an embodiment, if the selected operation of the communication application is acquired, jump to the interface of the selected communication application. In an embodiment, before the jump to the interface of the selected communication application, it is detected whether the selected communication application is installed; if the terminal installs the selected communication application, it jumps to the interface of the selected communication application. Jumping to the interface of the selected communication application includes: jumping to the chat object selection interface of the selected communication application. If the communication application is not installed in the backup, the user is prompted not to install the communication application, and the audio playback task is stopped. At the same time, a prompt box is configured to ask the user whether to install the communication application. In this embodiment, the method for detecting whether the communication application is installed in the terminal is not limited, and any method may be used to detect whether the communication application is installed in the terminal according to requirements.
在一实施例中,在本实施例中,用户点击音频选择按钮201(见图2所示),则将音频选择按钮201对应的音频确定为选中音频,页面根据内置的页面跳转规则跳转至选择通讯应用的界面(见图3所示),使用户可以方便的发送音频。In one embodiment, in this embodiment, the user clicks the audio selection button 201 (see FIG. 2), the audio corresponding to the audio selection button 201 is determined as the selected audio, and the page jumps according to the built-in page jump rules To select the interface of the communication application (see Figure 3), so that users can easily send audio.
S120、根据所述音频分享指令生成音频播放任务。S120. Generate an audio playback task according to the audio sharing instruction.
S130、检测到所述通讯应用启动录音功能时,执行所述音频播放任务,供所述通信应用录制。S130. When it is detected that the communication application starts the recording function, execute the audio playback task for the communication application to record.
在本实施例中,启动录音功能是指获取终端的麦克风或者录音器的使用权限。通讯应用启动录音功能是指通讯应用获得终端中麦克风或者录音器的使用权限。检测到通讯应用启动录音是指检测到通讯应用获得终端中麦克风或者录音器的使用权限。在一实施例中,可以通过启动录音指令指示通讯应用启动录音。在一实施例中,本实施例以通讯应用A录制音频为例进行说明。用户点击通讯应用A对应的音频发送按钮301(见图3所示),生成并获取通讯应用A的音频选中指令,页面根据内置的页面跳转规则跳转至通讯应用A的界面。In this embodiment, starting the recording function refers to obtaining the permission to use the microphone or the recorder of the terminal. When the communication application starts the recording function, it means that the communication application obtains the permission to use the microphone or the recorder in the terminal. Detecting that the communication application starts recording refers to detecting that the communication application obtains permission to use the microphone or recorder in the terminal. In an embodiment, the communication application may be instructed to start recording by starting a recording instruction. In one embodiment, this embodiment uses the communication application A to record audio as an example for description. The user clicks the audio sending button 301 corresponding to the communication application A (see FIG. 3) to generate and obtain the audio selection instruction of the communication application A, and the page jumps to the interface of the communication application A according to the built-in page jumping rules.
在一实施例中,响应于获取到所述通讯应用选中操作,跳转至选中的通讯应用的界面。In an embodiment, in response to acquiring the selected operation of the communication application, jump to the interface of the selected communication application.
在一实施例中,所述跳转至选中的通讯应用的界面,包括:跳转至所述选中的通讯应用的聊天对象选择界面。In an embodiment, the jump to the interface of the selected communication application includes: a jump to the chat object selection interface of the selected communication application.
在一实施例中,在预设时间内未检测到所述通讯应用启动录音功能的情况下,所述音频播放任务停止执行。In an embodiment, if the communication application does not detect that the recording function is started within a preset time, the audio playback task stops executing.
在一实施例中,在预设时间内检测到通讯应用启动录音功能的情况下,则播放音频,以使通讯应用录制播放中的音频。在预设时间内未检测到通讯应用启动录音功能的情况下,停止执行音频播放任务,即不会将选中的音频指示给通讯应用,终端的播放器也不会播放该音频。可选的,预设时间为2分钟。若在2分钟内检测到通讯应用启动录音功能,则播放音频。若2分钟内未检测到通讯应用启动录音功能,则结束音频分享。在本实施例中,将预设时间配置为2分钟,若超过2分钟则停止指示所述选中的音频给所述通讯应用,避免音频长时间占用系统运行内存。In an embodiment, when it is detected that the communication application starts the recording function within a preset time, the audio is played, so that the communication application records the audio during playback. If it is not detected that the communication application starts the recording function within the preset time, the audio playback task is stopped, that is, the selected audio will not be indicated to the communication application, and the player of the terminal will not play the audio. Optionally, the preset time is 2 minutes. If it is detected that the communication application starts the recording function within 2 minutes, the audio is played. If it is not detected that the communication application starts the recording function within 2 minutes, the audio sharing ends. In this embodiment, the preset time is configured to be 2 minutes, and if it exceeds 2 minutes, the instruction of the selected audio to the communication application is stopped to prevent the audio from occupying the system running memory for a long time.
在上述技术方案的基础上,本实施例提供一种可选实例。图4是本申请实施例中的另一种音频处理方法的流程图。如图4所示,音频处理方法包括S401 至S410。Based on the above technical solution, this embodiment provides an optional example. FIG. 4 is a flowchart of another audio processing method in an embodiment of the present application. As shown in FIG. 4, the audio processing method includes S401 to S410.
S401、启动。S401, start.
在本实施例中,本实施中的方法一般由安装在终端设备中的音频处理装置来执行,启动是启动配置有音频处理装置的终端设备,使终端设备处于正常工作状态。In this embodiment, the method in this implementation is generally performed by the audio processing device installed in the terminal device, and the startup is to start the terminal device configured with the audio processing device, so that the terminal device is in a normal working state.
S402、打开语音包详情页面。S402. Open the voice package details page.
启动终端设备之后,通过点击终端中的语音包应用的显示图标,打开语音包详情页面。语音包是指音频处理装置存储的音频数据。详情页面包括语音包的名称和简介。详情页面中包括至少一种语音包。After starting the terminal device, open the voice package details page by clicking the display icon of the voice package application in the terminal. The voice packet refers to the audio data stored by the audio processing device. The details page includes the name and introduction of the voice package. The detail page includes at least one voice package.
S403、选择音频,打开智能发送选项栏。S403. Select audio to open the smart sending option bar.
用户点击音频选择按钮201(见图2所示)的操作,则将音频选择按钮201对应的音频确定为选中音频。页面根据内置的规则打开智能发送选项栏。智能发送选项栏中包括通讯应用选择按钮301(见图3所示)。When the user clicks the audio selection button 201 (see FIG. 2), the audio corresponding to the audio selection button 201 is determined as the selected audio. The page opens the smart sending option bar according to the built-in rules. The smart transmission option bar includes a communication application selection button 301 (see FIG. 3).
S404、点击发送至通讯应用。S404. Click to send to the communication application.
用户点击智能发送选项栏中的通讯应用选择按钮301。通讯应用选择按钮301对应不同通讯应用,若点击通讯应用A对应的通讯应用选择按钮301,则生成并获取通讯应用A音频选中指令,通讯应用A音频选中指令用于指示将音频发送至通讯应用A;若点击通讯应用B对应的通讯应用选择按钮301,则生成并获取通讯应用B音频选中指令,通讯应用B音频选中指令用于指示将音频发送至通讯应用B。The user clicks the communication application selection button 301 in the smart sending option bar. The communication application selection button 301 corresponds to different communication applications. If the communication application selection button 301 corresponding to the communication application A is clicked, the audio selection instruction of the communication application A is generated and obtained, and the audio selection instruction of the communication application A is used to instruct to send audio to the communication application A If the communication application selection button 301 corresponding to the communication application B is clicked, an audio selection instruction of the communication application B is generated and obtained, and the audio selection instruction of the communication application B is used to instruct to send audio to the communication application B.
S405、检测是否安装通讯应用。S405. Detect whether the communication application is installed.
若检测到用户点击音频发送按钮301,则检测终端系统中是否安装通讯应用。若安装通讯应用,则执行S406,若未安装通讯应用,则执行S407。If it is detected that the user clicks the audio sending button 301, it is detected whether the communication application is installed in the terminal system. If the communication application is installed, S406 is executed, and if the communication application is not installed, S407 is executed.
S406、跳转至通讯应用。S406. Jump to the communication application.
在本实施例中,若终端系统中安装通讯应用,则根据内置的页面跳转规则跳转至通讯应用。In this embodiment, if a communication application is installed in the terminal system, it will jump to the communication application according to the built-in page jump rule.
S407、提示用户安装通讯应用。S407. The user is prompted to install the communication application.
在本实施例中,终端系统中未安装通讯应用,则提示用户安装通讯应用,并执行S410,结束发送音频。In this embodiment, if the communication application is not installed in the terminal system, the user is prompted to install the communication application, and execute S410 to end sending audio.
S408、检测预设时间内是否点击录音。S408. Detect whether the recording is clicked within a preset time.
在本实施例中,跳转至通讯应用后,检测用户在预设时间内是否点击录音 按钮。可选的,预设时间为2秒。In this embodiment, after jumping to the communication application, it is detected whether the user clicks the record button within a preset time. Optionally, the preset time is 2 seconds.
在一实施例中,用户在预设时间内点击录音按钮,则执行S409。用户在预设时间内未点击录音按钮,则执行S410。In an embodiment, if the user clicks the record button within a preset time, S409 is executed. If the user does not click the record button within a preset time, S410 is executed.
S409、同步播放选中音频。S409. Play the selected audio synchronously.
若检测到用户在预设时间内点击录音按钮,则通过终端设备的播放器播放选中音频。在一实施例中,通讯应用录制播放的音频并发送至好友。If it is detected that the user clicks the record button within a preset time, the selected audio is played through the player of the terminal device. In one embodiment, the communication application records the played audio and sends it to a friend.
S410、发送结束。S410. The sending ends.
在本实施例中,发送结束是指不论是否将音频发送至通讯应用,此次发送任务结束,不再执行选中音频的发送。In this embodiment, the end of sending means that regardless of whether the audio is sent to the communication application, the sending task ends this time, and the sending of the selected audio is no longer performed.
本实施例中提供的音频处理方法,通过获取音频分享指令,所述音频分享指令用于指示将音频分享给通讯应用当前用户的聊天对象;根据所述音频分享指令生成音频播放任务;检测到所述通讯应用启动录音功能时,执行所述音频播放任务,供所述通信应用录制。即检测到通讯应用启动录音,则直接将音频分享给通讯应用并播放音频,使得通讯应用可以直接录制播放中的音频,而无需弹出悬浮窗发送音频,操作简单,稳定,可靠性高,用户体验好。In the audio processing method provided in this embodiment, by acquiring an audio sharing instruction, the audio sharing instruction is used to instruct to share audio to the chat object of the current user of the communication application; an audio playback task is generated according to the audio sharing instruction; When the communication application starts the recording function, the audio playback task is performed for the communication application to record. That is, it is detected that the communication application starts recording, and the audio is directly shared to the communication application and the audio is played, so that the communication application can directly record the audio during playback without popping up the floating window to send the audio, the operation is simple, stable, high reliability, user experience it is good.
实施例二Example 2
图5是本申请实施例中的又一种音频处理方法的流程图;本实施例可适用于音频分享至通讯应用的情况,本实施例是上述实施例的可选实施例,如图5所示,本实施例的音频处理方法,包括S510至S560。5 is a flowchart of another audio processing method in an embodiment of the present application; this embodiment can be applied to the case of audio sharing to a communication application. This embodiment is an optional embodiment of the above embodiment, as shown in FIG. 5 As shown, the audio processing method of this embodiment includes S510 to S560.
S510、根据音频选中操作和通讯应用选中操作获取音频分享指令。S510. Acquire audio sharing instructions according to the audio selection operation and the communication application selection operation.
在一实施例中,根据在所述语音包应用上的音频选中操作以及由此关联的通讯应用选中操作获取所述音频分享指令。In an embodiment, the audio sharing instruction is obtained according to the audio selection operation on the voice packet application and the associated communication application selection operation.
在本实施例中,接收用户点击音频选择按钮的操作,则将音频选择按钮对应的音频确定为选中音频,接收用户点击通讯应用选择按钮,根据对音频选择按钮和通讯应用选择按钮的点击操作生成音频选中指令并获取音频分享指令。In this embodiment, the receiving user clicks the audio selection button, the audio corresponding to the audio selection button is determined as the selected audio, and the receiving user clicks the communication application selection button, which is generated according to the click operation on the audio selection button and the communication application selection button Audio selection instruction and get audio sharing instruction.
S520、将所述选中的音频的播放数据封装为待执行任务,待执行任务的状态为就绪态。S520. The playback data of the selected audio is packaged as a task to be executed, and the state of the task to be executed is a ready state.
在本实施例中,封装是指将音频播放数据按照一定的格式放到一个文件夹中。常见的音频播放的封装格式有:脉冲编码调制(Pulse Code Modulation,PCM)格式、波形声音文件(WaveFom,WAV)格式、动态影像专家压缩标准音频层面3(Moving Picture Experts Group Audio Layer III,MP3)格式、自适应多速率(Adaptive Multi-Rate,AMR)格式、高级音频编码(Advanced Audio Coding, AAC)格式和核心音频格式(Core Audio Format,CAF)文件等。在本实施例中,不对音频播放的封装格式和编码格式做限定,可以根据终端设备的类型或者运行系统选择合适的音频播放的封装格式和编码格式。待执行任务是指等待播放的任务。就绪态是指若达到触发条件,则待执行任务就会被执行的状态。In this embodiment, encapsulation refers to putting audio playback data in a folder in a certain format. Common audio playback packaging formats are: Pulse Code Modulation (Pulse Code Modulation, PCM) format, Waveform Sound File (WaveFom, WAV) format, motion picture expert compression standard audio level 3 (Moving Pictures Experts Group Audio Layer III, MP3) Format, Adaptive Multi-Rate (AMR) format, Advanced Audio Coding (AAC) format and Core Audio Format (CAF) file, etc. In this embodiment, the packaging format and encoding format of audio playback are not limited, and the appropriate packaging format and encoding format of audio playback may be selected according to the type of terminal device or the operating system. The task to be executed refers to a task waiting to be played. The ready state refers to the state where the task to be executed will be executed if the trigger condition is reached.
在一实施例中,获取到用户对音频发送按钮的点击操作,则将选中的音频的播放数据封装以及发送为待执行任务,待执行任务的状态为就绪态,若达到触发条件,则待执行任务就会被执行。In an embodiment, when the user clicks on the audio sending button, the playback data of the selected audio is packaged and sent as a task to be executed. The status of the task to be executed is the ready state. If the trigger condition is reached, it is to be executed The task will be executed.
S530、请求获取音频焦点并监听音频焦点的状态。S530. Request to obtain audio focus and monitor the state of the audio focus.
在本实施例中,Android是一个多任务环境,系统中可能会有多个应用同时播放音频,终端设备只有一个音频输出,可能会出现多个应用争夺使用这个音频输出。音频焦点是Android系统提供的一个没有优先级的抢占式播放机制,用于协调多个应用如何使用设备的音频输出。为了避免多个应用同时播放音乐,Android系统使用音频焦点机制来进行统一管理,即只有获得了音频焦点的应用才可以播放音乐。In this embodiment, Android is a multi-tasking environment. There may be multiple applications playing audio simultaneously in the system, and the terminal device has only one audio output, and multiple applications may compete for using this audio output. Audio focus is a preemptive playback mechanism provided by the Android system without priority, used to coordinate how multiple applications use the device's audio output. In order to avoid multiple applications playing music at the same time, the Android system uses the audio focus mechanism for unified management, that is, only applications that have obtained audio focus can play music.
在一实施例中,应用程序在开始播放音频文件前,应该请求获得音频焦点,并且同时注册监听音频焦点的丢失通知,即如果音频焦点被系统或其他的应用程序抢占时,应用程序可以做出合适的响应。示例性的,音乐播放器播放歌曲时,其他播放器点击播放的时候,其他播放器请求音频焦点,音乐播放器就会丢失音频焦点,播放暂停。In one embodiment, the application should request to obtain audio focus before starting to play the audio file, and at the same time register to listen for the audio focus loss notification, that is, if the audio focus is preempted by the system or other applications, the application can make Appropriate response. Exemplarily, when a music player plays a song, and when another player clicks to play, the other player requests audio focus, the music player loses the audio focus, and the playback pauses.
音频焦点的类型包括短暂焦点和长久焦点,短暂焦点用来播放一个短暂的音频时使用,例如:播放导航指令。长久焦点用来播放较长一段时间的音频,例如,播放音乐。The types of audio focus include short-term focus and long-term focus. The short-term focus is used to play a short audio, for example: playing navigation instructions. Long-term focus is used to play audio for a longer period of time, for example, to play music.
三种失去音频焦点的类型:永久失去,短暂失去,允许降低Ducking的短暂失去。永久失去音频焦点是指假设另外一个应用开始播放音乐,那么当前应用就有效地将自己停止。在实际场景当中,这意味着停止播放,取消当前应用对音频焦点的监听,允许新的音频播放器可以唯一地监听音频焦点。此时,如果想要恢复自己的音频播放,需要等待某种特定用户行为发生,例如:按下当前应用当中的播放按钮。短暂失去音频焦点是指在短暂失去音频焦点的情况下,暂停当前音频的播放,同时需要准备在重新获取到音频焦点之后恢复播放。允许Ducking的短暂失去音频焦点是指在允许Ducking的短暂失去音频焦点的情况下,音乐播放器正常播放的歌曲会降低音量来凸显短暂的音频声音,既让短暂的声音比较突出,又不至于打断正常的声音,并在重新获得音频焦点之后恢复原来音量。Three types of loss of audio focus: permanent loss, short loss, allowing to reduce Ducking's short loss. Permanently losing audio focus means assuming that another application starts playing music, then the current application effectively stops itself. In actual scenes, this means stopping playback, canceling the current application's monitoring of audio focus, and allowing a new audio player to monitor audio focus uniquely. At this time, if you want to resume your own audio playback, you need to wait for a certain user behavior to occur, for example: press the play button in the current application. Temporarily losing audio focus means that when the audio focus is temporarily lost, the current audio playback is paused, and at the same time, it is necessary to prepare to resume playback after regaining the audio focus. Allowing Ducking to temporarily lose audio focus means that when Ducking is allowed to temporarily lose audio focus, the song normally played by the music player will lower the volume to highlight the short-term audio sound, which makes the short-term sound more prominent and not hit. Cut off the normal sound and restore the original volume after regaining the audio focus.
图6是本申请实施例中的音频焦点机制的抢占的流程图,如图6所示,音频焦点机制抢占的流程包括4个步骤。FIG. 6 is a flowchart of preemption of the audio focus mechanism in the embodiment of the present application. As shown in FIG. 6, the flow of preemption of the audio focus mechanism includes four steps.
S601、应用A申请入栈。栈顶实例,应用C是当前音频焦点的持有者,即应用C获得音频焦点,并且应用C同时注册监听音频焦点的丢失通知。当应用A需要使用音频输出时,向音频管理器发送获取音频焦点的请求。S602、通知应用C音频焦点被抢占。若音频管理器接收到应用A获取音频焦点的请求,则通过应用C注册的回调Callback函数,通知应用C音频焦点被抢占,希望应用C停止使用音频服务。S603、应用A成功入栈。应用A成功入栈,即应用A是当前音频焦点的持有者,应用A获得音频焦点。同时,应用C短暂失去音频焦点,暂停当前音频的播放或者降低音量。S604、丢弃音频焦点。应用A通过调用函数abondAudioFocus()丢弃音频焦点,将应用A的实例从栈中删除。此时,应用C重新获取到焦点恢复音频的播放。S601. Application A applies for stacking. In the top example of the stack, application C is the holder of the current audio focus, that is, application C obtains audio focus, and application C also registers to listen for notification of the loss of audio focus. When application A needs to use audio output, it sends a request to the audio manager to obtain audio focus. S602. Notify the application C that the audio focus is preempted. If the audio manager receives the request of application A to obtain the audio focus, it notifies application C that the audio focus is preempted through the callback callback function registered by application C, and hopes that application C stops using the audio service. S603. Application A is successfully pushed into the stack. Application A is successfully pushed onto the stack, that is, application A is the current audio focus holder, and application A obtains audio focus. At the same time, application C briefly loses audio focus, pauses the current audio playback or lowers the volume. S604: Discard the audio focus. Application A discards the audio focus by calling the function abondAudioFocus(), and deletes the instance of application A from the stack. At this time, application C regains focus to resume audio playback.
在本实施例中,音频处理装置通过使用请求音频焦点函数requestAudioFocus()方法向音频管理器发送获取音频焦点的请求,若请求成功,则音频管理器向音频处理装置返回AUDIOFOCUS_REQUEST_GRANTED常量。若音频处理装置接收到AUDIOFOCUS_REQUEST_GRANTED常量,则表示获取音频焦点。在一实施例中,若请求失败,则音频管理器向音频处理装置返回AUDIOFOCUS_REQUEST_FAILED常量。若音频处理装置接收到AUDIOFOCUS_REQUEST_FAILED常量,则表示获取音频焦点失败。在一实施例中,音频处理装置获取的是长久焦点。In this embodiment, the audio processing device sends a request to obtain audio focus to the audio manager by using the request audio focus function requestAudioFocus() method. If the request is successful, the audio manager returns the AUDIOFOCUS_REQUEST_GRANTED constant to the audio processing device. If the audio processing device receives the AUDIOFOCUS_REQUEST_GRANTED constant, it means that the audio focus is acquired. In one embodiment, if the request fails, the audio manager returns the AUDIOFOCUS_REQUEST_FAILED constant to the audio processing device. If the audio processing device receives the AUDIOFOCUS_REQUEST_FAILED constant, it means that the acquisition of audio focus has failed. In one embodiment, the audio processing device acquires long-term focus.
在本实施例中,音频处理装置获取音频焦点后,加入到AudioFocus栈顶,表示持有音频焦点,并向音频管理器AudioManager注册回调函数OnAudioFocusChangeListener,以便于音频处理装置能及时接收到来自音频管理器的音频焦点状态改变。OnAudioFocusChangeListener为音频焦点监听器。In this embodiment, after the audio processing device obtains the audio focus, it is added to the top of the AudioFocus stack, indicating that it holds the audio focus, and registers the callback function OnAudioFocusChangeListener with the audio manager AudioManager, so that the audio processing device can receive the audio focus in time 'S audio focus state changes. OnAudioFocusChangeListener is the audio focus listener.
在一实施例中,通过音频焦点监听器监听音频焦点的状态,监听器会根据当前音频焦点的变化,调用onAudioFocusChange(int focusChange)函数,onAudioFocusChange有以下四种参数:AUDIOFOCUS_AGIN表示已经完全获得了音频焦点;AUDIOFOCUS_LOSS表示会长时间的失去焦点,请结束相关音频播放工作并做好收尾工作;AUDIOFOCUS_GAIN_TRANSIENT表示会短暂的失去音频焦点,暂停音乐,但不会释放资源,随后可以夺回焦点并继续使用。AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK表示音频焦点会短暂失去,但是可以与新的使用者共同使用音频焦点。In an embodiment, the state of the audio focus is monitored by the audio focus monitor, and the listener will call the onAudioFocusChange(int FocusChange) function according to the change of the current audio focus. onAudioFocusChange has the following four parameters: AUDIOFOCUS_AGIN indicates that the audio focus has been completely obtained ; AUDIOFOCUS_LOSS means that it will lose focus for a long time, please end the relevant audio playback work and do the finishing work; AUDIOFOCUS_GAIN_TRANSIENT means that you will temporarily lose audio focus, pause the music, but will not release resources, and then you can regain focus and continue to use. AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK means that audio focus will be temporarily lost, but it can be used with new users.
若接收到音频焦点监听器发送的AUDIOFOCUS_AGIN常量,则表示音频处理装置已经完全获得了音频焦点,并通过音频焦点监听器 OnAudioFocusChangeListener监听音频焦点的状态变化。If the AUDIOFOCUS_AGIN constant sent by the audio focus listener is received, it means that the audio processing device has completely obtained the audio focus, and monitors the state change of the audio focus through the audio focus listener OnAudioFocusChangeListener.
S540、在音频焦点的状态为被通讯应用抢占的情况下,确定通讯应用启动录音功能。S540. When the state of the audio focus is preempted by the communication application, determine that the communication application starts the recording function.
若检测到通讯应用中点击录音按钮的操作,则通讯应用通过使用requestAudioFocus()方法向音频管理器发送获取音频焦点的请求。若接收到通讯应用的获取音频焦点请求,确定音频焦点的状态为被通讯应用抢占。在一实施例中,通讯应用发送的获取音频焦点的请求为短暂音频焦点的请求,且选择开启“Ducking”,通讯应用采用短暂音频焦点请求并开启“Ducking”,是为了通讯应用获取音频焦点之后,音频处理装置依旧可以播放音频,只是在通讯应用使用音频焦点时,降低播放音量。If the operation of clicking the recording button in the communication application is detected, the communication application sends a request to obtain audio focus to the audio manager by using the requestAudioFocus() method. If a request for acquiring an audio focus from the communication application is received, the state of audio focus is determined to be preempted by the communication application. In an embodiment, the request for acquiring audio focus sent by the communication application is a request for short-term audio focus, and the option to turn on "Ducking", the communication application uses the short-term audio focus request and turns on "Ducking", after the communication application obtains audio focus The audio processing device can still play audio, but only reduces the playback volume when the communication application uses the audio focus.
若音频管理器接收到通讯应用发送的获取音频焦点的请求,则通过音频焦点监听器向音频处理装置发送AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK常量,告知音频处理装置会短暂失去音频焦点,但是可以与通讯应用共同使用音频焦点。If the audio manager receives the request to obtain the audio focus sent by the communication application, it sends the AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK constant to the audio processing device through the audio focus monitor to inform the audio processing device that it will temporarily lose the audio focus, but can use the audio focus together with the communication application.
若接收到音频焦点监听器返回的AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK常量,则表示音频焦点的状态为被通讯应用抢占,通讯应用获取音频焦点的使用权项,确定通讯应用启动录音。If the AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK constant returned by the audio focus monitor is received, it means that the state of the audio focus is preempted by the communication application, the communication application obtains the right to use the audio focus, and determines that the communication application starts recording.
S550、播放音频,以使通讯应用录制播放中的音频。S550. Play audio, so that the communication application records the playing audio.
在本实施例中,若接收到音频焦点监听器返回的AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK常量,则表示音频焦点的状态为被通讯应用抢占,则触发S520中的待执行任务,通过run()方法进行执行态。执行态是指通过终端设备中的播放器播放待执行任务中封装的音频播放的状态,即通过播放器播放选中的音频。In this embodiment, if the AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK constant returned by the audio focus monitor is received, it means that the state of the audio focus is preempted by the communication application, and the task to be executed in S520 is triggered, and the execution state is executed by the run() method. The execution state refers to the state in which the audio packaged in the task to be executed is played through the player in the terminal device, that is, the selected audio is played through the player.
音频焦点的状态为被通讯应用抢占作为待执行任务的触发条件,运行待执行任务。由于通讯应用抢占了音频焦点,那么通讯应用可以启动录音,录制播放中的音频,并在录制完毕之后发送至好友。The state of the audio focus is that it is preempted by the communication application as a trigger condition of the task to be executed, and the task to be executed is run. Since the communication application preempts the audio focus, the communication application can start recording, record the audio during playback, and send it to friends after the recording is completed.
S560、响应于所述音频播放任务执行完毕,停止监听音频焦点的状态。S560. In response to the completion of the audio playback task, stop monitoring the state of audio focus.
在本实施例中,若检测到通讯应用已经结束长按录音按钮,则通过abandonAudioFocus()方法通知音频管理器,通讯应用不再需要音频焦点,并将通讯应用从实例栈中删除。In this embodiment, if it is detected that the communication application has finished long-pressing the recording button, the audio manager is notified through the abandonAudioFocus() method that the communication application no longer needs audio focus and deletes the communication application from the instance stack.
音频播放完毕之后,待执行任务进入终止态。在一实施例中,若通讯应用丢弃音频焦点或者待执行任务进入终止态,则通过abandonAudioFocus()方法通 知音频管理器,音频处理装置不需要音频焦点,并将音频处理装置从实例栈中删除,即停止对音频焦点的监听。任务执行后立即放弃监听音频焦点以防止任务被重复执行,音频被多次播放。After the audio playback is completed, the pending task enters the termination state. In one embodiment, if the communication application discards the audio focus or the task to be executed enters the terminated state, the audio manager is notified through the abandonedAudioFocus() method that the audio processing device does not need the audio focus, and the audio processing device is deleted from the instance stack. That is, stop monitoring the audio focus. Immediately after the task is executed, it will give up monitoring the audio focus to prevent the task from being executed repeatedly, and the audio is played multiple times.
本实施例中提供的方法,通过获取点击操作,点击操作用于选中得音频,封装选中的音频播放数据以及发送为待执行任务,待执行任务的状态为就绪态,请求获取音频焦点并监听音频焦点的状态,在音频焦点的状态为被通讯应用抢占的情况下,确定通讯应用启动录音,将音频发送至通讯应用并播放音频,以使通讯应用录制播放中的音频,音频播放完毕,则停止监听音频焦点的状态。本实施例利用音频焦点AudioFocus机制来实现对通讯应用录音状态的监听,当通讯应用录音时启动扬声器播放音频,从而实现音频的智能发送,而无需弹出悬浮窗发送音频,操作简单,稳定,可靠性高。In the method provided in this embodiment, by acquiring a click operation, the click operation is used to select the audio, encapsulate the selected audio playback data and send it as a task to be executed, the status of the task to be executed is the ready state, request to obtain audio focus and monitor the audio The state of focus. When the state of audio focus is preempted by the communication application, make sure that the communication application starts recording, send the audio to the communication application and play the audio, so that the communication application records the audio in the playback. After the audio playback is completed, it stops Monitor the state of the audio focus. In this embodiment, the audio focus AudioFocus mechanism is used to monitor the recording status of the communication application. When the communication application is recording, the speaker is started to play audio, so as to realize the intelligent transmission of audio without popping up a floating window to send audio. The operation is simple, stable, and reliable. high.
实施例三Example Three
图7是本申请实施例中的再一种音频处理方法的流程图。本实施例可适用于音频发送至通讯应用的情况,本实施例提供的音频处理方法可以由音频处理装置执行,该音频处理装置可以通过软件和/或硬件的方式实现。设定音频处理的装置集成在终端中,即音频处理的方法由终端来执行。上述终端是指具有向计算机输入程序和数据或接收计算机输出处理结果功能的设备。上述终端设备包括笔记本电脑、智能手机、平板电脑和便携式多媒体播放设备等移动终端以及数字TV、台式计算机等固定终端。7 is a flowchart of still another audio processing method in an embodiment of the present application. This embodiment is applicable to the case where audio is sent to a communication application. The audio processing method provided in this embodiment may be executed by an audio processing device, and the audio processing device may be implemented in software and/or hardware. The device for setting audio processing is integrated in the terminal, that is, the audio processing method is executed by the terminal. The above-mentioned terminal refers to a device having a function of inputting programs and data to a computer or receiving a computer to output a processing result. The above terminal devices include mobile terminals such as notebook computers, smart phones, tablet computers and portable multimedia playback devices, and fixed terminals such as digital TVs and desktop computers.
在一实施例中,如图7所示,本申请实施例提供的方法,应用于通讯应用,所述方法包括如下步骤:In an embodiment, as shown in FIG. 7, the method provided in this embodiment of the present application is applied to a communication application. The method includes the following steps:
S710、在启动录音功能的情况下,录制播放中的语音包应用指示的选中的音频。S710. When the recording function is started, record the selected audio indicated by the application of the voice packet during playback.
在一实施例中,本实施例的方法还包括:根据检测到的录音选中操作生成启动录音指令。In an embodiment, the method of this embodiment further includes: generating a recording start instruction according to the detected recording selection operation.
在一实施例中,所述在启动录音功能的情况下,录制播放中的语音包应用指示的选中的音频,包括:根据所述启动录音指令启动录音功能,录制播放中的所述选中的音频。In an embodiment, when the recording function is started, recording the selected audio indicated by the voice packet application during playback includes: starting the recording function according to the start recording instruction, and recording the selected audio during playback .
在本实施例中,检测到用户点击通讯应用中的录音按钮的操作,接收录音选中操作,并根据检测到的录音选中操作生成启动录音指令。In this embodiment, the user's operation of clicking the recording button in the communication application is detected, the recording selection operation is received, and a recording start instruction is generated according to the detected recording selection operation.
在本实施例中,在根据检测到的录音选中操作生成启动录音指令之前,还包括:根据在好友选择界面中的好友选中操作,跳转至选中的好友对应的好友聊天界面。在实施例一中,步骤“若获取到所述通讯应用选中操作,则跳转至 通讯应用的界面”可以包括:“若获取到所述通讯应用选中操作,则跳转至选中的通讯应用的好友选择界面”。根据用户在好友选择界面中的好友选中操作,跳转至选中的好友对应的好友聊天界面。示例性的,在好友选择界面中点击将要发送语音信息的好友A,根据内置的页面跳转规则,跳转至好友A的聊天界面。In this embodiment, before generating a recording start instruction according to the detected recording selection operation, the method further includes: according to the friend selection operation in the friend selection interface, jump to the friend chat interface corresponding to the selected friend. In Embodiment 1, the step "if the selected operation of the communication application is acquired, then jump to the interface of the communication application" may include: "if the selected operation of the communication application is acquired, then jump to the selected communication application's Friend selection interface". According to the user's friend selection operation in the friend selection interface, jump to the friend chat interface corresponding to the selected friend. Exemplarily, click the friend A who will send the voice message in the friend selection interface, and jump to the chat interface of the friend A according to the built-in page jump rule.
在好友聊天界面中,执行点击录音按钮的操作生成启动录音指令。In the friend chat interface, perform the operation of clicking the recording button to generate a recording start instruction.
在本实施例中,启动录音功能是指获取终端的麦克风或者录音器的使用权限。根据到通讯应用生成的启动录音指令之后,通讯应用获取到终端的麦克风或者录音器的使用权限,录制播放中的音频。In this embodiment, starting the recording function refers to obtaining the permission to use the microphone or the recorder of the terminal. According to the start recording instruction generated by the communication application, the communication application obtains the permission to use the microphone or the recorder of the terminal, and records the audio during playback.
示例性的,图8是本申请实施例中的通讯应用录制音频的界面示意图。用户长按通讯应用中的录音按钮801,则检测到通讯应用A启动录音,播放音频,通讯应用A录制播放中的音频。若用户松开通讯应用A中的录音按钮801,则通讯应用A结束录制播放中的音频,并将录制的音频发送至选中的通讯应用A的好友A。Exemplarily, FIG. 8 is a schematic diagram of an interface for a communication application to record audio in an embodiment of the present application. When the user long presses the record button 801 in the communication application, it is detected that the communication application A starts recording and plays audio, and the communication application A records the playing audio. If the user releases the record button 801 in the communication application A, the communication application A finishes recording the audio during playback and sends the recorded audio to the friend A of the selected communication application A.
在一实施例中,所述方法还包括:根据启动录音指令生成获取音频焦点请求。即根据启动指令生成音频焦点请求,抢占音频焦点,获取终端的麦克风或者录音器的使用权限。In an embodiment, the method further includes: generating a request to obtain audio focus according to the instruction to start recording. That is, the audio focus request is generated according to the startup instruction, the audio focus is seized, and the use right of the terminal's microphone or recorder is acquired.
上述实施例提供的方法,通过获取语音包应用指示的选中的音频;在启动录音功能的情况下,录制播放中的所述选中的音频,使得通讯应用可以直接录制播放中的音频,而无需弹出悬浮窗发送音频,操作简单,稳定,可靠性高。The method provided in the above embodiment obtains the selected audio indicated by the voice packet application; when the recording function is activated, the selected audio during recording is recorded, so that the communication application can directly record the audio during playback without popping up The floating window sends audio with simple operation, stability and high reliability.
实施例四Example 4
在上述实施例的基础上,本实施例提供一种可选实例。图9是本申请实施例中的音频处理方法的交互示意图;如图9所示,上述方法的包括S901至S916。Based on the above embodiment, this embodiment provides an optional example. FIG. 9 is an interactive schematic diagram of an audio processing method in an embodiment of the present application; as shown in FIG. 9, the above methods include S901 to S916.
S901、音频处理装置92获取用户对选中音频的点击操作。S901. The audio processing device 92 acquires the user's click operation on the selected audio.
在本实施例中,用户在音频处理应用中,点击音频选择按钮,音频选择按钮对应的音频为选中音频。音频处理装置92获取用户对选中音频的点击操作。In this embodiment, the user clicks the audio selection button in the audio processing application, and the audio corresponding to the audio selection button is the selected audio. The audio processing device 92 acquires the user's click operation on the selected audio.
S902、音频处理装置92封装音频播放数据以及发送为待执行任务,待执行任务的状态为就绪态。S902. The audio processing device 92 encapsulates the audio playback data and sends it as a task to be executed, and the state of the task to be executed is the ready state.
在本实施例中,用户在音频处理应用中点击发送按钮,则音频处理装置92封装音频播放数据以及发送为待执行任务,待执行任务的状态为就绪态。In this embodiment, when the user clicks the send button in the audio processing application, the audio processing device 92 encapsulates the audio playback data and sends it as a task to be executed, and the state of the task to be executed is the ready state.
S903、音频处理装置92使用requestAudioFocus()方法发送获取音频焦点的请求至音频管理器93,注册回调函数OnAudioFocusChangeListener。S903. The audio processing device 92 uses the requestAudioFocus() method to send a request to obtain audio focus to the audio manager 93, and registers a callback function OnAudioFocusChangeListener.
在本实施例中,音频处理装置92使用requestAudioFocus()方法发送获取音频焦点的请求至音频管理器93,并向音频管理器93注册回调函数OnAudioFocusChangeListener。OnAudioFocusChangeListener为音频焦点监听器,用于监听音频焦点的状态。In this embodiment, the audio processing device 92 uses the requestAudioFocus() method to send a request to obtain audio focus to the audio manager 93, and registers the callback function OnAudioFocusChangeListener with the audio manager 93. OnAudioFocusChangeListener is an audio focus listener, used to monitor the state of audio focus.
S904、音频管理器93返回AUDIOFOCUS_REQUEST_GRANTED常量至音频处理装置92。S904. The audio manager 93 returns the AUDIOFOCUS_REQUEST_GRANTED constant to the audio processing device 92.
若音频管理器93返回AUDIOFOCUS_REQUEST_GRANTED常量至音频处理装置92,则表示请求成功。If the audio manager 93 returns the AUDIOFOCUS_REQUEST_GRANTED constant to the audio processing device 92, it means that the request was successful.
S905、音频处理装置92成功获取音频焦点。S905. The audio processing device 92 successfully obtains the audio focus.
音频处理装置92接收到AUDIOFOCUS_REQUEST_GRANTED常量,则成功获取音频焦点。同时,音频焦点监听器实时监听音频焦点的状态。After receiving the AUDIOFOCUS_REQUEST_GRANTED constant, the audio processing device 92 successfully obtains the audio focus. At the same time, the audio focus monitor monitors the state of the audio focus in real time.
S906、通讯应用94检测到用户对音频录制按钮的点击操作。S906. The communication application 94 detects the user's click operation on the audio recording button.
用户点击音频发送按钮之后,页面跳转至通讯应用94的页面。此时用户选择并长按音频录制按钮,若通讯应用94检测到用户对音频录制按钮的长按操作,则执行S907。After the user clicks the audio sending button, the page jumps to the page of the communication application 94. At this time, the user selects and long-presses the audio recording button. If the communication application 94 detects the user's long-pressing operation on the audio recording button, S907 is executed.
S907、通讯应用94使用requestAudioFocus()方法发送获取音频焦点的请求至音频管理器93。S907. The communication application 94 uses the requestAudioFocus() method to send a request to obtain audio focus to the audio manager 93.
若通讯应用94检测到用户对音频录制按钮的长按操作,则通讯应用94使用requestAudioFocus()方法发送获取音频焦点的请求至音频管理器93。通讯应用发送的获取音频焦点的请求为短暂音频焦点的请求,且选择开启“Ducking”,通讯应用采用短暂音频焦点请求并开启“Ducking”。If the communication application 94 detects the user's long press operation on the audio recording button, the communication application 94 uses the requestAudioFocus() method to send a request to obtain the audio focus to the audio manager 93. The request for acquiring audio focus sent by the communication application is a request for short-term audio focus, and the option to turn on "Ducking" is adopted, and the communication application uses the short-term audio focus request and turns on "Ducking".
S908、音频管理器93发送AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK常量至音频处理装置92,音频处理装置92会短暂失去音频焦点。S908. The audio manager 93 sends the AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK constant to the audio processing device 92, and the audio processing device 92 will temporarily lose the audio focus.
音频管理器93通过音频焦点监听器向音频处理装置92发送AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK常量,告知音频处理装置92会短暂失去音频焦点,但是可以与通讯应用93共同使用音频焦点。The audio manager 93 sends the AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK constant to the audio processing device 92 through the audio focus monitor to inform the audio processing device 92 that it will temporarily lose the audio focus, but can use the audio focus together with the communication application 93.
S909、音频管理器93返回AUDIOFOCUS_REQUEST_GRANTED常量至通讯应用94。S909. The audio manager 93 returns the AUDIOFOCUS_REQUEST_GRANTED constant to the communication application 94.
若音频管理器93返回AUDIOFOCUS_REQUEST_GRANTED常量至通讯应用94,则通讯应用94获取音频焦点使用权项。If the audio manager 93 returns the AUDIOFOCUS_REQUEST_GRANTED constant to the communication application 94, the communication application 94 obtains the audio focus usage right item.
S910、音频处理装置92指示音频播放器91尝试播放音频。S910. The audio processing device 92 instructs the audio player 91 to try to play audio.
S911、音频播放器91通过run()方法执行待执行任务。S911. The audio player 91 executes the task to be executed through the run() method.
音频播放器91通过run()方法执行待执行任务,即通过播放器播放选中的音频。在一实施例中,播放的音频可能会降低音量。The audio player 91 executes the task to be executed through the run() method, that is, plays the selected audio through the player. In an embodiment, the audio played may decrease the volume.
S912、音频播放器91将已执行完毕的消息发送至音频处理装置92。S912. The audio player 91 sends the completed message to the audio processing device 92.
音频播放完毕之后,音频播放器91将已执行完毕的消息发送至音频处理装置92。音频播放器91将音频已经播放完毕的消息发送至音频处理装置92。After the audio playback is completed, the audio player 91 sends the completed message to the audio processing device 92. The audio player 91 sends a message to the audio processing device 92 that the audio has been played.
S913、通讯应用94检测到用户取消对音频录制按钮的点击操作。S913. The communication application 94 detects that the user cancels the click operation on the audio recording button.
在本实施例中,音频播放器已执行完毕之后,用户不再长按音频录制按钮。通讯应用94检测到用户取消对音频录制按钮的长按操作。In this embodiment, after the audio player has been executed, the user no longer long presses the audio recording button. The communication application 94 detects that the user cancels the long press operation on the audio recording button.
S914、通讯应用94通过abandonAudioFocus()方法通知音频管理器93释放音频焦点。S914. The communication application 94 notifies the audio manager 93 to release the audio focus through the abandonedAudioFocus() method.
S915、音频处理装置92通过abandonAudioFocus()方法通知音频管理器93释放音频焦点。S915. The audio processing device 92 notifies the audio manager 93 to release the audio focus through the abandonedAudioFocus() method.
S916、音频管理器93释放音频焦点。S916. The audio manager 93 releases the audio focus.
在本实施例中,任务执行后立即放弃监听音频焦点以防止任务被重复执行,音频被多次播放。In this embodiment, the audio focus is abandoned immediately after the task is executed to prevent the task from being repeatedly executed, and the audio is played multiple times.
图10是本申请实施例中的任务状态机的工作状态示意图,如图10所示,任务状态机有4个状态,初始态1010、就绪态1020、执行态1030和终止态1040。10 is a schematic diagram of the working state of the task state machine in the embodiment of the present application. As shown in FIG. 10, the task state machine has four states, an initial state 1010, a ready state 1020, an execution state 1030, and a termination state 1040.
在用户为点击音频按钮,但是未点击音频发送按钮时,音频为初始态1010。用户点击音频发送按钮之后,音频处理装置92封装音频播放数据以及发送为待执行任务,待执行任务的状态为就绪态1020。通过PendingTask#onCreat()方法将封装音频播放数据以及发送为待执行任务。就绪态1020之后,待执行任务分为两种情况。一种情况是通讯应用获取音频焦点使用权项,满足待执行任务的触发条件,则通过PendingTask#run()方法进入执行态1030。一种情况是在预设时间内未检测到通讯应用启动录音,则直接通过PendingTask#time out()方法进行终止态1040。执行态1030之后,若音频播放器已经播放完毕选中音频,则通过PendingTask#onFinish()方法进行终止态1040。终止态1040表示不论待执行任务是否执行,待执行任务都已经结束,不再执行。音频管理器释放音频焦点之后,通过Audio PlayHelper#disposable()方法将任务状态机重置,恢复至初始态1010。When the user clicks the audio button, but does not click the audio send button, the audio is in the initial state 1010. After the user clicks the audio sending button, the audio processing device 92 encapsulates the audio playback data and sends it as a task to be executed, and the state of the task to be executed is the ready state 1020. Through the PendingTask#onCreat() method, the packaged audio playback data is sent to the task to be executed. After the ready state 1020, the task to be executed is divided into two cases. One case is that the communication application obtains the right to use the audio focus to satisfy the trigger condition of the task to be executed, and then enters the execution state 1030 through the PendingTask#run() method. One case is that the communication application does not detect the start of recording within the preset time, and the termination state 1040 is directly performed through the PendingTask#timeout() method. After the execution state 1030, if the audio player has finished playing the selected audio, the termination state 1040 is performed through the PendingTask#onFinish() method. The termination state 1040 indicates that regardless of whether the task to be executed is executed or not, the task to be executed has ended and is no longer executed. After the audio manager releases the audio focus, the task state machine is reset through the AudioPlayHelper#disposable() method to restore the initial state 1010.
本实施例中提供的方法,通过获取点击操作,点击操作用于选中音频,封装音频播放数据以及发送为待执行任务,待执行任务的状态为就绪态,请求获 取音频焦点并监听音频焦点的状态,在音频焦点的状态为被通讯应用抢占的情况下,确定通讯应用启动录音,将音频发送至通讯应用并播放音频,以使通讯应用录制播放中的音频,音频播放完毕,则停止监听音频焦点的状态。本实施例利用AudioFocus机制来实现对通讯应用录音状态的监听,当通讯应用录音时启动扬声器播放音频,从而实现音频的智能发送,而无需弹出悬浮窗发送音频,操作简单,稳定,可靠性高。In the method provided in this embodiment, by acquiring a click operation, the click operation is used to select audio, encapsulate audio playback data, and send as a task to be executed. The status of the task to be executed is a ready state, requesting to obtain audio focus and monitoring the state of audio focus , When the status of the audio focus is preempted by the communication application, make sure that the communication application starts recording, send the audio to the communication application and play the audio, so that the communication application records the audio in the playback. After the audio playback is completed, stop monitoring the audio focus status. This embodiment uses the AudioFocus mechanism to monitor the recording status of the communication application. When the communication application is recording, the speaker is started to play the audio, so that the audio can be intelligently transmitted without popping up the floating window to send the audio. The operation is simple, stable, and highly reliable.
实施例五Example 5
图11是本申请实施例中的一种音频处理装置的结构示意图,本实施例可适用于音频发送至通讯应用的情况,该音频处理装置可以通过软件和/或硬件的方式实现。音频处理装置集成在语音包应用中,设定音频处理的装置集成在终端中,该音频处理装置的结构如下:FIG. 11 is a schematic structural diagram of an audio processing device in an embodiment of the present application. This embodiment is applicable to the case where audio is sent to a communication application. The audio processing device may be implemented in software and/or hardware. The audio processing device is integrated in the voice packet application, and the device for setting audio processing is integrated in the terminal. The structure of the audio processing device is as follows:
获取模块1110,配置为获取音频分享指令,所述音频分享指令用于指示将音频分享给通讯应用当前用户的聊天对象;The obtaining module 1110 is configured to obtain an audio sharing instruction, and the audio sharing instruction is used to instruct to share the audio with the chat object of the current user of the communication application;
音频播放任务生成模块1120,配置为根据所述音频分享指令生成音频播放任务;The audio playback task generation module 1120 is configured to generate an audio playback task according to the audio sharing instruction;
播放模块1130,配置为检测到所述通讯应用启动录音功能时,执行所述音频播放任务,供所述通信应用录制。The playback module 1130 is configured to execute the audio playback task when the communication application starts the recording function for recording by the communication application.
本实施例中提供的音频处理装置,通过获取音频分享指令,所述音频分享指令用于指示将音频分享给通讯应用当前用户的聊天对象;根据所述音频分享指令生成音频播放任务;检测到所述通讯应用启动录音功能时,执行所述音频播放任务,供所述通信应用录制。即检测到通讯应用启动录音,则直接播放音频,使得通讯应用可以直接录制播放中的音频,而无需弹出悬浮窗发送音频,操作简单,稳定,可靠性高。The audio processing device provided in this embodiment obtains an audio sharing instruction, which is used to instruct to share audio to the chat object of the current user of the communication application; an audio playback task is generated according to the audio sharing instruction; When the communication application starts the recording function, the audio playback task is performed for the communication application to record. That is, it is detected that the communication application starts recording, and the audio is played directly, so that the communication application can directly record the audio during playback without popping up a floating window to send the audio. The operation is simple, stable, and highly reliable.
本申请实施例所提供的装置可执行本申请任意实施例所提供的方法,具备执行方法相应的功能模块和效果。The device provided by the embodiment of the present application can execute the method provided by any embodiment of the present application, and has the functional modules and effects corresponding to the execution method.
实施例六Example Six
图12是本申请实施例中的另一种音频处理装置的结构示意图,本实施例可适用于音频发送至通讯应用的情况,该音频处理装置可以通过软件和/或硬件的方式实现。音频处理装置集成在通讯应用中,设定音频处理的装置集成在终端中,该音频处理装置的结构如下:FIG. 12 is a schematic structural diagram of another audio processing device in an embodiment of the present application. This embodiment is applicable to the case where audio is transmitted to a communication application. The audio processing device may be implemented in software and/or hardware. The audio processing device is integrated in the communication application, and the device for setting audio processing is integrated in the terminal. The structure of the audio processing device is as follows:
录制模块1220,配置为在启动录音功能的情况下,录制播放中的语音包应 用指示的选中的音频。The recording module 1220 is configured to record the selected audio of the voice packet application instructed when the recording function is activated.
上述实施例提供的音频处理装置,通过在启动录音功能的情况下,录制播放中的选中的音频。使得通讯应用可以直接录制播放中的音频,而无需弹出悬浮窗发送音频,操作简单,稳定,可靠性高。The audio processing device provided in the above embodiment records the selected audio during playback when the recording function is activated. The communication application can directly record the audio during playback without popping up a floating window to send the audio. The operation is simple, stable and highly reliable.
本申请实施例所提供的装置可执行本申请任意实施例所提供的方法,具备执行方法相应的功能模块和效果。The device provided by the embodiment of the present application can execute the method provided by any embodiment of the present application, and has the functional modules and effects corresponding to the execution method.
实施例七Example 7
在上述实施例的基础上,本实施例提供了一种音频处理系统,包括:语音包应用和通讯应用。Based on the above embodiments, this embodiment provides an audio processing system, including: a voice packet application and a communication application.
所述语音包应用用于实现上述实施例中提供的所述的音频处理方法;所述音频处理方法包括:The voice packet application is used to implement the audio processing method provided in the foregoing embodiment; the audio processing method includes:
获取音频分享指令,所述音频分享指令用于指示将音频分享给通讯应用当前用户的聊天对象;Acquiring an audio sharing instruction, the audio sharing instruction is used to instruct to share the audio with the chat object of the current user of the communication application;
根据所述音频分享指令生成音频播放任务;Generate an audio playback task according to the audio sharing instruction;
检测到所述通讯应用启动录音功能时,执行所述音频播放任务,供所述通信应用录制。When it is detected that the communication application starts the recording function, the audio playback task is executed for the communication application to record.
本实施例中提供的语音包应用,通过获取音频分享指令,所述音频分享指令用于指示将音频分享给通讯应用当前用户的聊天对象;根据所述音频分享指令生成音频播放任务;检测到所述通讯应用启动录音功能时,执行所述音频播放任务,供所述通信应用录制。即检测到通讯应用启动录音,则直接将音频分享至通讯应用并播放音频,使得通讯应用可以直接录制播放中的音频,而无需弹出悬浮窗发送音频,操作简单,稳定,可靠性高。In the voice package application provided in this embodiment, by acquiring an audio sharing instruction, the audio sharing instruction is used to instruct to share audio to the chat object of the current user of the communication application; an audio playback task is generated according to the audio sharing instruction; When the communication application starts the recording function, the audio playback task is performed for the communication application to record. That is, it is detected that the communication application starts recording, and the audio is directly shared to the communication application and the audio is played, so that the communication application can directly record the audio during playback without popping up the floating window to send the audio.
在一实施例中,所述通讯应用用于实现上述实施例中提供的所述的音频处理方法。所述音频处理方法包括:In an embodiment, the communication application is used to implement the audio processing method provided in the foregoing embodiment. The audio processing method includes:
在启动录音功能的情况下,录制播放中的语音包应用指示的选中的音频。When the recording function is activated, the selected audio indicated by the voice packet application during recording is played.
上述实施例提供的通讯应用,通过在启动录音功能的情况下,录制播放中的语音包应用指示的选中的音频。使得通讯应用可以直接录制播放中的音频,而无需弹出悬浮窗发送音频,操作简单,稳定,可靠性高。The communication application provided in the above embodiment records the selected audio indicated by the voice packet application during playback when the recording function is activated. The communication application can directly record the audio during playback without popping up a floating window to send the audio. The operation is simple, stable and highly reliable.
本申请实施例所提供的音频处理系统可执行本申请任意实施例所提供的音频处理方法,具备执行方法相应的功能模块和效果。The audio processing system provided by the embodiment of the present application can execute the audio processing method provided by any embodiment of the present application, and has the functional modules and effects corresponding to the execution method.
实施例八Example 8
图13是本申请实施例中的一种终端的结构示意图,如图13所示,该终端包括处理器1310、存储器1320、输入装置1330和输出装置1340;终端中处理器1310的数量可以是一个或多个,图13中以一个处理器1310为例;终端中的处理器1310、存储器1320、输入装置1330和输出装置1340可以通过总线或其他方式连接,图13中以通过总线连接为例。13 is a schematic structural diagram of a terminal in an embodiment of the present application. As shown in FIG. 13, the terminal includes a processor 1310, a memory 1320, an input device 1330, and an output device 1340; the number of processors 1310 in the terminal may be one One or more, one processor 1310 is taken as an example in FIG. 13; the processor 1310, the memory 1320, the input device 1330, and the output device 1340 in the terminal may be connected by a bus or other means, and FIG. 13 is taken as an example of connecting by a bus.
处理器1310通过运行存储在存储器1320中的软件程序、指令以及模块,从而执行终端的多种功能应用以及数据处理,即实现上述的音频处理方法。The processor 1310 runs the software programs, instructions, and modules stored in the memory 1320, thereby executing various functional applications and data processing of the terminal, that is, implementing the above-mentioned audio processing method.
在一实施例中,本实施例中在执行语音包应用时,处理器1310通过运行存储在系统存储器1320中的程序,从而执行多种功能应用以及数据处理,例如实现本申请实施例所提供的方法,该方法包括:In an embodiment, when the voice packet application is executed in this embodiment, the processor 1310 executes a variety of functional applications and data processing by running a program stored in the system memory 1320, for example, to implement the The method includes:
获取音频分享指令,所述音频分享指令用于指示将音频分享给通讯应用当前用户的聊天对象;Acquiring an audio sharing instruction, the audio sharing instruction is used to instruct to share audio with a chat object of a current user of the communication application;
根据所述音频分享指令生成音频播放任务;Generate an audio playback task according to the audio sharing instruction;
检测到所述通讯应用启动录音功能时,执行所述音频播放任务,供所述通信应用录制。When it is detected that the communication application starts the recording function, the audio playback task is executed for the communication application to record.
处理器1310还可以实现本申请任意实施例所提供的的方法。该终端的硬件结构以及功能可参见实施例八的内容解释。The processor 1310 may also implement the method provided by any embodiment of the present application. For the hardware structure and function of the terminal, please refer to the explanation of the content of the eighth embodiment.
在一实施例中,本实施例中在执行通讯应用时,处理器1310通过运行存储在系统存储器1320中的程序,从而执行多种功能应用以及数据处理,例如实现本申请实施例所提供的音频处理方法,该方法包括:In an embodiment, when executing a communication application in this embodiment, the processor 1310 runs a program stored in the system memory 1320 to execute various functional applications and data processing, for example, to implement the audio provided by the embodiments of the present application Treatment method, the method includes:
在启动录音功能的情况下,录制播放中的语音包应用指示的选中的音频。When the recording function is activated, the selected audio indicated by the voice packet application during recording is played.
处理器1310还可以实现本申请任意实施例所提供的方法。该终端的硬件结构以及功能可参见实施例八的内容解释。The processor 1310 may also implement the method provided by any embodiment of the present application. For the hardware structure and function of the terminal, please refer to the explanation of the content of the eighth embodiment.
实施例九Example 9
本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,该程序被处理装置执行时实现音频处理方法,所述方法应用于安装语音包应用的终端,该方法包括:Embodiments of the present application also provide a computer-readable storage medium that stores a computer program on the computer-readable storage medium. When the program is executed by a processing device, an audio processing method is implemented. The method is applied to a terminal that installs a voice package application. , The method includes:
获取音频分享指令,所述音频分享指令用于指示将音频分享给通讯应用当前用户的聊天对象;Acquiring an audio sharing instruction, the audio sharing instruction is used to instruct to share the audio with the chat object of the current user of the communication application;
根据所述音频分享指令生成音频播放任务;Generate an audio playback task according to the audio sharing instruction;
检测到所述通讯应用启动录音功能时,执行所述音频播放任务,供所述通信应用录制。When it is detected that the communication application starts the recording function, the audio playback task is executed for the communication application to record.
本申请实施例所提供的一种包含计算机可执行指令的存储介质,其计算机可执行指令不限于如上所述的方法操作,还可以执行本申请任意实施例所提供的方法中。A storage medium containing computer-executable instructions provided by an embodiment of the present application is not limited to the method operations described above, and can also execute the method provided by any embodiment of the present application.
本申请实施例八还提供一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行一种音频处理方法,所述方法应用于安装通讯应用的终端,该方法包括:Embodiment 8 of the present application further provides a storage medium containing computer-executable instructions, which are used to execute an audio processing method when executed by a computer processor, and the method is applied to a terminal where a communication application is installed , The method includes:
在启动录音功能的情况下,录制播放中的语音包应用指示的选中的音频。When the recording function is activated, the selected audio indicated by the voice packet application during recording is played.
本申请实施例所提供的一种包含计算机可执行指令的存储介质,其计算机可执行指令不限于如上所述的方法操作,还可以执行本申请任意实施例所提供的方法。A storage medium containing computer-executable instructions provided by an embodiment of the present application is not limited to the method operations described above, and can also execute the method provided by any embodiment of the present application.

Claims (14)

  1. 一种音频处理方法,所述方法包括:An audio processing method, the method includes:
    获取音频分享指令,所述音频分享指令用于指示将音频分享给通讯应用当前用户的聊天对象;Acquiring an audio sharing instruction, the audio sharing instruction is used to instruct to share the audio with the chat object of the current user of the communication application;
    根据所述音频分享指令生成音频播放任务;Generate an audio playback task according to the audio sharing instruction;
    检测到所述通讯应用启动录音功能时,执行所述音频播放任务,供所述通信应用录制。When it is detected that the communication application starts the recording function, the audio playback task is executed for the communication application to record.
  2. 根据权利要求1所述的方法,其中,所述方法应用于语音包应用,所述获取音频分享指令,包括:The method according to claim 1, wherein the method is applied to a voice packet application, and the acquiring audio sharing instruction includes:
    根据在所述语音包应用上的音频选中操作以及由此关联的通讯应用选中操作获取所述音频分享指令。Acquiring the audio sharing instruction according to the audio selection operation on the voice packet application and the associated communication application selection operation.
  3. 根据权利要求2所述的方法,其中,所述根据在所述语音包应用上的音频选中操作以及由此关联的通讯应用选中操作获取所述音频分享指令,包括:The method according to claim 2, wherein the acquiring the audio sharing instruction according to the audio selection operation on the voice packet application and the communication application selection operation associated therewith includes:
    根据所述音频选中操作确定基于所述语音包应用的语音包详情页面的选中的音频,其中,所述语音包详情页面包括至少一个音频;Determining the selected audio based on the voice package details page of the voice package application according to the audio selection operation, wherein the voice package details page includes at least one audio;
    提供选项栏,并接收基于所述选项栏的通讯应用选中操作,其中,所述选项栏包括至少一个通讯应用选择对象。An option bar is provided, and a communication application selection operation based on the option bar is received, wherein the option bar includes at least one communication application selection object.
  4. 根据权利要求1所述的方法,其中,所述音频播放任务为延时播放任务。The method according to claim 1, wherein the audio playback task is a delayed playback task.
  5. 根据权利要求2或3所述的方法,还包括:The method according to claim 2 or 3, further comprising:
    响应于获取到所述通讯应用选中操作,跳转至选中的通讯应用的界面。In response to acquiring the selected operation of the communication application, jump to the interface of the selected communication application.
  6. 根据权利要求5所述的方法,在所述跳转至选中的通讯应用的界面之前,还包括:The method according to claim 5, before the jump to the interface of the selected communication application, further comprising:
    检测所述选中的通讯应用是否已安装;Detect whether the selected communication application has been installed;
    所述跳转至选中的通讯应用的界面,包括:The interface for jumping to the selected communication application includes:
    响应于安装所述选中的通讯应用,跳转至所述选中的通讯应用的界面。In response to installing the selected communication application, jump to the interface of the selected communication application.
  7. 根据权利要求5或6所述的方法,其中,所述跳转至选中的通讯应用的界面,包括:跳转至所述选中的通讯应用的聊天对象选择界面。The method according to claim 5 or 6, wherein the jumping to the interface of the selected communication application comprises: jumping to a chat object selection interface of the selected communication application.
  8. 根据权利要求1所述的方法,还包括:The method of claim 1, further comprising:
    在预设时间内未检测到所述通讯应用启动录音功能的情况下,所述音频播放任务停止执行。When it is not detected that the communication application starts the recording function within a preset time, the audio playback task stops execution.
  9. 根据权利要求1所述的方法,其中,所述检测到所述通讯应用启动录音 功能,包括:The method according to claim 1, wherein the detecting that the communication application starts the recording function includes:
    请求获取音频焦点并监听所述音频焦点的状态;Request to obtain audio focus and monitor the state of the audio focus;
    在所述音频焦点的状态为被所述通讯应用抢占的情况下,确定所述通讯应用启动录音功能。When the state of the audio focus is preempted by the communication application, it is determined that the communication application starts the recording function.
  10. 根据权利要求9所述的方法,其中,所述音频焦点的状态为被所述通讯应用抢占,包括:The method according to claim 9, wherein the state of the audio focus being preempted by the communication application includes:
    响应于接收到所述通讯应用的获取音频焦点请求,确定所述音频焦点的状态为被所述通讯应用抢占。In response to receiving the audio focus acquisition request of the communication application, it is determined that the state of the audio focus is preempted by the communication application.
  11. 根据权利要求9或10任一项所述的方法,还包括:The method according to any one of claims 9 or 10, further comprising:
    响应于所述音频播放任务执行完毕,则停止监听所述音频焦点的状态。In response to the completion of the execution of the audio playback task, stop monitoring the state of the audio focus.
  12. 一种音频处理装置,包括:An audio processing device, including:
    获取模块,配置为获取音频分享指令,所述音频分享指令用于指示将音频分享给通讯应用当前用户的聊天对象;The acquisition module is configured to acquire an audio sharing instruction, which is used to instruct to share audio to the chat object of the current user of the communication application;
    音频播放任务生成模块,配置为根据所述音频分享指令生成音频播放任务;An audio playback task generation module configured to generate an audio playback task according to the audio sharing instruction;
    播放模块,配置为检测到所述通讯应用启动录音功能时,执行所述音频播放任务,供所述通信应用录制。The playback module is configured to perform the audio playback task when it detects that the communication application starts the recording function for the communication application to record.
  13. 一种终端,包括:A terminal, including:
    一个或多个处理器;One or more processors;
    存储器,配置为存储一个或多个程序,Memory, configured to store one or more programs,
    所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-11中任一项所述的方法。The one or more programs are executed by the one or more processors, so that the one or more processors implement the method according to any one of claims 1-11.
  14. 一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理装置执行时实现如权利要求1-11任一项所述的方法。A computer-readable storage medium storing a computer program on the computer-readable storage medium, the computer program being executed by a processing device to implement the method according to any one of claims 1-11.
PCT/CN2019/128958 2018-12-28 2019-12-27 Audio processing method, apparatus, terminal, and storage medium WO2020135655A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811629805.7A CN111381798B (en) 2018-12-28 2018-12-28 Audio processing method, device, terminal and storage medium
CN201811629805.7 2018-12-28

Publications (1)

Publication Number Publication Date
WO2020135655A1 true WO2020135655A1 (en) 2020-07-02

Family

ID=71126673

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/128958 WO2020135655A1 (en) 2018-12-28 2019-12-27 Audio processing method, apparatus, terminal, and storage medium

Country Status (2)

Country Link
CN (1) CN111381798B (en)
WO (1) WO2020135655A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113241097A (en) * 2021-04-26 2021-08-10 维沃移动通信(杭州)有限公司 Recording method, recording device, electronic equipment and readable storage medium
CN113794968A (en) * 2021-09-14 2021-12-14 合众新能源汽车有限公司 Arbitration method and device for vehicle-mounted audio focus
CN116991357A (en) * 2023-06-30 2023-11-03 荣耀终端有限公司 Audio focus control method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090049479A1 (en) * 2007-08-16 2009-02-19 The Directv Group, Inc. User interfaces to present shared media
CN102055683A (en) * 2009-10-30 2011-05-11 腾讯科技(深圳)有限公司 Method, device and system for sharing music data
CN103023752A (en) * 2012-11-30 2013-04-03 上海量明科技发展有限公司 Method, client-side and system for pre-installing player in instant messaging interactive interface
CN109065049A (en) * 2018-09-13 2018-12-21 苏州思必驰信息科技有限公司 Social sharing method and system, the intelligent terminal of intelligent terminal based on interactive voice

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW536686B (en) * 2000-07-12 2003-06-11 Mitac Technology Corp Method for executing a fly-shuttle-like function with a multimedia program
CN101075983A (en) * 2006-12-15 2007-11-21 腾讯科技(深圳)有限公司 Instant speech telecommunication terminal, server, system and instant speech telecommunication method
US8294015B2 (en) * 2008-06-20 2012-10-23 Randy Lawrence Canis Method and system for utilizing a gaming instrument controller
CN101505333A (en) * 2008-12-18 2009-08-12 上海闻泰电子科技有限公司 Mobile terminal having direct recording function and direct recording method thereof
CN105827825A (en) * 2016-02-29 2016-08-03 维沃移动通信有限公司 Audio data processing method and mobile terminal
CN106157970B (en) * 2016-06-22 2020-12-04 上海麦克风文化传媒有限公司 Audio identification method and terminal
CN107799138B (en) * 2017-11-22 2020-12-15 出门问问信息科技有限公司 Audio recording method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090049479A1 (en) * 2007-08-16 2009-02-19 The Directv Group, Inc. User interfaces to present shared media
CN102055683A (en) * 2009-10-30 2011-05-11 腾讯科技(深圳)有限公司 Method, device and system for sharing music data
CN103023752A (en) * 2012-11-30 2013-04-03 上海量明科技发展有限公司 Method, client-side and system for pre-installing player in instant messaging interactive interface
CN109065049A (en) * 2018-09-13 2018-12-21 苏州思必驰信息科技有限公司 Social sharing method and system, the intelligent terminal of intelligent terminal based on interactive voice

Also Published As

Publication number Publication date
CN111381798B (en) 2021-05-14
CN111381798A (en) 2020-07-07

Similar Documents

Publication Publication Date Title
US11935535B2 (en) Implementations for voice assistant on devices
WO2020135655A1 (en) Audio processing method, apparatus, terminal, and storage medium
WO2015062435A1 (en) Method and device for adjusting video playback interface
US20140115479A1 (en) Audio Management Method and Apparatus
CN107948672B (en) Method and system for storing video data, server and wearable device
US20220311859A1 (en) Do-not-disturb method and terminal
WO2017166607A1 (en) Earphone-based sound recording control method and apparatus, electronic device, and storage medium
CN105812845B (en) A kind of media resource method for pushing, system and the media player based on android system
WO2013107176A1 (en) Concurrent management method and apparatus for multimedia applications
CN108391160A (en) A kind of screenshotss method, system and set-top box
CN111901695B (en) Video content interception method, device and equipment and computer storage medium
WO2014153963A1 (en) Methods and systems for playing video on multiple terminals
CN110418181B (en) Service processing method and device for smart television, smart device and storage medium
CN104615432B (en) Splash screen information processing method and client
US11042587B2 (en) Performing behavior analysis on audio track data to obtain a name of an application
CN105893020A (en) Screen recording starting method, screen recording starting device and mobile terminal
GB2603228A (en) Adding audio content to digital works
TWI630543B (en) An electronic device and method for replaying voice
CN106557398B (en) Information reporting method and device
WO2017161839A1 (en) Application operation method in mobile terminal and mobile terminal
US11287959B2 (en) Method for implementing theme
WO2015070760A1 (en) Data resource transmission method and apparatus
US20230297324A1 (en) Audio Control Method, System, and Electronic Device
CN117812379A (en) Display equipment and media asset playing method
CN113225495A (en) Method and device for eliminating video playing noise

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

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

Country of ref document: EP

Kind code of ref document: A1