Movatterモバイル変換


[0]ホーム

URL:


CN115209298A - Audio playing method, device, earphone and storage medium - Google Patents

Audio playing method, device, earphone and storage medium
Download PDF

Info

Publication number
CN115209298A
CN115209298ACN202210819198.0ACN202210819198ACN115209298ACN 115209298 ACN115209298 ACN 115209298ACN 202210819198 ACN202210819198 ACN 202210819198ACN 115209298 ACN115209298 ACN 115209298A
Authority
CN
China
Prior art keywords
ambient sound
working state
ambient
sound
earphone
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210819198.0A
Other languages
Chinese (zh)
Inventor
朱文波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp LtdfiledCriticalGuangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202210819198.0ApriorityCriticalpatent/CN115209298A/en
Publication of CN115209298ApublicationCriticalpatent/CN115209298A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

Translated fromChinese

本申请实施例公开了一种音频播放方法、装置、耳机及存储介质,属于音频处理技术领域。该方法包括:在第一工作状态下,对环境音进行缓存,其中,处于第一工作状态的耳机不对环境音进行主动透传;对缓存的环境音进行识别;在识别出环境音中包含有效环境音的情况下,将第一工作状态调整为第二工作状态,有效环境音指当前环境中具有收听需求的音频,第二工作状态不同于第一工作状态;在第二工作状态下,基于环境音进行环境音播放。采用本申请实施例提供的方案,能够使用户在享受耳机降噪的同时又能够及时对一些有效信息做出反应的同时,减小了耳机的功耗。

Figure 202210819198

The embodiments of the present application disclose an audio playback method, a device, an earphone and a storage medium, which belong to the technical field of audio processing. The method includes: in a first working state, buffering the ambient sound, wherein the earphone in the first working state does not actively transparently transmit the ambient sound; identifying the buffered ambient sound; In the case of ambient sound, the first working state is adjusted to the second working state, the effective ambient sound refers to the audio with listening needs in the current environment, and the second working state is different from the first working state; in the second working state, based on Ambient sound for ambient sound playback. With the solution provided by the embodiments of the present application, while enjoying noise reduction of the earphone, the user can respond to some valid information in time, and at the same time, the power consumption of the earphone can be reduced.

Figure 202210819198

Description

Translated fromChinese
音频播放方法、装置、耳机及存储介质Audio playback method, device, earphone and storage medium

技术领域technical field

本申请实施例涉及音频处理技术领域,特别涉及一种音频播放方法、装置、耳机及存储介质。The embodiments of the present application relate to the technical field of audio processing, and in particular, to an audio playback method, a device, an earphone, and a storage medium.

背景技术Background technique

随着生活水平的提高,耳机已成为人们必不可少的生活用品。在机场、地铁、餐厅等嘈杂环境中,耳机的降噪功能能够最大限度消除外界噪音的干扰。With the improvement of living standards, headphones have become an indispensable daily necessities for people. In noisy environments such as airports, subways, restaurants, etc., the noise reduction function of the headphones can minimize the interference of external noise.

相关技术中,耳机的降噪方式主要分为被动降噪与主动降噪,被动式降噪耳机主要通过包围耳朵形成封闭空间,或者采用隔音材料来阻挡外界噪声,主动式降噪耳机主要通过在声音信号中加入反向的噪音信号来抵消外界的噪声。In the related art, the noise reduction methods of headphones are mainly divided into passive noise reduction and active noise reduction. Passive noise reduction headphones mainly form a closed space by surrounding the ears, or use sound insulation materials to block external noise. An inverse noise signal is added to the signal to cancel out the external noise.

然而,相关技术中的耳机一直工作在降噪状态,导致用户如果戴上耳机就无法听到外界的声音,对于一些有效信息无法及时做出反应,引起人们的不便。However, the earphones in the related art have been working in a noise reduction state, so that if the user wears the earphones, he cannot hear the sound of the outside world, and cannot respond to some valid information in time, causing inconvenience to people.

发明内容SUMMARY OF THE INVENTION

本申请实施例提供了一种音频播放方法、装置、耳机及存储介质。所述技术方案如下:Embodiments of the present application provide an audio playback method, device, earphone, and storage medium. The technical solution is as follows:

一方面,本申请实施例提供了一种音频播放方法,所述方法用于耳机,所述方法包括:On the one hand, an embodiment of the present application provides an audio playback method, the method is used for headphones, and the method includes:

在第一工作状态下,对环境音进行缓存,其中,处于所述第一工作状态的耳机不对环境音进行主动透传;In the first working state, the ambient sound is buffered, wherein the earphone in the first working state does not actively transparently transmit the ambient sound;

对缓存的所述环境音进行识别;Identifying the buffered ambient sound;

在识别出所述环境音中包含有效环境音的情况下,将所述第一工作状态调整为第二工作状态,所述有效环境音指当前环境中具有收听需求的音频,所述第二工作状态不同于所述第一工作状态;In the case of identifying that the ambient sound contains valid ambient sounds, the first working state is adjusted to a second working state, the effective ambient sound refers to the audio that has listening needs in the current environment, and the second working state is the state is different from the first working state;

在所述第二工作状态下,基于所述环境音进行环境音播放。In the second working state, ambient sound playback is performed based on the ambient sound.

另一方面,本申请实施例提供了一种音频播放装置,所述装置用于耳机,所述装置包括:On the other hand, an embodiment of the present application provides an audio playback device, the device is used for earphones, and the device includes:

缓存模块,用于在第一工作状态下,对环境音进行缓存,其中,处于所述第一工作状态的耳机不对环境音进行主动透传;a buffering module, configured to buffer the ambient sound in a first working state, wherein the earphone in the first working state does not actively transparently transmit the ambient sound;

识别模块,用于对缓存的所述环境音进行识别;an identification module for identifying the buffered ambient sound;

调整模块,用于在识别出所述环境音中包含有效环境音的情况下,将所述第一工作状态调整为第二工作状态,所述有效环境音指当前环境中具有收听需求的音频,所述第二工作状态不同于所述第一工作状态;an adjustment module, configured to adjust the first working state to a second working state in the case of identifying that the ambient sound contains valid ambient sounds, the effective ambient sounds refer to audio that has listening needs in the current environment, the second working state is different from the first working state;

播放模块,用于在所述第二工作状态下,基于所述环境音进行环境音播放。A playing module is configured to play ambient sound based on the ambient sound in the second working state.

另一方面,本申请实施例提供了一种耳机,所述耳机包括处理器和存储器;所述存储器中存储有至少一段程序,所述至少一段程序由所述处理器加载并执行以实现如上述方面所述的音频播放方法。On the other hand, an embodiment of the present application provides an earphone, the earphone includes a processor and a memory; the memory stores at least one program, and the at least one program is loaded and executed by the processor to achieve the above The audio playback method described in the aspect.

另一方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有至少一段程序,所述至少一段程序由处理器加载并执行以实现如上述方面所述的音频播放方法。On the other hand, an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores at least one piece of program, and the at least one piece of program is loaded and executed by a processor to implement the above aspect Audio playback method.

另一方面,本申请实施例提供了一种计算机程序产品,该计算机程序产品包括计算机指令,该计算机指令存储在计算机可读存储介质中;耳机的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该耳机执行上述方面提供的音频播放方法。On the other hand, an embodiment of the present application provides a computer program product, the computer program product includes computer instructions, and the computer instructions are stored in a computer-readable storage medium; the processor of the headset reads the computer from the computer-readable storage medium instruction, the processor executes the computer instruction, so that the headset executes the audio playback method provided by the above aspect.

本申请实施例提供的技术方案可以带来如下有益效果:The technical solutions provided in the embodiments of the present application can bring the following beneficial effects:

本申请实施例中,耳机在第一工作状态下,对环境音进行缓存并识别已缓存的环境音,在识别出环境音中包含有效环境音的情况下,将第一工作状态调整为第二工作状态,进而在第二工作状态下,基于环境音进行环境音播放;相较于相关技术中耳机只能工作在第一工作状态,采用本申请实施例提供的方案,耳机仅将包含有效环境音的环境音进行播放,使得用户在享受耳机降噪的同时又能够及时对一些有效信息做出反应,另外,耳机先对环境音进行识别,在识别出环境音中包含有效环境音的情况下再进行环境音播放,减小了耳机的功耗。In the embodiment of the present application, in the first working state, the earphone caches the ambient sound and recognizes the cached ambient sound, and adjusts the first working state to the second when it is recognized that the ambient sound contains valid ambient sound. The working state, and then in the second working state, the ambient sound is played based on the ambient sound; compared with the related art, the earphone can only work in the first working state, using the solution provided by the embodiment of the present application, the earphone will only contain the effective environment. The ambient sound of the sound is played, so that the user can respond to some valid information in time while enjoying the noise reduction of the earphone. In addition, the earphone first recognizes the ambient sound, and recognizes that the ambient sound contains valid ambient sound. Then the ambient sound is played, which reduces the power consumption of the headset.

附图说明Description of drawings

为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present application more clearly, the following briefly introduces the drawings that are used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative effort.

图1示出了本申请一个示例性实施例提供的实施环境的示意图;FIG. 1 shows a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application;

图2示出了本申请一个示例性实施例提供的耳机的结构示意图;FIG. 2 shows a schematic structural diagram of an earphone provided by an exemplary embodiment of the present application;

图3示出了本申请一个示例性实施例提供的音频播放方法的流程图;FIG. 3 shows a flowchart of an audio playback method provided by an exemplary embodiment of the present application;

图4示出了本申请一个示例性实施例提供的音频处理方法的示意图;FIG. 4 shows a schematic diagram of an audio processing method provided by an exemplary embodiment of the present application;

图5示出了本申请另一个示例性实施例提供的音频播放方法的流程图;FIG. 5 shows a flowchart of an audio playback method provided by another exemplary embodiment of the present application;

图6示出了本申请一个示例性实施例提供的耳机获取与当前耳机使用场景匹配的目标有效环境音的示意图;FIG. 6 shows a schematic diagram of obtaining a target effective ambient sound matched with a current earphone usage scenario by an earphone provided by an exemplary embodiment of the present application;

图7示出了本申请一个示例性实施例提供的音频播放方法的流程示意图;FIG. 7 shows a schematic flowchart of an audio playback method provided by an exemplary embodiment of the present application;

图8示出了本申请一个示例性实施例提供的音频播放装置的结构框图。FIG. 8 shows a structural block diagram of an audio playback apparatus provided by an exemplary embodiment of the present application.

具体实施方式Detailed ways

为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。In order to make the objectives, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.

在本文中提及的“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。As used herein, "plurality" refers to two or more. "And/or", which describes the association relationship of the associated objects, means that there can be three kinds of relationships, for example, A and/or B, which can mean that A exists alone, A and B exist at the same time, and B exists alone. The character "/" generally indicates that the associated objects are an "or" relationship.

相关技术中,耳机的降噪方式主要分为被动降噪与主动降噪,其中,被动式降噪耳机主要通过包围耳朵形成封闭空间,或者采用隔音材料来阻挡外界噪声,主动式降噪耳机主要通过在声音信号中加入反向的噪音信号来抵消外界的噪声。主动式降噪耳机开启主动降噪状态之后,用户能够在机场、地铁、餐厅等各种嘈杂环境下享受到舒适的降噪体验,但是在某些情况下用户还需要接收外界语音或者外界环境噪音,例如,在地铁上时,用户需要接收地铁广播的声音以免错过站,或者,用户需要听到身边的人讲话的内容,此时耳机需要调整至透传(HearThrough,HT)状态,即将用户需要听到的环境音透传给人耳。In the related art, the noise reduction methods of headphones are mainly divided into passive noise reduction and active noise reduction. Among them, passive noise reduction headphones mainly form a closed space by surrounding the ears, or use sound insulation materials to block external noise, and active noise reduction headphones are mainly used. Add an inverse noise signal to the sound signal to cancel the external noise. After the active noise reduction headset is turned on, users can enjoy a comfortable noise reduction experience in various noisy environments such as airports, subways, restaurants, etc., but in some cases, users also need to receive external voice or external ambient noise. For example, when on the subway, the user needs to receive the sound of the subway broadcast to avoid missing the station, or the user needs to hear the content of the people around him. At this time, the headset needs to be adjusted to the transparent transmission (HearThrough, HT) state. The ambient sound heard is transmitted to the human ear.

如图1所示,其示出了本申请一个示例性实施例提供的实施环境的示意图,该实施环境中包括终端设备110以及耳机120。As shown in FIG. 1 , it shows a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application, and the implementation environment includes a terminal device 110 and an earphone 120 .

终端设备110是具有音频播放功能以及通信功能的电子设备,该电子设备可以是智能手机、平板电脑、个人计算机等等,图1中以终端设备110为智能手机为例进行说明,但并不对此构成限定。The terminal device 110 is an electronic device with audio playback function and communication function. The electronic device can be a smart phone, a tablet computer, a personal computer, etc. In FIG. 1, the terminal device 110 is a smart phone as an example for illustration, but this is not constitute a limitation.

在一些实施例中,终端设备110中安装有具有音频播放功能的应用程序。当需要进行音频播放时,用户可以选择用终端设备110中设有的扬声器进行播放音频,也可以选择用耳机120播放音频,耳机120与终端设备110之间能够进行通信连接。In some embodiments, an application program with an audio playback function is installed in the terminal device 110 . When audio playback is required, the user can choose to use the speaker provided in the terminal device 110 to play the audio, or choose to use the earphone 120 to play the audio. The earphone 120 and the terminal device 110 can be communicatively connected.

耳机120是具有音频播放功能的电子设备,该电子设备可以是头戴耳机、耳罩式耳机、入耳式耳机、半入耳式耳机等等,本实施例对此不作限定。The earphone 120 is an electronic device with an audio playback function, and the electronic device may be a headphone, an earphone, an in-ear earphone, a semi-in-ear earphone, etc., which is not limited in this embodiment.

本申请实施例中,在终端设备110与耳机120之间通过数据通信链路进行通信连接后,用户可以通过在终端设备110上执行特定的操作来控制耳机120对音频进行播放。在一种可能的实施方式中,如图2所示,其示出了本申请一个示例性实施例提供的耳机120的结构示意图。耳机120包括:处理器210、存储器220、环境声音监测组件230、通信组件240以及音频播放组件250。In this embodiment of the present application, after the terminal device 110 and the headset 120 are connected through a data communication link, the user can control the headset 120 to play audio by performing specific operations on the terminal device 110 . In a possible implementation manner, as shown in FIG. 2 , it shows a schematic structural diagram of the earphone 120 provided by an exemplary embodiment of the present application. The headset 120 includes: aprocessor 210 , amemory 220 , an ambientsound monitoring component 230 , acommunication component 240 and anaudio playback component 250 .

处理器210可以包括一个或者多个处理核心。处理器210利用各种接口和线路连接整个耳机120内的各个部分,通过运行或执行存储在存储器220内的指令、程序、代码集或指令集,以及调用存储在存储器220内的数据,执行耳机120的各种功能和处理数据。可选的,处理器210可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gat e Array,FPGA)、可编程逻辑阵列(Programmable LogicArray,PLA)中的至少一种硬件形式来实现。处理器210可集成中央处理器(CentralProcessing Un it,CPU)、图像处理器(Graphics Processing Unit,GPU)、神经网络处理器(Neural-network Processing Unit,NPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示屏所需要显示的内容的渲染和绘制;NPU用于实现人工智能(Artificial Intelligen ce,AI)功能;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器210中,单独通过一块芯片进行实现。Theprocessor 210 may include one or more processing cores. Theprocessor 210 uses various interfaces and lines to connect various parts of the entire headset 120, and executes the headset by running or executing the instructions, programs, code sets or instruction sets stored in thememory 220, and calling the data stored in thememory 220. 120 various functions and processing data. Optionally, theprocessor 210 may adopt at least one of a digital signal processing (Digital Signal Processing, DSP), a Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), and a Programmable Logic Array (Programmable Logic Array, PLA). implemented in a hardware form. Theprocessor 210 may integrate one or more of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU), a neural network processing unit (Neural-network Processing Unit, NPU), and a modem, etc. The combination. Among them, the CPU mainly handles the operating system, user interface, and applications; the GPU is used to render and draw the content that the display needs to display; the NPU is used to implement artificial intelligence (AI) functions; the modem is used to process Wireless communication. It can be understood that, the above-mentioned modem may not be integrated into theprocessor 210, but is implemented by a single chip.

存储器220可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory,ROM)。可选的,该存储器220包括非瞬时性计算机可读介质(non-transitory computer-readable storage medium)。存储器220可用于存储指令、程序、代码、代码集或指令集。存储器220可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等;存储数据区可存储根据耳机的使用所创建的数据(比如音频数据、电话本)等。本申请实施例中,存储器220还用于对环境声音监测组件230所监测到的环境音以及处理后的有效环境音进行缓存。Thememory 220 may include random access memory (Random Access Memory, RAM), or may include read-only memory (Read-Only Memory, ROM). Optionally, thememory 220 includes a non-transitory computer-readable storage medium.Memory 220 may be used to store instructions, programs, codes, sets of codes, or sets of instructions. Thememory 220 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), Instructions and the like for implementing the following various method embodiments; the storage data area may store data (such as audio data, phone book) and the like created according to the use of the headset. In this embodiment of the present application, thememory 220 is further configured to cache the ambient sound monitored by the ambientsound monitoring component 230 and the processed effective ambient sound.

本申请实施例中的电子设备还包括环境声音监测组件230、通信组件240和音频播放组件250。其中,环境声音监测组件230可以实时对环境音进行监测;通信组件240可以为蓝牙组件、串口通信组件等等,耳机120可以通过通信组件240与终端之间建立数据通信链路并进行通信;音频播放组件250用于对音频进行播放。The electronic device in the embodiment of the present application further includes an ambientsound monitoring component 230 , acommunication component 240 and anaudio playing component 250 . Among them, the environmentalsound monitoring component 230 can monitor the environmental sound in real time; thecommunication component 240 can be a Bluetooth component, a serial communication component, etc., and the headset 120 can establish a data communication link and communicate with the terminal through thecommunication component 240; audio Theplayback component 250 is used to play audio.

除此之外,本领域技术人员可以理解的是,上述附图所示出结构并不构成对耳机的限定,耳机可以包括比图示更多或更少的部件、或者组合某些部件或者不同的部件布置。比如耳机中还包括传感器、音频电路、控制电路、电源等部件,本申请实施对此不再赘述。In addition, those skilled in the art can understand that the structure shown in the above drawings does not constitute a limitation on the earphone, and the earphone may include more or less parts than the one shown, or combine some parts or different parts. component layout. For example, the earphone also includes components such as a sensor, an audio circuit, a control circuit, and a power supply, which are not repeated in the implementation of this application.

请参考图3,其示出了本申请一个示例性实施例提供的音频播放方法的流程图,本申请实施例以该方法应用于图1所示的耳机为例进行说明,该方法包括:Please refer to FIG. 3 , which shows a flowchart of an audio playback method provided by an exemplary embodiment of the present application. The embodiment of the present application is described by taking the method applied to the earphone shown in FIG. 1 as an example, and the method includes:

步骤301,在第一工作状态下,对环境音进行缓存,其中,处于第一工作状态的耳机不对环境音进行主动透传。Step 301, in the first working state, buffer the ambient sound, wherein the earphone in the first working state does not actively transparently transmit the ambient sound.

在一种可能的应用场景下,第一工作状态为降噪状态,耳机处于降噪状态时,通过主动降噪方式或者被动降噪方式降低用户所接收到的环境噪声,且不会对环境音进行主动透传。In a possible application scenario, the first working state is the noise reduction state. When the earphone is in the noise reduction state, the ambient noise received by the user is reduced by the active noise reduction method or the passive noise reduction method, and the ambient noise is not affected. Perform active transparent transmission.

可选的,耳机通过ANC(Active Noise Control,主动降噪)、ENC(Envir onmentalNoise Cancellation,环境降噪)、DSP、CVC(Clear Voice Capture,通话软件降噪)等主动降噪技术实现主动降噪,本申请实施例对此不作限定。Optionally, the headset implements active noise reduction through ANC (Active Noise Control, active noise reduction), ENC (Environmental Noise Cancellation, environmental noise reduction), DSP, CVC (Clear Voice Capture, call software noise reduction) and other active noise reduction technologies. , which is not limited in the embodiments of the present application.

可选地,耳机可以是无线耳机、有线耳机等,本申请实施例对此不作限定。Optionally, the earphone may be a wireless earphone, a wired earphone, or the like, which is not limited in this embodiment of the present application.

可选地,环境音中可以包括人声、环境噪声、音乐声、交通工具警示音、报站提示音等,本申请实施例对此不作限定。Optionally, the environmental sound may include human voice, environmental noise, music sound, vehicle warning sound, station announcement prompt sound, etc., which is not limited in this embodiment of the present application.

本申请实施例中,在耳机处于降噪状态时,处理器指示存储器对环境音进行缓存。In this embodiment of the present application, when the earphone is in a noise reduction state, the processor instructs the memory to cache the ambient sound.

步骤302,对缓存的环境音进行识别。Step 302: Identify the buffered ambient sound.

进一步的,处理器对缓存到存储器中的环境音识别,判断环境音中是否包含需要用户做出反应的有效信息。Further, the processor recognizes the ambient sound cached in the memory, and determines whether the ambient sound contains valid information that requires the user to respond.

步骤303,在识别出环境音中包含有效环境音的情况下,将第一工作状态调整为第二工作状态,有效环境音指当前环境中具有收听需求的音频,第二工作状态不同于第一工作状态。Step 303, in the case of identifying that the ambient sound contains valid ambient sounds, adjust the first working state to the second working state, the effective ambient sound refers to the audio with listening needs in the current environment, and the second working state is different from the first working state. working status.

在一种可能的应用场景下,第二工作状态为透传状态,耳机处于透传状态时,会对环境音进行主动透传。In a possible application scenario, the second working state is a transparent transmission state, and when the headset is in the transparent transmission state, the ambient sound is actively transparently transmitted.

本申请实施例中,处理器在在识别出环境音中包含具有收听需求的音频时,将第一工作状态调整为第二工作状态,即将降噪状态调整至透传状态,以便用户接收有效环境音。In the embodiment of the present application, the processor adjusts the first working state to the second working state, that is, adjusts the noise reduction state to the transparent transmission state, when recognizing that the ambient sound contains audio with listening needs, so that the user can receive an effective environment sound.

可选的,关于将第一工作状态调整为第二工作状态的具体方式,在第一工作状态为主动降噪状态的情况下,处理器关闭主动降噪功能,或者,在第一工作状态为被动降噪状态的情况下,处理器降低当前播放音频的音量。Optionally, regarding the specific method of adjusting the first working state to the second working state, when the first working state is the active noise reduction state, the processor turns off the active noise reduction function, or, in the first working state: In the case of passive noise reduction, the processor reduces the volume of the currently playing audio.

当然,在第一工作状态为主动降噪状态的情况下,处理器关闭主动降噪功能的之后,可以进一步通过降低当前播放音频的音量,以使耳机能够更快的从第一工作状态调整为第二工作状态。Of course, in the case that the first working state is the active noise reduction state, after the processor turns off the active noise reduction function, it can further reduce the volume of the currently playing audio, so that the headset can be adjusted from the first working state to the first working state more quickly. The second working state.

步骤304,在第二工作状态下,基于环境音进行环境音播放。Step 304 , in the second working state, play the ambient sound based on the ambient sound.

透传状态下,处理器指示耳机中的音频播放组件进行环境音播放,以便佩戴耳机的用户在机场、地铁等嘈杂的环境中,在享受降噪的同时,无需摘下耳机即可听到耳机近场侧其他人说话的声音或者广播中的报站声。In the transparent transmission state, the processor instructs the audio playback component in the headset to play ambient sound, so that the user wearing the headset can hear the headset without taking off the headset while enjoying noise reduction in noisy environments such as airports and subways. The sound of other people talking on the near field side or the announcement of the station on the broadcast.

综上所述,本申请实施例中,耳机在第一工作状态下,对环境音进行缓存并识别已缓存的环境音,在识别出环境音中包含有效环境音的情况下,将第一工作状态调整为第二工作状态,进而在第二工作状态下,基于环境音进行环境音播放;相较于相关技术中耳机只能工作在第一工作状态,采用本申请实施例提供的方案,耳机仅将包含有效环境音的环境音进行播放,使得用户在享受耳机降噪的同时又能够及时对一些有效信息做出反应,另外,耳机先对环境音进行识别,在识别出环境音中包含有效环境音的情况下再进行环境音播放,减小了耳机的功耗。To sum up, in the embodiment of the present application, in the first working state, the earphone caches the ambient sound and recognizes the cached ambient sound. The state is adjusted to the second working state, and then in the second working state, the ambient sound is played based on the ambient sound; compared with the related art, the earphone can only work in the first working state. Only the ambient sound containing the effective ambient sound is played, so that the user can respond to some valid information in time while enjoying the noise reduction of the earphone. In the case of ambient sound, the ambient sound is played, which reduces the power consumption of the earphone.

在一种可能的实施方式中,耳机基于环境音进行环境音播放的方式,可以是以下任一种:In a possible implementation manner, the manner in which the headset plays ambient sound based on ambient sound may be any of the following:

1、播放缓存的环境音。1. Play the cached ambient sound.

在一种可能的实施方式中,处理器在在识别出环境音中包含有效环境音后直接播放缓存在存储器中的环境音,以便用户对有效信息做出反应。In a possible implementation, the processor directly plays the ambient sound buffered in the memory after recognizing that the ambient sound contains valid ambient sounds, so that the user can respond to the valid information.

为了避免用户错过有效环境音,处理器在不存在新的有效环境音的情况下,指示音频播放组件重复播放缓存的环境音。In order to prevent the user from missing the valid ambient sound, the processor instructs the audio playing component to repeatedly play the buffered ambient sound in the absence of a new valid ambient sound.

可选的,在环境音的播放次数达到次数阈值的情况下,处理器指示音频播放组件停止播放环境音,并删除缓存的环境音。Optionally, when the number of times of playing the ambient sound reaches the threshold, the processor instructs the audio playing component to stop playing the ambient sound and delete the cached ambient sound.

示意性的,若预先设置次数阈值为10,则处理器在环境音的播放次数达到10次时,指示音频播放组件停止播放环境音,并删除缓存在存储器中的环境音。Illustratively, if the preset number of times threshold is 10, the processor instructs the audio playback component to stop playing the ambient sound and delete the ambient sound cached in the memory when the number of times of playing the ambient sound reaches 10.

可选的,处理器在接收到音频停止播放指令的情况下,停止播放环境音,并删除缓存的环境音。Optionally, in the case of receiving the audio stop playing instruction, the processor stops playing the ambient sound and deletes the buffered ambient sound.

其中,音频停止播放指令用于指示停止当前播放的音频,音频停止播放指令由结束佩戴操作、对耳机的手势操作或者对与耳机相连的终端设备的控制操作中的至少一种触发。The audio stop playing instruction is used to instruct to stop the currently playing audio, and the audio stop playing instruction is triggered by at least one of an end wearing operation, a gesture operation on the earphone, or a control operation on a terminal device connected to the earphone.

可选的,对与耳机相连的终端设备的控制操作可以为在终端设备触控显示屏上进行的操作,如点击操作、滑动操作、手势操作等,还可以为对终端设备的物理按键进行的操作,如单击按键操作、长按案件操作等,本申请实施例并不对具体的控制操作构成限定。Optionally, the control operation on the terminal device connected to the earphone may be an operation performed on the touch screen of the terminal device, such as a click operation, a sliding operation, a gesture operation, etc., or may be performed on the physical keys of the terminal device. Operations, such as single-click button operations, long-pressing case operations, etc., are not limited to specific control operations in the embodiments of the present application.

本申请实施例中,耳机直接播放缓存在存储器中的环境音,无需对环境音进行处理,能够减少耳机处理环境音所需要的时间,使用户同步接收到有效信息以便用户做出反应。In the embodiment of the present application, the earphone directly plays the ambient sound buffered in the memory without processing the ambient sound, which can reduce the time required for the earphone to process the ambient sound, so that the user can receive valid information synchronously so that the user can respond.

2、对缓存的环境音进行增强处理,并播放增强处理后的环境音。2. Enhance the buffered ambient sound, and play the enhanced ambient sound.

为了能够突出环境音中的有效环境音,使用户更精准的获取有效信息,在一种可能的实施方式中,处理器对环境音中的有效环境音进行音频增强处理,并对环境音中有效环境音以外的声音进行音频抑制处理,得到增强处理后的环境音。In order to highlight the effective ambient sounds in the ambient sounds and enable the user to obtain effective information more accurately, in a possible implementation, the processor performs audio enhancement processing on the effective ambient sounds in the ambient sounds, and performs audio enhancement processing on the effective ambient sounds in the ambient sounds. Sounds other than ambient sounds are subjected to audio suppression processing to obtain enhanced ambient sounds.

可选的,对环境音中的有效环境音进行增强处理方法可以为基于谱相减的音频增强方法、基于小波分析的音频增强方法、基于卡尔曼滤波的音频增强方法、基于信号子空间的音频增强方法、基于听觉掩蔽效应的音频增强方法、基于独立分量分析的音频增强方法、基于神经网络的音频增强方法等,本申请实施例并不对具体的音频增强方法构成限定。Optionally, the method for enhancing the effective ambient sound in the ambient sound may be an audio enhancement method based on spectral subtraction, an audio enhancement method based on wavelet analysis, an audio enhancement method based on Kalman filtering, and an audio enhancement method based on signal subspace. For the enhancement method, the audio enhancement method based on auditory masking effect, the audio enhancement method based on independent component analysis, the audio enhancement method based on neural network, etc., the embodiments of the present application do not limit the specific audio enhancement method.

可选的,处理器识别出环境音中的有效环境音后,还可以通过消除环境音中有效环境音以外的声音,即只保留有效环境音,得到增强处理后的声音。Optionally, after the processor recognizes the effective ambient sounds in the ambient sounds, it can also eliminate sounds other than the effective ambient sounds in the ambient sounds, that is, only retain the effective ambient sounds, to obtain the enhanced sound.

示意性的,如图4所示,当环境声音监测组件420监测到环境音的变化幅度达到幅度阈值时,处理器410指示存储器430对环境音进行缓存,进一步的,处理器410从存储器430中获取原始环境音数据,在处理器410识别出环境音中包含有效环境音的情况下,对环境音中的有效环境音进行增强处理,得到增强处理后的环境音,环境音处理完成后,处理器410将耳机从第一工作状态调整为第二工作状态,并在第二工作状态下,指示音频播放组件440播放增强处理后的环境音。Illustratively, as shown in FIG. 4 , when the ambient sound monitoring component 420 detects that the change amplitude of the ambient sound reaches the amplitude threshold, the processor 410 instructs the memory 430 to cache the ambient sound, and further, the processor 410 retrieves the ambient sound from the memory 430 Obtain the original ambient sound data, and in the case that the processor 410 identifies that the ambient sound contains valid ambient sounds, it performs enhancement processing on the effective ambient sounds in the ambient sounds to obtain the enhanced ambient sound, and after the ambient sound processing is completed, processing The controller 410 adjusts the headset from the first working state to the second working state, and instructs the audio playing component 440 to play the enhanced ambient sound in the second working state.

可选的,处理器对存储器进行内容覆盖,将增强处理后的环境音缓存至存储器中替换掉未处理的环境音。Optionally, the processor overwrites the content of the memory, and caches the enhanced-processed ambient sound in the memory to replace the unprocessed ambient sound.

为了避免用户错过有效环境音,在一种可能的实施方式中,处理器在不存在新的有效环境音的情况下,处理器指示音频播放组件重复播放增强处理后的环境音。In order to prevent the user from missing the valid ambient sound, in a possible implementation manner, the processor instructs the audio playback component to repeatedly play the enhanced-processed ambient sound when there is no new valid ambient sound.

可选的,在增强处理后的环境音的播放次数达到次数阈值的情况下,停止播放增强处理后的环境音,并删除缓存的增强处理后的环境音。Optionally, when the playing times of the enhanced ambient sound reaches the number of times threshold, stop playing the enhanced ambient sound, and delete the cached enhanced ambient sound.

示意性的,若预先设置次数阈值为10,则处理器在增强处理后的环境音的播放次数达到10次时,指示音频播放组件停止播放增强处理后的环境音,并删除缓存在存储器中的增强处理后的环境音。Illustratively, if the preset number of times threshold is 10, the processor instructs the audio playback component to stop playing the enhanced ambient sound when the number of times of playing the enhanced ambient sound reaches 10, and deletes the buffered ambient sound in the memory. Enhances the processed ambient sound.

可选的,在接收到音频停止播放指令的情况下,停止播放增强处理后的环境音,并删除缓存的增强处理后的环境音。Optionally, in the case of receiving the audio stop playing instruction, stop playing the enhanced-processed ambient sound, and delete the cached enhanced-processed ambient sound.

其中,音频停止播放指令用于指示停止当前播放的音频,音频停止播放指令由结束佩戴操作、对耳机的手势操作或者对与耳机相连的终端设备的控制操作中的至少一种触发。The audio stop playing instruction is used to instruct to stop the currently playing audio, and the audio stop playing instruction is triggered by at least one of an end wearing operation, a gesture operation on the earphone, or a control operation on a terminal device connected to the earphone.

同样的,对与耳机相连的终端设备的控制操作可以为在终端设备触控显示屏上进行的操作,如点击操作、滑动操作、手势操作等,还可以为对终端设备的物理按键进行的操作,如单击按键操作、长按案件操作等,本申请实施例并不对具体的控制操作构成限定。Similarly, the control operation on the terminal device connected to the earphone can be an operation performed on the touch screen of the terminal device, such as a click operation, a sliding operation, a gesture operation, etc., or an operation performed on the physical keys of the terminal device , such as single-click button operation, long-pressing case operation, etc., the embodiments of the present application do not limit the specific control operations.

本申请实施例中,处理器对缓存在存储器中的环境音进行增强处理后再播放,能够突出环境音中的有效环境音,使用户更精准的获取有效信息,较少噪音干扰。In the embodiment of the present application, the processor performs enhancement processing on the ambient sound cached in the memory before playing, which can highlight the effective ambient sound in the ambient sound, so that the user can obtain effective information more accurately and reduce noise interference.

在一种可能的实施方式中,耳机与终端设备建立通信连接后,处理器指示环境声音监测组件实施监测环境音的变化幅度,并在环境音的变化幅度达到幅度阈值时,对环境音进行缓存以及识别操作。请参考图5,其示出了本申请另一个示例性实施例提供的音频播放方法的流程图,本申请实施例以该方法应用于图1所示的耳机为例进行说明,该方法包括:In a possible implementation, after the headset and the terminal device establish a communication connection, the processor instructs the ambient sound monitoring component to monitor the variation range of the ambient sound, and buffers the ambient sound when the variation range of the ambient sound reaches an amplitude threshold. and recognition operations. Please refer to FIG. 5 , which shows a flowchart of an audio playback method provided by another exemplary embodiment of the present application. The embodiment of the present application is described by taking the method applied to the earphone shown in FIG. 1 as an example, and the method includes:

步骤501,在第一工作状态下,进行环境音监测。Step 501, in the first working state, perform environmental sound monitoring.

在一种可能的实施方式中,耳机通过通信组件与终端设备建立通信连接后,进入第一工作状态,即耳机工作在降噪状态,此时,处理器指示环境声音监测组件对环境音进行监测,环境声音监测组件可实时监测环境音的响度和频率。In a possible implementation, after the headset establishes a communication connection with the terminal device through the communication component, it enters the first working state, that is, the headset works in a noise reduction state. At this time, the processor instructs the environmental sound monitoring component to monitor the environmental sound. , the ambient sound monitoring component can monitor the loudness and frequency of ambient sound in real time.

步骤502,在监测到环境音的变化幅度达到幅度阈值的情况下,对环境音进行缓存,变化幅度包括响度变化幅度和频率变化幅度中的至少一种。Step 502 , buffer the ambient sound when it is monitored that the variation range of the ambient sound reaches the amplitude threshold, and the variation range includes at least one of a loudness variation range and a frequency variation range.

在一种可能的实施方式中,当环境声音监测组件监测到环境音的变化幅度达到幅度阈值时,处理器将环境音缓存至存储器中。In a possible implementation, when the ambient sound monitoring component detects that the variation amplitude of the ambient sound reaches an amplitude threshold, the processor buffers the ambient sound into the memory.

示意性的,若幅度阈值为20,环境声音监测组件监测到第一时刻下的环境音响度为30,第二时刻下环境音响度为50,第二时刻为第一时刻的临近时刻,则在第一时刻至第二时刻的这段时间中环境音的变化幅度为20,达到幅度阈值20,处理器将第二时刻下的环境音缓存至存储器中。Illustratively, if the amplitude threshold is 20, and the ambient sound monitoring component detects that the ambient sound level at the first moment is 30, the ambient sound level at the second moment is 50, and the second moment is an approaching moment of the first moment, then at During the period from the first moment to the second moment, the variation range of the ambient sound is 20, reaching the amplitude threshold of 20, and the processor caches the ambient sound at the second moment in the memory.

可选的,可以预先设定缓存时长,也可以根据环境声音监测组件实时监测的环境音变化情况决定结束时间(例如当变化幅度低于幅度阈值之后的三秒结束缓存),以避免处理器一直指示存储器对环境音进行缓存所造成的功耗浪费。Optionally, the cache duration can be preset, or the end time can be determined according to the changes in the ambient sound monitored by the ambient sound monitoring component in real time (for example, when the change amplitude is lower than the amplitude threshold, the cache is ended three seconds later), so as to prevent the processor from always Indicates the waste of power consumption caused by the memory buffering of ambient sounds.

步骤503,获取与当前耳机使用场景匹配的目标有效环境音,其中,不同耳机使用场景对应不同有效环境音。Step 503: Acquire a target effective ambient sound matching the current earphone usage scenario, wherein different earphone usage scenarios correspond to different effective ambient sounds.

在一种可能的实施方式中,耳机通过与终端设备之间建立的通信连接,获取与当前耳机使用场景匹配的目标有效环境音,其中,目标有效环境音由终端设备基于当前耳机使用场景从耳机使用场景与有效环境音的对应关系中确定得到。In a possible implementation manner, the earphone obtains the target effective ambient sound that matches the current earphone usage scene through the communication connection established with the terminal device, wherein the target effective ambient sound is obtained by the terminal device based on the current earphone usage scene from the earphone It is determined from the corresponding relationship between the usage scene and the effective ambient sound.

示意性的,如图6所示,耳机与终端设备之间建立有通信连接,在耳机的环境声音监测组件监测到环境音的变化幅度达到幅度阈值后,耳机的处理器通过与终端设备之间建立的通信连接向终端设备发送获取目标有效环境音信息,终端设备接收到该信息后,判断当前耳机使用场景,进而获取与使用场景匹配的目标有效环境音,并将目标有效环境音发送至耳机,以便后续耳机基于目标有效环境音对缓存的环境音进行识别。Schematically, as shown in Figure 6, a communication connection is established between the earphone and the terminal device. After the ambient sound monitoring component of the earphone detects that the variation of the ambient sound reaches the amplitude threshold, the processor of the earphone communicates with the terminal device. The established communication connection sends the information about obtaining the target effective ambient sound to the terminal device. After the terminal device receives the information, it determines the current earphone usage scene, and then acquires the target effective ambient sound that matches the usage scene, and sends the target effective ambient sound to the earphone. , so that subsequent headphones can identify the buffered ambient sound based on the target effective ambient sound.

可选的,终端可以通过传感器、定位组件、声音识别组件、图像识别组件等获取环境信息,以便终端设备判断当前耳机使用场景,本申请实施例对此不作限定。Optionally, the terminal may obtain environmental information through a sensor, a positioning component, a sound recognition component, an image recognition component, etc., so that the terminal device can determine the current earphone usage scenario, which is not limited in this embodiment of the present application.

可选的,耳机使用场景与有效环境音的对应关系预先被设置并缓存在终端设备中,终端设备确定耳机当前使用场景后,可直接基于耳机使用场景与有效环境音的对应关系确定目标有效环境音。Optionally, the corresponding relationship between the earphone usage scene and the effective ambient sound is preset and cached in the terminal device. After the terminal device determines the current earphone usage scene, it can directly determine the target effective environment based on the corresponding relationship between the earphone usage scene and the effective ambient sound. sound.

示意性的,耳机使用场景与有效环境音的对应关系如表一所示。Illustratively, the corresponding relationship between the earphone usage scene and the effective ambient sound is shown in Table 1.

表一Table I

耳机使用场景Headphone usage scenarios有效环境音Effective ambient sound交通工具乘坐场景vehicle ride scene报站提示音station announcement sound室外场景outdoor scene交通工具警示音vehicle warning sound室内场景indoor scene目标人声target vocals

可选的,在当前耳机使用场景为交通工具乘坐场景的情况下,目标有效环境音包括报站提示音;在当前耳机使用场景为室外场景的情况下,目标有效环境音包括交通工具警示音;在当前耳机使用场景为室内场景的情况下,目标有效环境音包括目标人声,其中,目标人声中包含目标关键词。Optionally, when the current headset usage scene is a vehicle riding scene, the target effective ambient sound includes a station announcement prompt; when the current headset usage scene is an outdoor scene, the target effective ambient sound includes a vehicle warning sound; When the current headset usage scene is an indoor scene, the target effective ambient sound includes a target human voice, where the target human voice includes a target keyword.

在一个示意性的例子中,目标关键词为用户姓名,在当前耳机使用场景为室内场景的情况下,若目标有效环境音中包括含有用户姓名的目标人声,则该目标人声为与当前耳机使用场景匹配的目标有效环境音。In an illustrative example, the target keyword is the user's name. When the current headset usage scene is an indoor scene, if the target effective ambient sound includes a target human voice containing the user's name, the target human voice is the same as the current one. The headset uses the scene-matched target effective ambient sound.

步骤504,基于目标有效环境音对缓存的环境音进行识别。Step 504: Identify the buffered ambient sound based on the target effective ambient sound.

进一步的,处理器基于目标有效环境音对缓存在存储器内的环境音进行识别。需要注意的是,在一种可能的实施方式中,处理器在监测到环境音的变化幅度达到幅度阈值,对环境音进行缓存之后,即刻获取目标有效环境音并基于目标有效环境音对缓存的环境音进行识别。但在另一种可能的实施方式中,为降低处理器功耗,处理器还预先设置有一个识别幅度阈值,处理器在环境声音监测组件监测到环境音的变化幅度达到幅度阈值时,对环境音进行缓存,但直到环境声音监测组件监测到环境音的变化幅度达到识别幅度阈值时,处理器才会获取目标有效环境音并基于目标有效环境音对缓存的环境音进行识别。Further, the processor identifies the ambient sound buffered in the memory based on the target valid ambient sound. It should be noted that, in a possible implementation manner, after the processor detects that the change range of the ambient sound reaches the amplitude threshold and caches the ambient sound, it immediately acquires the target effective ambient sound and adjusts the cached value based on the target effective ambient sound. Ambient sounds are recognized. However, in another possible implementation manner, in order to reduce the power consumption of the processor, the processor is also preset with a threshold for identification amplitude, and when the ambient sound monitoring component detects that the variation amplitude of the ambient sound reaches the amplitude threshold, the processor will The sound is buffered, but the processor will not obtain the target effective environmental sound and identify the buffered environmental sound based on the target effective environmental sound until the environmental sound monitoring component detects that the change range of the environmental sound reaches the recognition amplitude threshold.

示意性的,若幅度阈值为20,识别幅度阈值为30,则在环境音的变化幅度达到20时,处理器就指示存储器对环境音进行缓存,但只有当环境音的变化幅度达到30时,处理器才对缓存的环境音进行识别,在环境音的变化幅度达到20却并未达到30时,处理器仅仅指示存储器对环境音进行缓存,直到环境音的变化幅度达到30,处理器调出缓存在存储器中的环境音并对其进行增强处理,并将处理后的增强声音缓存至存储器。Illustratively, if the amplitude threshold is 20 and the recognition amplitude threshold is 30, then when the variation range of the ambient sound reaches 20, the processor instructs the memory to cache the ambient sound, but only when the variation range of the ambient sound reaches 30, The processor recognizes the buffered ambient sound. When the variation of the ambient sound reaches 20 but does not reach 30, the processor only instructs the memory to cache the ambient sound until the variation of the ambient sound reaches 30, and the processor calls out The ambient sound buffered in the memory is enhanced, and the processed enhanced sound is buffered to the memory.

可选的,存储器可设有一定的刷新时长,比如,预先设置刷新时长为10s,则每间隔10s,处理器会指示存储器对缓存的环境音进行覆盖更新。Optionally, the memory may be provided with a certain refresh duration. For example, if the refresh duration is preset as 10s, the processor will instruct the memory to overwrite and update the cached ambient sound every 10s.

步骤505,在识别出环境音中不包含有效环境音的情况下,删除缓存的环境音,并保持第一工作状态。Step 505 , in the case of identifying that the ambient sound does not contain valid ambient sound, delete the buffered ambient sound, and maintain the first working state.

本申请实施例中,处理器识别出环境音中不包含有效环境音时,删除缓存在存储器中的环境音,并保持第一工作状态,此时耳机保持主动降噪状态,通过环境声音监测组件对环境音进行实时监测,不会对环境音进行主动透传。In the embodiment of the present application, when the processor recognizes that the ambient sound does not contain valid ambient sound, it deletes the ambient sound cached in the memory, and maintains the first working state. The ambient sound is monitored in real time, and the ambient sound will not be actively transparently transmitted.

步骤506,在识别出环境音中包含有效环境音的情况下,将第一工作状态调整为第二工作状态。Step 506 , adjusting the first working state to the second working state when it is recognized that the ambient sound includes effective ambient sound.

本步骤的实施方式可以参考步骤303,本实施例在此不再赘述。For the implementation of this step, reference may be made to step 303, and details are not described herein again in this embodiment.

步骤507,在第二工作状态下,基于环境音进行环境音播放。Step 507 , in the second working state, play the ambient sound based on the ambient sound.

本步骤的实施方式可以参考步骤304,本实施例在此不再赘述。For the implementation of this step, reference may be made to step 304, and details are not described herein again in this embodiment.

步骤508,在满足环境音播放结束条件的情况下,恢复第一工作状态。Instep 508, the first working state is restored when the conditions for ending the playing of the ambient sound are satisfied.

在一种可能的实施方式中,在满足环境音播放结束条件的情况下,处理器将第二工作状态调整回第一工作状态。In a possible implementation manner, the processor adjusts the second working state back to the first working state when the conditions for ending the playing of the ambient sound are satisfied.

可选的,环境音播放结束条件可以为播放次数达到次数阈值、接收到音频停止播放指令等,本申请实施例对此不作限定。Optionally, the conditions for ending the playing of the ambient sound may be that the number of times of playing reaches a threshold of the number of times, an instruction to stop playing the audio is received, and the like, which is not limited in this embodiment of the present application.

本申请实施例中,耳机在第一工作状态下,通过环境声音监测组件对环境音进行实时监测,并对变化幅度达到幅度阈值的环境音进行缓存,进一步的,基于与当前耳机使用场景匹配的目标有效环境音对已缓存的环境音进行识别,在识别出环境音中不包含有效环境音的情况下,删除缓存的环境音,并保持第一工作状态,在识别出环境音中包含目标有效环境音的情况下,将第一工作状态调整为第二工作状态,进而在第二工作状态下,基于环境音进行环境音播放,最后在满足环境音播放结束条件的情况下,恢复第一工作状态,在降低耳机对环境音进行识别所需的功耗的同时,耳机仅将包含目标有效环境音的环境音进行播放,使得用户在不同的耳机使用场景中享受耳机降噪的同时更加准确的获取到有效信息。In the embodiment of the present application, in the first working state of the earphone, the ambient sound is monitored in real time through the ambient sound monitoring component, and the ambient sound whose variation amplitude reaches the amplitude threshold is buffered. The target valid ambient sound recognizes the cached ambient sound, and in the case of identifying that the ambient sound does not contain a valid ambient sound, deletes the cached ambient sound and maintains the first working state, and recognizes that the ambient sound contains the target effective ambient sound. In the case of ambient sound, the first working state is adjusted to the second working state, and then in the second working state, the ambient sound is played based on the ambient sound, and finally the first working state is resumed when the ambient sound playback end condition is satisfied. state, while reducing the power consumption required for the earphone to recognize the ambient sound, the earphone will only play the ambient sound containing the target effective ambient sound, so that the user can enjoy the earphone noise reduction in different earphone usage scenarios and at the same time more accurate Obtain valid information.

请参考图7,其示出了本申请一个示例性实施例提供的音频播放方法的系统流程示意图。本实施例以该流程用于图1所示的耳机为例进行说明。Please refer to FIG. 7 , which shows a schematic system flow diagram of an audio playback method provided by an exemplary embodiment of the present application. This embodiment is described by taking the process for the earphone shown in FIG. 1 as an example.

步骤701,用户打开耳机后,通过通信组件与终端设备建立通信连接,此时,耳机工作在第一工作状态。Step 701, after the user turns on the headset, establishes a communication connection with the terminal device through the communication component, and at this time, the headset works in the first working state.

步骤702,处理器指示环境声音监测组件实时监测环境音变化,环境声音监测组件可实时监测环境音的响度和频率。Instep 702, the processor instructs the environmental sound monitoring component to monitor changes in the environmental sound in real time, and the environmental sound monitoring component can monitor the loudness and frequency of the environmental sound in real time.

步骤703,在监测到环境音的变化幅度达到幅度阈值的情况下,耳机对环境音进行缓存,其中,变化幅度包括响度变化幅度和频率变化幅度中的至少一种。Step 703 , in the case where it is detected that the variation range of the ambient sound reaches the amplitude threshold, the earphone buffers the ambient sound, where the variation range includes at least one of a loudness variation range and a frequency variation range.

步骤704,处理器通过耳机与终端之间的通信连接获取与当前耳机使用场景匹配的目标有效环境音,并基于目标有效环境音对缓存在存储器中的环境音进行识别。Step 704, the processor obtains the target effective ambient sound matching the current earphone usage scene through the communication connection between the earphone and the terminal, and identifies the ambient sound buffered in the memory based on the target effective ambient sound.

可选的,在识别出环境音中包含有效环境音的情况下,处理器对缓存在存储器中的环境音进行增强处理,并将增强处理后的环境音缓存至存储器中替换掉未处理的环境音。Optionally, in the case of identifying that the ambient sound contains valid ambient sounds, the processor performs enhancement processing on the ambient sound cached in the memory, and caches the enhanced ambient sound in the memory to replace the unprocessed ambient sound. sound.

步骤705,在识别出环境音中包含有效环境音的情况下,处理器将耳机工作状态从第一工作状态调整为第二工作状态。Step 705 , in the case of identifying that the ambient sound contains valid ambient sounds, the processor adjusts the working state of the earphone from the first working state to the second working state.

步骤706,在第二工作状态下,处理器指示音频播放组件基于环境音进行环境音播放,并在满足环境音播放结束条件的情况下,将耳机工作状态恢复第一工作状态。Step 706: In the second working state, the processor instructs the audio playback component to play the ambient sound based on the ambient sound, and restores the headset working state to the first working state when the ambient sound playback end condition is satisfied.

请参考图8,其示出了本申请一个示例性实施例提供的音频播放装置的结构框图,该装置用于耳机,该装置包括:Please refer to FIG. 8 , which shows a structural block diagram of an audio playback device provided by an exemplary embodiment of the present application. The device is used for earphones, and the device includes:

缓存模块801,用于在第一工作状态下,对环境音进行缓存,其中,处于所述第一工作状态的耳机不对环境音进行主动透传;Acache module 801, configured to cache ambient sounds in a first working state, wherein the headphones in the first working state do not actively transparently transmit ambient sounds;

识别模块802,用于对缓存的所述环境音进行识别;Anidentification module 802, configured to identify the buffered ambient sound;

调整模块803,用于在识别出所述环境音中包含有效环境音的情况下,将所述第一工作状态调整为第二工作状态,所述有效环境音指当前环境中具有收听需求的音频,所述第二工作状态不同于所述第一工作状态;Anadjustment module 803, configured to adjust the first working state to a second working state in the case of identifying that the ambient sound contains valid ambient sounds, where the effective ambient sound refers to audio that has listening needs in the current environment , the second working state is different from the first working state;

播放模块804,用于在所述第二工作状态下,基于所述环境音进行环境音播放。Theplaying module 804 is configured to play ambient sound based on the ambient sound in the second working state.

可选的,所述播放模块804,用于:Optionally, theplayback module 804 is used for:

播放缓存的所述环境音;play the buffered ambient sound;

或者,or,

对缓存的所述环境音进行增强处理,所述增强处理用于突出所述有效环境音;播放增强处理后的所述环境音。Perform enhancement processing on the buffered ambient sound, where the enhancement processing is used to highlight the effective ambient sound; and play the enhanced ambient sound.

可选的,所述播放模块804,用于:Optionally, theplayback module 804 is used for:

对所述环境音中的所述有效环境音进行音频增强处理,以及对所述环境音中所述有效环境音以外的声音进行音频抑制处理,得到增强处理后的所述环境音;Perform audio enhancement processing on the effective ambient sounds in the ambient sounds, and perform audio suppression processing on sounds other than the effective ambient sounds in the ambient sounds, to obtain the enhanced ambient sounds;

或者,or,

消除所述环境音中所述有效环境音以外的声音,得到增强处理后的所述环境音。Sounds other than the effective ambient sound in the ambient sound are eliminated to obtain the enhanced ambient sound.

可选的,所述播放模块804,用于:Optionally, theplayback module 804 is used for:

在不存在新的有效环境音的情况下,重复播放缓存的所述环境音;In the absence of new valid ambient sounds, playing the buffered ambient sounds repeatedly;

所述播放模块804,具体用于:Theplayback module 804 is specifically used for:

在不存在新的有效环境音的情况下,重复播放增强处理后的所述环境音。If there is no new valid ambient sound, the enhanced ambient sound is played repeatedly.

可选的,所述装置还包括:Optionally, the device further includes:

停止模块,用于在所述环境音或增强处理后的所述环境音的播放次数达到次数阈值的情况下,或者,在接收到音频停止播放指令的情况下,停止播放所述环境音或增强处理后的所述环境音,所述音频停止播放指令用于指示停止当前播放的音频,所述音频停止播放指令由结束佩戴操作、对所述耳机的手势操作或者对与所述耳机相连的终端设备的控制操作中的至少一种触发;A stop module, configured to stop playing the ambient sound or the enhancement when the number of times of playing the ambient sound or the enhanced ambient sound reaches a threshold, or when receiving an audio stop playing instruction The processed ambient sound, the audio stop playing instruction is used to instruct to stop the currently playing audio, and the audio stop playing instruction consists of an end wearing operation, a gesture operation on the headset, or a terminal connected to the headset. At least one of the control operations of the device is triggered;

第一删除模块,用于删除缓存的所述环境音或增强处理后的所述环境音。The first deletion module is configured to delete the buffered ambient sound or the enhanced ambient sound.

可选的,所述缓存模块801,用于:Optionally, thecache module 801 is used for:

在所述第一工作状态下,进行环境音监测;In the first working state, monitoring the ambient sound;

在所述监测到所述环境音的变化幅度达到幅度阈值的情况下,对环境音进行缓存,所述变化幅度包括响度变化幅度和频率变化幅度中的至少一种。In the case where it is detected that the variation range of the environmental sound reaches the range threshold, the environmental sound is buffered, and the variation range includes at least one of a loudness variation range and a frequency variation range.

可选的,所述识别模块802,用于:Optionally, theidentification module 802 is used for:

获取与当前耳机使用场景匹配的目标有效环境音,其中,不同耳机使用场景对应不同有效环境音;Obtain the target effective ambient sound that matches the current earphone usage scenario, wherein different earphone usage scenarios correspond to different effective ambient sounds;

基于所述目标有效环境音对缓存的所述环境音进行识别;Identifying the buffered ambient sound based on the target effective ambient sound;

所述调整模块803,用于在识别出所述环境音中包含所述目标有效环境音的情况下,将所述第一工作状态调整为所述第二工作状态。Theadjustment module 803 is configured to adjust the first working state to the second working state when it is recognized that the ambient sound includes the target effective ambient sound.

可选的,所述识别模块802,具体用于:Optionally, theidentification module 802 is specifically used for:

通过与终端设备之间建立的通信连接,获取与所述当前耳机使用场景匹配的所述目标有效环境音,所述目标有效环境音由所述终端设备基于所述当前耳机使用场景从耳机使用场景与有效环境音的对应关系中确定得到。Obtain the target effective ambient sound that matches the current earphone usage scene through the communication connection established with the terminal device, and the target effective ambient sound is obtained by the terminal device from the earphone usage scene based on the current earphone usage scene The corresponding relationship with the effective ambient sound is determined.

可选的,在所述当前耳机使用场景为交通工具乘坐场景的情况下,所述目标有效环境音包括报站提示音;Optionally, when the current headset usage scenario is a vehicle riding scenario, the target effective ambient sound includes a station announcement sound;

在所述当前耳机使用场景为室外场景的情况下,所述目标有效环境音包括交通工具警示音;In the case that the current headset usage scene is an outdoor scene, the target effective ambient sound includes a vehicle warning sound;

在所述当前耳机使用场景为室内场景的情况下,所述目标有效环境音包括目标人声,所述目标人声中包含目标关键词。When the current headset usage scene is an indoor scene, the target effective ambient sound includes a target human voice, and the target human voice includes a target keyword.

可选的,所述调整模块803,用于:Optionally, theadjustment module 803 is used for:

在所述第一工作状态为主动降噪状态的情况下,关闭主动降噪功能;In the case that the first working state is the active noise reduction state, turning off the active noise reduction function;

或者,or,

在所述第一工作状态为被动降噪状态的情况下,降低当前播放音频的音量。In the case that the first working state is a passive noise reduction state, the volume of the currently playing audio is reduced.

可选的,所述装置还包括:Optionally, the device further includes:

在满足环境音播放结束条件的情况下,恢复所述第一工作状态。The first working state is restored when the conditions for ending the playing of the ambient sound are satisfied.

可选的,所述装置还包括:Optionally, the device further includes:

第二删除模块,用于在识别出所述环境音中不包含所述有效环境音的情况下,删除缓存的所述环境音,并保持所述第一工作状态。A second deletion module, configured to delete the buffered ambient sound and maintain the first working state when it is recognized that the ambient sound does not contain the valid ambient sound.

综上所述,本申请实施例中,耳机在第一工作状态下,对环境音进行缓存并识别已缓存的环境音,在识别出环境音中包含有效环境音的情况下,将第一工作状态调整为第二工作状态,进而在第二工作状态下,基于环境音进行环境音播放;相较于相关技术中耳机只能工作在第一工作状态,采用本申请实施例提供的方案,耳机仅将包含有效环境音的环境音进行播放,使得用户在享受耳机降噪的同时又能够及时对一些有效信息做出反应,另外,耳机先对环境音进行识别,在识别出环境音中包含有效环境音的情况下再进行环境音播放,减小了耳机的功耗。To sum up, in the embodiment of the present application, in the first working state, the earphone caches the ambient sound and recognizes the cached ambient sound. The state is adjusted to the second working state, and then in the second working state, the ambient sound is played based on the ambient sound; compared with the related art, the earphone can only work in the first working state. Only the ambient sound containing the effective ambient sound is played, so that the user can respond to some valid information in time while enjoying the noise reduction of the earphone. In the case of ambient sound, the ambient sound is played, which reduces the power consumption of the earphone.

需要说明的是:上述实施例提供的装置,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的装置与方法实施例属于同一构思,其实现过程详见方法实施例,这里不再赘述。It should be noted that: the device provided in the above-mentioned embodiment is only illustrated by the division of the above-mentioned various functional modules. In practical applications, the above-mentioned function allocation can be completed by different functional modules as required, that is, the internal structure of the device is divided into Different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the implementation process thereof is detailed in the method embodiments, which will not be repeated here.

本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质存储有至少一段程序,至少一段程序由处理器加载并执行以实现如上各个实施例所述的音频播放方法。Embodiments of the present application further provide a computer-readable storage medium, where the computer-readable storage medium stores at least one program, and the at least one program is loaded and executed by a processor to implement the audio playback methods described in the above embodiments.

本申请实施例还提供了一种计算机程序产品,该计算机程序产品包括计算机指令,该计算机指令存储在计算机可读存储介质中。耳机的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该耳机执行上述方面的各种可选实现方式中提供的音频播放方法。Embodiments of the present application also provide a computer program product, where the computer program product includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the headset reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the headset executes the audio playback method provided in various optional implementations of the foregoing aspects.

本领域技术人员应该可以意识到,在上述一个或多个示例中,本申请实施例所描述的功能可以用硬件、软件、固件或它们的任意组合来实现。当使用软件实现时,可以将这些功能存储在计算机可读介质中或者作为计算机可读介质上的一个或多个指令或代码进行传输。计算机可读介质包括计算机存储介质和通信介质,其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。存储介质可以是通用或专用计算机能够存取的任何可用介质。另外,本文中描述的步骤编号,仅示例性示出了步骤间的一种可能的执行先后顺序,在一些其它实施例中,上述步骤也可以不按照编号顺序来执行,如两个不同编号的步骤同时执行,或者两个不同编号的步骤按照与图示相反的顺序执行,本申请实施例对此不作限定。Those skilled in the art should realize that, in one or more of the above examples, the functions described in the embodiments of the present application may be implemented by hardware, software, firmware, or any combination thereof. When implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage medium can be any available medium that can be accessed by a general purpose or special purpose computer. In addition, the numbering of the steps described in this document only exemplarily shows a possible execution sequence between the steps. In some other embodiments, the above steps may also be executed in different order, such as two different numbers. The steps are performed at the same time, or two steps with different numbers are performed in a reverse order to that shown in the figure, which is not limited in this embodiment of the present application.

以上所述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above descriptions are only optional embodiments of the present application, and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the protection of the present application. within the range.

Claims (16)

Translated fromChinese
1.一种音频播放方法,其特征在于,所述方法用于耳机,所述方法包括:1. A method for audio playback, characterized in that the method is used for earphones, and the method comprises:在第一工作状态下,对环境音进行缓存,其中,处于所述第一工作状态的耳机不对环境音进行主动透传;In the first working state, the ambient sound is buffered, wherein the earphone in the first working state does not actively transparently transmit the ambient sound;对缓存的所述环境音进行识别;Identifying the buffered ambient sound;在识别出所述环境音中包含有效环境音的情况下,将所述第一工作状态调整为第二工作状态,所述有效环境音指当前环境中具有收听需求的音频,所述第二工作状态不同于所述第一工作状态;In the case of identifying that the ambient sound contains valid ambient sounds, the first working state is adjusted to a second working state, the effective ambient sound refers to the audio that has listening needs in the current environment, and the second working state is the state is different from the first working state;在所述第二工作状态下,基于所述环境音进行环境音播放。In the second working state, ambient sound playback is performed based on the ambient sound.2.根据权利要求1所述的方法,其特征在于,所述基于所述环境音进行环境音播放,包括:2. The method according to claim 1, wherein the performing ambient sound playback based on the ambient sound comprises:播放缓存的所述环境音;play the buffered ambient sound;或者,or,对缓存的所述环境音进行增强处理,所述增强处理用于突出所述有效环境音;播放增强处理后的所述环境音。Perform enhancement processing on the buffered ambient sound, where the enhancement processing is used to highlight the effective ambient sound; and play the enhanced ambient sound.3.根据权利要求2所述的方法,其特征在于,所述对缓存的所述环境音进行增强处理,包括:3. The method according to claim 2, wherein the performing enhancement processing on the buffered ambient sound comprises:对所述环境音中的所述有效环境音进行音频增强处理,以及对所述环境音中所述有效环境音以外的声音进行音频抑制处理,得到增强处理后的所述环境音;Perform audio enhancement processing on the effective ambient sounds in the ambient sounds, and perform audio suppression processing on sounds other than the effective ambient sounds in the ambient sounds, to obtain the enhanced ambient sounds;或者,or,消除所述环境音中所述有效环境音以外的声音,得到增强处理后的所述环境音。Sounds other than the effective ambient sound in the ambient sound are eliminated to obtain the enhanced ambient sound.4.根据权利要求2所述的方法,其特征在于,所述播放缓存的所述环境音,包括:4. The method according to claim 2, wherein the playing the buffered ambient sound comprises:在不存在新的有效环境音的情况下,重复播放缓存的所述环境音;In the absence of new valid ambient sounds, playing the buffered ambient sounds repeatedly;所述播放增强处理后的所述环境音,包括:The playing of the enhanced ambient sound includes:在不存在新的有效环境音的情况下,重复播放增强处理后的所述环境音。If there is no new valid ambient sound, the enhanced ambient sound is played repeatedly.5.根据权利要求4所述的方法,其特征在于,所述方法还包括:5. The method according to claim 4, wherein the method further comprises:在所述环境音或增强处理后的所述环境音的播放次数达到次数阈值的情况下,或者,在接收到音频停止播放指令的情况下,停止播放所述环境音或增强处理后的所述环境音,所述音频停止播放指令用于指示停止当前播放的音频,所述音频停止播放指令由结束佩戴操作、对所述耳机的手势操作或者对与所述耳机相连的终端设备的控制操作中的至少一种触发;When the number of times of playing the ambient sound or the enhanced ambient sound reaches the threshold, or when receiving an instruction to stop playing audio, stop playing the ambient sound or the enhanced ambient sound. Ambient sound, the audio stop playing instruction is used to instruct to stop the currently playing audio, and the audio stop playing instruction is used in the end wearing operation, the gesture operation on the earphone, or the control operation on the terminal device connected to the earphone. at least one trigger of ;删除缓存的所述环境音或增强处理后的所述环境音。The buffered ambient sound or the enhanced ambient sound is deleted.6.根据权利要求1所述的方法,其特征在于,所述在第一工作状态下,对环境音进行缓存,包括:6. The method according to claim 1, wherein, in the first working state, buffering the ambient sound comprises:在所述第一工作状态下,进行环境音监测;In the first working state, monitoring the ambient sound;在所述监测到所述环境音的变化幅度达到幅度阈值的情况下,对环境音进行缓存,所述变化幅度包括响度变化幅度和频率变化幅度中的至少一种。In the case where it is detected that the variation range of the environmental sound reaches the range threshold, the environmental sound is buffered, and the variation range includes at least one of a loudness variation range and a frequency variation range.7.根据权利要求1所述的方法,其特征在于,所述对缓存的所述环境音进行识别,包括:7. The method according to claim 1, wherein the identifying the buffered ambient sound comprises:获取与当前耳机使用场景匹配的目标有效环境音,其中,不同耳机使用场景对应不同有效环境音;Obtain the target effective ambient sound that matches the current earphone usage scenario, wherein different earphone usage scenarios correspond to different effective ambient sounds;基于所述目标有效环境音对缓存的所述环境音进行识别;Identifying the buffered ambient sound based on the target effective ambient sound;所述在识别出所述环境音中包含有效环境音的情况下,将所述第一工作状态调整为第二工作状态,包括:The adjusting the first working state to the second working state when it is recognized that the ambient sound contains valid ambient sounds, includes:在识别出所述环境音中包含所述目标有效环境音的情况下,将所述第一工作状态调整为所述第二工作状态。When it is recognized that the ambient sound includes the target effective ambient sound, the first working state is adjusted to the second working state.8.根据权利要求7所述的方法,其特征在于,所述获取与当前耳机使用场景匹配的目标有效环境音,包括:8. The method according to claim 7, wherein the obtaining the target effective ambient sound matched with the current earphone usage scenario comprises:通过与终端设备之间建立的通信连接,获取与所述当前耳机使用场景匹配的所述目标有效环境音,所述目标有效环境音由所述终端设备基于所述当前耳机使用场景从耳机使用场景与有效环境音的对应关系中确定得到。Obtain the target effective ambient sound that matches the current earphone usage scene through the communication connection established with the terminal device, and the target effective ambient sound is obtained by the terminal device from the earphone usage scene based on the current earphone usage scene The corresponding relationship with the effective ambient sound is determined.9.根据权利要求7所述的方法,其特征在于,9. The method of claim 7, wherein在所述当前耳机使用场景为交通工具乘坐场景的情况下,所述目标有效环境音包括报站提示音;In the case that the current headset usage scene is a vehicle riding scene, the target effective ambient sound includes a station announcement sound;在所述当前耳机使用场景为室外场景的情况下,所述目标有效环境音包括交通工具警示音;In the case that the current headset usage scene is an outdoor scene, the target effective ambient sound includes a vehicle warning sound;在所述当前耳机使用场景为室内场景的情况下,所述目标有效环境音包括目标人声,所述目标人声中包含目标关键词。When the current headset usage scene is an indoor scene, the target effective ambient sound includes a target human voice, and the target human voice includes a target keyword.10.根据权利要求1所述的方法,其特征在于,所述将所述第一工作状态调整为第二工作状态,包括:10. The method according to claim 1, wherein the adjusting the first working state to the second working state comprises:在所述第一工作状态为主动降噪状态的情况下,关闭主动降噪功能;In the case that the first working state is the active noise reduction state, turning off the active noise reduction function;或者,or,在所述第一工作状态为被动降噪状态的情况下,降低当前播放音频的音量。In the case that the first working state is a passive noise reduction state, the volume of the currently playing audio is reduced.11.根据权利要求1所述的方法,其特征在于,所述方法还包括:11. The method of claim 1, wherein the method further comprises:在满足环境音播放结束条件的情况下,恢复所述第一工作状态。The first working state is restored when the conditions for ending the playing of the ambient sound are satisfied.12.根据权利要求1所述的方法,其特征在于,所述对缓存的所述环境音进行识别之后,所述方法还包括:12. The method according to claim 1, wherein after identifying the buffered environmental sound, the method further comprises:在识别出所述环境音中不包含所述有效环境音的情况下,删除缓存的所述环境音,并保持所述第一工作状态。In the case of identifying that the effective ambient sound is not included in the ambient sound, the buffered ambient sound is deleted, and the first working state is maintained.13.一种音频播放装置,其特征在于,所述装置用于耳机,所述装置包括:13. An audio playback device, wherein the device is used for earphones, and the device comprises:缓存模块,用于在第一工作状态下,对环境音进行缓存,其中,处于所述第一工作状态的耳机不对环境音进行主动透传;a buffering module, configured to buffer the ambient sound in a first working state, wherein the earphone in the first working state does not actively transparently transmit the ambient sound;识别模块,用于对缓存的所述环境音进行识别;an identification module for identifying the buffered ambient sound;调整模块,用于在识别出所述环境音中包含有效环境音的情况下,将所述第一工作状态调整为第二工作状态,所述有效环境音指当前环境中具有收听需求的音频,所述第二工作状态不同于所述第一工作状态;an adjustment module, configured to adjust the first working state to a second working state in the case of identifying that the ambient sound contains valid ambient sounds, the effective ambient sounds refer to audio that has listening needs in the current environment, the second working state is different from the first working state;播放模块,用于在所述第二工作状态下,基于所述环境音进行环境音播放。A playing module is configured to play ambient sound based on the ambient sound in the second working state.14.一种耳机,其特征在于,所述耳机包括处理器和存储器;所述存储器中存储有至少一段程序,所述至少一段程序由所述处理器加载并执行以实现如权利要求1至12任一所述的音频播放方法。14. An earphone, characterized in that the earphone comprises a processor and a memory; at least a section of program is stored in the memory, and the at least one section of program is loaded and executed by the processor to realize the steps of claims 1 to 12 Any of the audio playback methods described.15.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有至少一段程序,所述至少一段程序由处理器加载并执行以实现如权利要求1至12任一所述的音频播放方法。15. A computer-readable storage medium, characterized in that, the computer-readable storage medium stores at least one section of program, and the at least one section of program is loaded and executed by a processor to realize any one of claims 1 to 12. the audio playback method described above.16.一种计算机程序产品,其特征在于,所述计算机程序产品包括计算机指令,所述计算机指令存储在计算机可读存储介质中;耳机的处理器从所述计算机可读存储介质读取所述计算机指令,所述处理器执行所述计算机指令,使得所述耳机执行如权利要求1至12任一所述的音频播放方法。16. A computer program product, characterized in that the computer program product comprises computer instructions, and the computer instructions are stored in a computer-readable storage medium; the processor of the headset reads the computer-readable storage medium. Computer instructions, the processor executes the computer instructions, so that the earphone performs the audio playback method according to any one of claims 1 to 12.
CN202210819198.0A2022-07-122022-07-12Audio playing method, device, earphone and storage mediumPendingCN115209298A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202210819198.0ACN115209298A (en)2022-07-122022-07-12Audio playing method, device, earphone and storage medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202210819198.0ACN115209298A (en)2022-07-122022-07-12Audio playing method, device, earphone and storage medium

Publications (1)

Publication NumberPublication Date
CN115209298Atrue CN115209298A (en)2022-10-18

Family

ID=83579758

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202210819198.0APendingCN115209298A (en)2022-07-122022-07-12Audio playing method, device, earphone and storage medium

Country Status (1)

CountryLink
CN (1)CN115209298A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN115835079A (en)*2022-11-212023-03-21荣耀终端有限公司Transparent transmission mode switching method and switching device
CN118785048A (en)*2024-09-092024-10-15荣耀终端有限公司 Audio processing system, method and electronic device

Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN107492376A (en)*2017-07-072017-12-19佛山科学技术学院A kind of sound recognition system and its recognition methods based on Intelligent earplug
CN112767908A (en)*2020-12-292021-05-07安克创新科技股份有限公司Active noise reduction method based on key sound recognition, electronic equipment and storage medium
CN113194383A (en)*2021-04-292021-07-30歌尔科技有限公司Sound playing method and device, electronic equipment and readable storage medium
CN113539282A (en)*2020-04-202021-10-22罗伯特·博世有限公司 Sound processing device, system and method
CN113938785A (en)*2021-11-242022-01-14英华达(上海)科技有限公司 Noise reduction processing method, device, device, earphone and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN107492376A (en)*2017-07-072017-12-19佛山科学技术学院A kind of sound recognition system and its recognition methods based on Intelligent earplug
CN113539282A (en)*2020-04-202021-10-22罗伯特·博世有限公司 Sound processing device, system and method
CN112767908A (en)*2020-12-292021-05-07安克创新科技股份有限公司Active noise reduction method based on key sound recognition, electronic equipment and storage medium
CN113194383A (en)*2021-04-292021-07-30歌尔科技有限公司Sound playing method and device, electronic equipment and readable storage medium
CN113938785A (en)*2021-11-242022-01-14英华达(上海)科技有限公司 Noise reduction processing method, device, device, earphone and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN115835079A (en)*2022-11-212023-03-21荣耀终端有限公司Transparent transmission mode switching method and switching device
CN115835079B (en)*2022-11-212023-08-08荣耀终端有限公司Transparent transmission mode switching method and switching device
CN118785048A (en)*2024-09-092024-10-15荣耀终端有限公司 Audio processing system, method and electronic device

Similar Documents

PublicationPublication DateTitle
CN112019962B (en) Context-based ambient sound enhancement and acoustic noise cancellation
CN114080589B (en)Automatic Active Noise Reduction (ANR) control to improve user interaction
CN113949956B (en) Noise reduction processing method, device, electronic equipment, headphones and storage medium
US11251763B2 (en)Audio signal adjustment method, storage medium, and terminal
KR102240898B1 (en)System and method for user controllable auditory environment customization
CN110493678B (en)Earphone control method and device, earphone and storage medium
CN108551604B (en)Noise reduction method, noise reduction device and noise reduction earphone
US20230008818A1 (en)Sound masking method and apparatus, and terminal device
US20170318374A1 (en)Headset, an apparatus and a method with automatic selective voice pass-through
CN106797508B (en)For improving the method and earphone of sound quality
CN109918039B (en) A kind of volume adjustment method and mobile terminal
CN113038337B (en)Audio playing method, wireless earphone and computer readable storage medium
WO2017215657A1 (en)Sound effect processing method, and terminal device
CN115209298A (en)Audio playing method, device, earphone and storage medium
CN114640938B (en)Hearing aid function implementation method based on Bluetooth headset chip and Bluetooth headset
CN108282575A (en)Method for controlling volume, mobile terminal and computer readable storage medium
CN106686481A (en) A kind of earphone noise reduction method and earphone
US20250133364A1 (en)Automatic Acoustic Handoff
CN109873894B (en) A kind of volume adjustment method and mobile terminal
CN114710730B (en) Volume prompt method, device, earphone and storage medium
CN110058837A (en)A kind of audio-frequency inputting method and terminal
US20230260526A1 (en)Method and electronic device for personalized audio enhancement
CN108076230A (en)In Call adjusting method, mobile terminal and computer readable storage medium
CN204633973U (en) Earphone and its voice recognition device
CN112532787B (en)Earphone audio data processing method, mobile terminal and computer readable storage medium

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination

[8]ページ先頭

©2009-2025 Movatter.jp