WO2019033986A1 - Sound playback device detection method, apparatus, storage medium, and terminal - Google Patents

Sound playback device detection method, apparatus, storage medium, and terminal Download PDF

Info

Publication number
WO2019033986A1
WO2019033986A1 PCT/CN2018/099660 CN2018099660W WO2019033986A1 WO 2019033986 A1 WO2019033986 A1 WO 2019033986A1 CN 2018099660 W CN2018099660 W CN 2018099660W WO 2019033986 A1 WO2019033986 A1 WO 2019033986A1
Authority
WO
WIPO (PCT)
Prior art keywords
sound
audio signal
preset
playing device
volume level
Prior art date
Application number
PCT/CN2018/099660
Other languages
French (fr)
Chinese (zh)
Inventor
许钊铵
严锋贵
甘高亭
郑志勇
杨海
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2019033986A1 publication Critical patent/WO2019033986A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R29/00Monitoring arrangements; Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R2420/00Details of connection covered by H04R, not provided for in its groups
    • H04R2420/05Detection of connection of loudspeakers or headphones to amplifiers

Definitions

  • the present disclosure relates to the field of terminal technologies, for example, to a method, an apparatus, a storage medium, and a terminal for detecting a sound playing device.
  • the terminal can play sound by using a sound playing device such as a speaker or an earpiece, wherein the earpiece is used for a call.
  • a sound playing device such as a speaker or an earpiece
  • the sounding principle of the speaker and the earpiece is basically the same, which is the process of converting electrical energy into mechanical energy and converting mechanical energy into sound energy by using the principle of electromagnetic induction.
  • the coil in the speaker when the coil in the speaker is energized, the coil generates a magnetic field. Under the interaction with the magnetic field of the magnet, the coil vibrates, thereby driving the vibration of the diaphragm, and the diaphragm discharges the air to realize the sound.
  • the present disclosure provides a method, device, storage medium and terminal for detecting a sound playing device, which can automatically detect a sound playing device.
  • a method for detecting a sound playing device comprising: detecting that a detection event of a sound playing device is triggered, playing a preset audio file through a sound playing device at a preset volume level, and controlling a microphone to collect a sample audio signal; The signal is compared with a preset audio signal, wherein the preset audio signal is played at the preset volume level in the absence of foreign matter at the sounding position of the sound playing device and passes through the preset audio file. Depicting an audio signal collected by the microphone; and determining that there is a foreign object in the sounding position of the sound playing device when the comparison result satisfies the preset condition.
  • a detecting device for a sound playing device comprising: a playing control module configured to play a preset audio file through a sound playing device at a preset volume level when a detection event of the sound playing device is detected is triggered.
  • the audio collection control module is configured to control the microphone to collect the sample audio signal while playing the preset audio file through the sound playback device at a preset volume level.
  • a signal comparison module configured to compare the sample audio signal with a preset audio signal, wherein the preset audio signal is at the preset volume without a foreign object in a sounding position of the sound playing device Level playing the preset audio file and the audio signal collected by the microphone.
  • the foreign matter determination module is configured to determine that there is a foreign object in the sounding position of the sound playing device when the comparison result satisfies the preset condition.
  • a computer readable storage medium having stored thereon a computer program that, when executed by a processor, implements a method of detecting a sound playback device as described in the present disclosure.
  • a mobile terminal comprising a microphone, a sound playing device, a memory, a processor, and a computer program stored on the memory and operable on the processor, the processor executing the computer program to implement sound playback as described in the present disclosure Device detection method.
  • FIG. 1 is a schematic flow chart of a method for detecting a sound playing device according to an embodiment
  • FIG. 2 is a schematic structural diagram of an audio processing hardware system of a smart phone according to an embodiment
  • FIG. 3 is a block diagram of an audio system architecture provided by an embodiment
  • FIG. 4 is a schematic flow chart of a method for detecting a speaker according to an embodiment
  • FIG. 5 is a schematic flowchart of a method for detecting an earpiece according to an embodiment
  • FIG. 6 is a structural block diagram of a detecting apparatus of a sound playing device according to an embodiment
  • FIG. 7 is a schematic structural diagram of a terminal according to an embodiment.
  • FIG. 1 is a schematic flowchart diagram of a method for detecting a sound playing device according to an embodiment of the present invention.
  • the method may be performed by a control device of a screen display, wherein the device may be implemented by software and/or hardware, and may be integrated into a terminal.
  • the method includes the following steps.
  • step 101 when it is detected that the detection event of the sound playing device is triggered, the preset audio file is played by the sound playing device at a preset volume level and the microphone is controlled to collect the sample audio signal.
  • the terminal in this embodiment may include a device configured with a microphone and a sound playing device, such as a mobile phone, a tablet computer, a music player, and a voice recorder.
  • a sound playing device such as a mobile phone, a tablet computer, a music player, and a voice recorder.
  • the microphone can be either built-in or external.
  • a microphone (referred to as a microphone, also known as a microphone or a microphone) is an energy conversion device that converts a sound signal into an electrical signal.
  • the vibration of the sound is transmitted to the diaphragm of the microphone, the magnet inside changes a current signal.
  • the current signal is processed by the sound processing circuit and transmitted to the opposite end of the call or stored, thereby implementing a call or recording.
  • the type, the number, and the location of the microphone are not limited. For example, for a mobile phone, it may be one or more electret microphones disposed on the lower side of the mobile phone.
  • the sound playing device in this embodiment may include a speaker or an earpiece or the like.
  • the sounding principle of the speaker and the earpiece is basically the same, which is the process of converting electrical energy into mechanical energy and converting mechanical energy into sound energy by using the principle of electromagnetic induction.
  • the speaker when the coil in the speaker is energized, the coil generates a magnetic field. Under the interaction with the magnetic field of the magnet, the coil vibrates, thereby driving the vibration of the diaphragm, and the diaphragm discharges the air to realize the sound.
  • the automatic detection function added by the terminal can be automatically detected by the terminal when there is a foreign object in the sounding position of the sound playing device.
  • the detection event of the sound playing device can be automatically triggered by the system, for example, the condition of the sound playing device detecting event is preset in the system, and the condition may be that the terminal is detected when the device is powered on, or may be detected at a preset time interval, or may be When a sound playback request is received, etc.; it may also be triggered according to a user operation, such as an option to trigger a sound playback device detection event in the system setting menu of the terminal, and when the user selects the option, the detection event of the sound playback device is triggered.
  • the trigger conditions for the corresponding speaker detection event and handset detection event may be different.
  • the following takes the smart phone as an example to introduce the audio processing hardware system and system architecture.
  • FIG. 2 is a schematic structural diagram of an audio processing hardware system of a smart phone according to an embodiment of the present invention.
  • the audio processing circuit is usually in the main control board. The location of the audio processing circuit may be different due to the different designs of different mobile phones.
  • the audio processing circuit of the smartphone includes an audio signal processing circuit, a baseband signal processing circuit, an audio power amplifier, a headphone signal amplifier, an earpiece, a speaker, a microphone, and a headphone interface. Among them, the audio signal processing circuit is the core of the entire audio processing circuit.
  • the audio processing circuit is composed of a receiving audio circuit, a sending circuit, a headphone talking circuit, and the like, including analog/digital (A/D) conversion, digital/analog (A/D) conversion, digital voice signal processing, and analog audio amplification of analog audio. Circuits, etc.
  • the local microphone is first called to convert the sound acoustic signal of the sound into an analog audio signal, amplified by an analog audio amplifier circuit, and subjected to A/D conversion by an internal multimode converter to obtain a digital audio signal;
  • the digital audio signal is sent to the baseband processor for speech encoding, channel encoding, etc.; a series of processing such as encryption and interleaving is performed again; finally, the digital narrowband modulation module sent to the baseband processor is modulated to generate the transmitted baseband signal and sent to the radio frequency.
  • the circuit is modulated into a transmitting intermediate frequency and sent to the other party.
  • the baseband information is first demodulated from the radio frequency circuit, sent to the baseband processor for digital narrowband demodulation, and the control signal and the voice signal are separated; secondly, the voice signal is decrypted, deinterleaved, recombined, etc. Processing, then performing channel decoding and speech decoding; finally obtaining a pure digital speech signal, which is sent to a multi-mode converter in the speech signal processor for D/A conversion; after being restored to an analog audio signal, after the audio power is amplified, the handset is sounded . If the speakerphone is selected, the baseband processor turns off the handset receiver amplifier, activates the hands-free receiver amplifier (ringing amplifier), and amplifies the audio signal power to push the speaker to sound.
  • the baseband processor turns off the handset receiver amplifier, activates the hands-free receiver amplifier (ringing amplifier), and amplifies the audio signal power to push the speaker to sound.
  • the mechanical sound wave signal of the sound is first converted into an analog audio signal by a microphone, amplified by an analog audio amplifying circuit, and digital audio signal is obtained after A/D conversion, according to a preset audio format. Coding and storage.
  • the audio file is decoded to obtain a digital audio signal, which is converted into an analog audio signal after D/A conversion, and the audio signal power is amplified to drive the speaker to sound.
  • a preset audio file may be stored in the terminal in advance, and the preset audio file is played.
  • the pre-stored audio file and the preset volume level can be selected by the designer according to the actual situation, and the preset audio file and/or the preset volume level corresponding to different sound playing devices can be different.
  • the audio signal collected by the microphone may be the above-mentioned analog audio signal converted from the mechanical sound wave signal, or may be an amplified analog audio signal, or may be an A/D converted digital audio signal, etc., according to the signal.
  • the different forms are respectively set corresponding to the preset conditions below.
  • the terminal In order to facilitate the interaction between the terminal and the user, the terminal generally provides a volume adjustment function to the user, and the user can adjust the volume level of the sound played by the terminal by adjusting the volume adjustment button or the volume adjustment progress bar, and the terminal adjusts according to the user.
  • the volume level of the audio signal to be played is correspondingly amplified, such as power amplification, to meet the user's listening needs.
  • the division strategy for the volume level may be different in different terminals, that is, the total number of volume levels and the volume level corresponding to each volume level may be different.
  • the audio system architecture provided in this embodiment includes a user space, a kernel space, and a hardware system.
  • the user space includes an application layer, an application framework layer, and a hardware abstraction layer (HAL).
  • the kernel space includes a driver layer, and the hardware system includes a speaker.
  • the application layer is the top layer of the audio system. You can write an application to perform corresponding logical operations, such as detecting an application that triggers a recording event, presetting standard audio conditions, and issuing audio playback commands.
  • the application framework layer includes an audio control interface and a standardized plug-in module to provide an audio playback form control interface, as well as a speaker volume control interface.
  • the application framework layer provides two classes, AudioTrack and AudioRecorder, as well as the AudioManager, AudioService, and AudioSystem classes.
  • a system runtime layer (Libraries) is also included between the application framework layer and the hardware abstraction layer.
  • Many of the classes in the Framework layer are actually just "mediations” for applications that use Android library files.
  • upper-level applications are generally written in Java, they require the most direct support of the Java interface, which is one of the meanings of the framework layer.
  • the framework layer does not really implement specific functions, or only implement some of the functions, but focus on the library to complete. For example, the above AudioTrack, AudioRecorder, MediaPlayer and MediaRecorder can find the corresponding class in the library.
  • the hardware abstraction layer of audio is divided into two parts, namely AudioFlinger and AudioPolicyService. In fact, the latter is not a real device, just a virtual device to allow manufacturers to easily customize their own strategies. Depending on the product, audio devices vary widely. In the audio architecture of Android, these problems are solved by the audio.primary of the HAL layer, etc., without the need to modify the upper layer implementation on a large scale.
  • the hardware abstraction layer is the transition from the application framework layer to the driver layer to achieve compatibility with the underlying hardware.
  • the driver layer controls the audio codec according to the characteristics of the audio codec to ensure that the audio codec can work normally, and the audio data obtained by the audio codec is provided to the system layer.
  • the designed class is the above-mentioned AudioTrack class; when the audio signal is collected, the class involved is the above-mentioned AudioRecorder class.
  • step 102 the sample audio signal is compared to a preset audio signal.
  • the preset audio signal is an audio signal that is played by the preset audio file at the preset volume level and is collected by the microphone in the absence of a foreign object in the sounding position of the sound playing device.
  • the preset audio signal can be recorded and stored by the terminal before leaving the factory, or can be recorded and stored by the user without confirming the occurrence of the sound playing device.
  • the preset audio signal may be an analog audio signal converted from a mechanical sound wave signal as described above, or may be an amplified analog audio signal, or may be an A/D converted digital audio. Signals, etc.
  • the sample audio signal corresponds to a preset audio signal, that is, when the preset audio signal is an analog audio signal converted from a mechanical sound wave signal, the sample audio signal is also an analog audio signal converted from a mechanical sound wave signal;
  • the preset audio signal is an amplified analog audio signal
  • the sample audio signal is also an amplified analog audio signal, and the amplification processing is the same, and the magnification is the same. Comparing the amplified analog audio signals makes it easier to compare the differences between the two.
  • the speaker or the earpiece needs to be ventilated to achieve sound, and when there is a foreign object in the sounding position of the speaker or the earpiece, the corresponding playback volume is generally reduced. If there is a foreign object in the sounding position of the speaker, the playback volume will be smaller when the preset audio signal is played through the speaker, and the sound volume corresponding to the sample audio signal collected by the microphone is smaller than that of the foreign object. The situation will also be smaller.
  • the playing volume when playing the preset audio signal through the earpiece will become smaller than that in the case where no foreign matter exists, so the sound volume corresponding to the sample audio signal collected by the microphone is compared with The situation of foreign matter will also become smaller. Therefore, the sample audio signal can be compared with the preset audio signal to determine whether or not foreign matter is present based on the comparison result.
  • the three properties of the sound are volume, pitch, and tone.
  • the volume is also called loudness or sound intensity, which refers to the subjective feeling of the human ear on the strength of the sound heard.
  • the objective evaluation scale is the amplitude of the sound. Amplitude refers to the maximum distance from the original position during the vibration of the object.
  • the loudness of the sound heard by the human ear is related to the amplitude of the sound source. Generally, the louder the louder the stronger the amplitude.
  • step 103 when the comparison result satisfies the preset condition, it is determined that there is a foreign object in the sounding position of the sound playing device.
  • the preset conditions can be determined experimentally or by simulation. Due to the difference in the playing environment, the sample audio signal may not be exactly the same as the preset audio signal, and when the difference between the two is within a certain preset range, it may be considered that there is no foreign object currently, and the difference between the two exceeds the preset range. At the time, it is considered that there is a foreign matter in the sounding position of the sound playing device.
  • the detecting method of the sound playing device detects that when the detecting event of the sound playing device is triggered, playing the preset audio file through the sound playing device at a preset volume level and controlling the microphone to collect the sample audio signal, the sample audio is The signal is compared with the preset audio signal, and when the comparison result satisfies the preset condition, it is determined that there is a foreign object in the sounding position of the sound playing device.
  • the terminal can automatically detect that the sound playing device such as the speaker or the earpiece is blocked by foreign matter, enriching the function of the terminal.
  • the detecting method of the sound playing device before the comparing the sample audio signal with the preset audio signal, further comprises: performing denoising processing on the sample audio signal to filter out the playing environment.
  • the interference of the noise on the sample audio signal In this embodiment, the sounds that are not related to the sound in the preset audio file are considered to be the noise of the playing environment. For example, when playing the preset audio file, someone next to them speaks loudly, or there is a car whistle, etc. Since the comparison result causes a large interference, the above-described operation of denoising the sample audio signal can improve the accuracy of determining whether or not foreign matter is present, and preventing a misjudgment.
  • the first sound level of the sample audio signal corresponding to the same preset time period may be compared with the second sound level of the preset audio signal to obtain a sound level comparison result.
  • the first acoustic sound level includes an amplitude average value of the sample audio signal in the preset time period
  • the second sound sound level includes an amplitude average value of a preset audio signal in the preset time period. Since the playing of the preset audio file and the audio signal acquisition of the microphone are performed simultaneously, the sound content corresponding to the preset audio signal is substantially the same, and the sound level of the two audio signals corresponding to the same preset time period is Can be used to measure the presence of foreign objects in the sounding position of the sound playback device.
  • the start time, duration, and number of preset time periods can be set according to the characteristics of the preset audio file. For example, it may be that the 5th to 15th seconds of the start of recording is the preset time period, or may be the 5th second of the start of recording, and then the time period of each time of 1 second is a preset time period.
  • determining that the sounding position of the sound playing device has a foreign object when the comparison result satisfies the preset condition including: when the sound sound level comparison result includes the first sound level is less than the first
  • the preset ratio value may be set according to actual needs, and may generally be less than 1, such as 0.9, and may of course be equal to 1.
  • the first sound level is greater than or equal to a product of the second sound level and a preset ratio value, determining that the sounding position of the sound playing device is not There is a foreign object.
  • the detecting method of the sound playing device further comprises: adjusting the current playing mode to improve the playing when the sound playing event is monitored volume.
  • the current play mode can be adjusted to increase the playback volume.
  • the first one is to adjust the gain of the analog audio signal to be played by adjusting the hardware gain to increase the magnification, thereby increasing the playback volume.
  • processing the audio data to be played such as multiplying the audio data by a preset.
  • the adjustment method is simple and fast, the response speed is fast, and the impact on the audio itself to be played is small, and the distortion is avoided.
  • the detecting method of the sound playing device further comprises: determining a corresponding sound level according to the product and the first sound level Adjusting a value; the sound playing by the sound playing device at a target volume level, comprising: determining a target volume level according to a set value of a current volume level and the volume level adjustment value; and passing the sound at the target volume level Play the device for sound playback.
  • the corresponding volume level adjustment value may be determined according to the difference between the product and the first sound level, and the terminal may pre-store the correspondence between different difference values and the volume level adjustment value; or according to the product and The quotient of the first sound level determines the corresponding volume level adjustment value, and the terminal can pre-store the correspondence between different quotient and volume level adjustment values.
  • the detecting method of the sound playing device further comprises: controlling the sound playing device to generate the ultrasonic wave.
  • Such a setting can automatically clear the foreign matter present at the sounding position.
  • the preset audio file may be played again, and the related operations described above are performed to determine whether the foreign object has been cleared.
  • FIG. 4 is a schematic flowchart diagram of a method for detecting a speaker according to an embodiment of the present invention, where the method includes the following steps.
  • step 401 when it is detected that the speaker detection event is triggered, the preset audio file is played through the speaker at a preset volume level a and the microphone is controlled to acquire the sample audio signal.
  • the speaker can also be replaced by a sound playback device such as an earpiece.
  • step 402 the first sound level A of the sample audio signal corresponding to the same preset time period is compared with the second sound level B of the preset audio signal to obtain a sound level comparison result.
  • step 403 it is determined whether A is smaller than k ⁇ B. If A is smaller than k ⁇ B, step 404 is performed; if A is greater than or equal to k ⁇ B, the flow is ended. Where k is the preset scale value and "x" is the multiplication operation.
  • step 404 it is determined that there is a foreign object in the sounding position of the speaker.
  • a corresponding volume level adjustment value b is determined based on the value of (k x B-A), and "-" is a subtraction operation.
  • the terminal may pre-store the correspondence between different difference values and volume level adjustment values, and determine the volume level adjustment value b according to the value of (k ⁇ B-A) and the correspondence between the previously stored different difference values and the volume level adjustment values.
  • step 407 sound playback is performed through the speaker at the target volume level d.
  • the method for detecting the speaker provided in this embodiment can automatically detect whether there is a foreign object in the sounding position of the speaker, and when there is a foreign object, raise the volume level to ensure that the played sound is not affected by the presence of foreign matter.
  • FIG. 5 is a schematic flowchart of a method for detecting an earpiece according to an embodiment of the present invention, where the method includes the following steps.
  • step 501 when it is detected that the earpiece detection event is triggered, the preset audio file is played through the speaker at a preset volume level e and the microphone is controlled to acquire the sample audio signal.
  • the earpiece can also be replaced by a sound playback device such as a speaker.
  • step 502 the sample audio signal is denoised to filter out interference of the noise in the playback environment to the sample audio signal.
  • step 503 the first sound level C of the sample audio signal corresponding to the same preset time period is compared with the second sound level D of the preset audio signal to obtain a sound level comparison result.
  • step 504 it is determined whether C is less than y ⁇ D. If C is less than y ⁇ D, step 505 is performed; if C is greater than or equal to y ⁇ D, the flow is ended. Where y is the preset scale value and "x" is the multiplication operation.
  • step 505 it is determined that there is a foreign object in the sounding position of the earpiece.
  • a corresponding volume level adjustment value f is determined based on the value of (y x D ⁇ C), and " ⁇ " is a division operation.
  • the terminal may pre-store the correspondence between different quotient and volume level adjustment values, and determine the volume level adjustment value f according to the value of (y ⁇ D ⁇ C) and the correspondence between the different quotient and volume level adjustment values stored in advance. .
  • the target volume level h [g x f] is determined based on the set value g of the current volume level and the volume level adjustment value f, and [] is a rounding operation.
  • step 508 the sound is played through the earpiece at the target volume level h.
  • the method for detecting the earpiece provided by the embodiment can automatically detect whether there is a foreign object in the sounding position of the earpiece, and when there is a foreign object, raise the volume level to ensure that the user hears the voice of the opposite end when using the terminal to talk with another person.
  • the size is not affected by the presence of foreign objects.
  • FIG. 6 is a structural block diagram of a detecting apparatus of a sound playing device according to an embodiment of the present invention.
  • the device may be implemented by software and/or hardware, and is generally integrated in a terminal, and the sound playing device may be implemented by executing a detecting method of the sound playing device. The foreign matter at the utterance position is detected.
  • the device includes the following modules.
  • the play control module 601 is configured to play the preset audio file through the sound playing device at a preset volume level when the detection event that the sound playing device is detected is triggered.
  • the audio collection control module 602 is configured to control the microphone to acquire the sample audio signal while playing the preset audio file through the sound playing device at a preset volume level.
  • the signal comparison module 603 is configured to compare the sample audio signal with a preset audio signal, wherein the preset audio signal is the preset in the case where no foreign object exists in the sounding position of the sound playing device.
  • the volume level plays the preset audio file and the audio signal collected by the microphone.
  • the foreign object determination module 604 is configured to determine that there is a foreign object in the sounding position of the sound playing device when the comparison result satisfies the preset condition.
  • the detecting device of the sound playing device detects that the detecting event of the sound playing device is triggered, plays the preset audio file through the sound playing device at a preset volume level, and controls the microphone to collect the sample audio signal, and the sample audio signal is Comparing with the preset audio signal, when the comparison result satisfies the preset condition, it is determined that there is a foreign object in the sounding position of the sound playing device.
  • the terminal can automatically detect that the sound playing device such as the speaker or the earpiece is blocked by foreign matter, enriching the function of the terminal.
  • the apparatus may further include a denoising module configured to perform denoising processing on the sample audio signal to compare the sample audio signal with the preset audio signal to filter out the playing environment. The interference of the noise on the sample audio signal.
  • a denoising module configured to perform denoising processing on the sample audio signal to compare the sample audio signal with the preset audio signal to filter out the playing environment. The interference of the noise on the sample audio signal.
  • the signal comparison module is further configured to: compare a first sound level of the sample audio signal corresponding to the same preset time period with a second sound level of the preset audio signal to obtain an acoustic sound level Comparing results.
  • the foreign object determination module is further configured to: when the sound intensity comparison result includes the product of the first sound level being less than the product of the second sound level and a preset ratio value, determining the There is a foreign object in the sounding position of the sound playback device.
  • the device may further include a play adjustment module, configured to adjust the current play mode to improve the play after the sound play event is detected after the determining that the sound play position of the sound playing device exists. volume.
  • a play adjustment module configured to adjust the current play mode to improve the play after the sound play event is detected after the determining that the sound play position of the sound playing device exists. volume.
  • the play adjustment module is further configured to: perform sound play by the sound playback device at a target volume level, wherein the target volume level is higher than a set value of the current volume level.
  • the apparatus may further include an adjustment value determining module configured to determine a corresponding volume according to the product and the first acoustic sound level after the determining that there is a foreign object in the sounding position of the sound playing device
  • the level adjustment value is further set to: determine a target volume level according to the set value of the current volume level and the volume level adjustment value; and perform sound playback by the sound playing device at the target volume level.
  • the present embodiment also provides a storage medium containing computer executable instructions for performing a prompting method when executed by a computer processor, the method comprising the following steps.
  • the preset audio file is played by the sound playing device at a preset volume level and the microphone is controlled to collect the sample audio signal.
  • Storage Media Any of various types of memory devices or storage devices, including non-transitory storage media.
  • the term "storage medium” is intended to include: a mounting medium such as a CD-ROM, a floppy disk or a tape device; a computer system memory or a random access memory such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.
  • Non-volatile memory such as flash memory, magnetic media (such as hard disk or optical storage); registers or other similar types of memory elements, and the like.
  • the storage medium may also include other types of memory or a combination thereof.
  • the storage medium may be located in a first computer system in which the program is executed, or may be located in a different second computer system, the second computer system being coupled to the first computer system via a network, such as the Internet.
  • the second computer system can provide program instructions to the first computer for execution.
  • the term "storage medium" can include two or more storage media that can reside in different locations (eg, in different computer systems connected through a network).
  • a storage medium may store program instructions (eg, implemented as a computer program) executable by one or more processors.
  • a storage medium containing computer executable instructions, the computer executable instructions being configured to perform the detecting operation of the sound playing device as described above, and the sound playing device provided by any embodiment of the present disclosure may also be provided. Related operations in the detection method.
  • FIG. 7 is a schematic structural diagram of a terminal according to an embodiment of the present disclosure.
  • the terminal may be, for example, a mobile terminal.
  • the terminal may include a casing (not shown), a memory 701, and a central processing unit (CPU) 702 (also referred to as a processor, below).
  • CPU central processing unit
  • a circuit board not shown
  • a power supply circuit not shown
  • a microphone 713 a microphone 713
  • a sound playback device such as speaker 711 in the figure.
  • the circuit board is disposed inside a space enclosed by the casing; the CPU 702 and the memory 701 are disposed on the circuit board; and the power circuit is configured to supply power to a plurality of circuits or devices of the terminal
  • the memory 701 is configured to store executable program code; the CPU 702 runs a computer program corresponding to the executable program code by reading executable program code stored in the memory 701 to implement the following steps.
  • the preset audio file is played by the sound playing device at a preset volume level and the microphone is controlled to collect the sample audio signal.
  • the terminal further includes: a peripheral interface 703, an RF (Radio Frequency) circuit 705, an audio circuit 706, a speaker 711, a power management chip 708, an input/output (I/O) subsystem 709, a touch screen 712, and other inputs.
  • RF Radio Frequency
  • I/O input/output
  • Control device 710 and external port 704 these components communicate via one or more communication buses or signal lines 707.
  • the illustrated terminal 700 is merely one example of a terminal, and the terminal 700 may have more or fewer components than those shown in the figures, two or more components may be combined, or may have different component configurations.
  • the various components shown in the figures can be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
  • the following describes the terminal for prompting the user provided in this embodiment, and the terminal takes a mobile phone as an example.
  • the memory 701 can be accessed by the CPU 702, the peripheral interface 703, etc., and the memory 701 can include a high speed random access memory, and can also include a non-volatile memory, such as one or more magnetic disk storage devices, flash memory devices. Or other volatile solid-state storage devices.
  • a non-volatile memory such as one or more magnetic disk storage devices, flash memory devices. Or other volatile solid-state storage devices.
  • Peripheral interface 703, which can connect the input and output peripherals of the device to CPU 702 and memory 701.
  • the I/O subsystem 709 can connect input and output peripherals on the device, such as touch screen 712 and other input/control devices 710, to peripheral interface 703.
  • the I/O subsystem 709 can include a display controller 7091 and one or more input controllers 7092 for controlling other input/control devices 710.
  • one or more input controllers 7092 receive electrical signals from other input/control devices 710 or transmit electrical signals to other input/control devices 710, and other input/control devices 710 may include physical buttons (press buttons, rocker buttons, etc.) ), dial, slide switch, joystick, click wheel.
  • the input controller 7092 can be connected to any of the following: a keyboard, an infrared port, a USB interface, and a pointing device such as a mouse.
  • the touch screen 712 is an input interface and an output interface between the user mobile terminal and the user, and displays the visual output to the user.
  • the visual output may include graphics, text, icons, videos, and the like.
  • Display controller 7091 in I/O subsystem 709 receives an electrical signal from touch screen 712 or an electrical signal to touch screen 712.
  • Touch screen 712 detects contact on the touch screen
  • display controller 7091 converts the detected contact into interaction with a user interface object displayed on touch screen 712, ie, implements human-computer interaction
  • the user interface object displayed on touch screen 712 can be operational
  • the device may further comprise a light mouse, which is a touch sensitive surface that does not display a visual output, or an extension of a touch sensitive surface formed by the touch screen.
  • the RF circuit 705 is configured to establish communication between the mobile phone and the wireless network (ie, the network side) to implement data reception and transmission between the mobile phone and the wireless network. For example, sending and receiving short messages, emails, and the like.
  • the RF circuit 705 receives and transmits an RF signal, also referred to as an electromagnetic signal, which converts the electrical signal into an electromagnetic signal or converts the electromagnetic signal into an electrical signal and communicates with the communication network and other devices through the electromagnetic signal.
  • the RF circuit 705 may include known circuitry for performing these functions, including an antenna system, an RF transceiver, one or more amplifiers, a tuner, one or more oscillators, a digital signal processor, a codec (COder) -DECoder, CODEC) Chipset, Subscriber Identity Module (SIM), etc.
  • an antenna system an RF transceiver, one or more amplifiers, a tuner, one or more oscillators, a digital signal processor, a codec (COder) -DECoder, CODEC) Chipset, Subscriber Identity Module (SIM), etc.
  • COder codec
  • CODEC CODEC
  • SIM Subscriber Identity Module
  • the audio circuit 706 is arranged to receive audio data from the peripheral interface 703, convert the audio data into an electrical signal, and transmit the electrical signal to the speaker 711.
  • the speaker 711 is arranged to restore the voice signal received by the mobile phone from the wireless network through the RF circuit 705 to sound and play the sound to the user.
  • the power management chip 708 is configured to provide power and power management for the hardware connected to the CPU 702, the I/O subsystem, and the peripheral interface.
  • the terminal provided in this embodiment can automatically detect that the sound playing device such as the speaker or the earpiece is blocked by foreign matter, thereby enriching the function of the terminal.
  • the detecting device and the terminal of the sound playing device provided in the above embodiments may perform the detecting method of the sound playing device provided by any embodiment of the present disclosure, and have a corresponding functional module for performing the method.
  • a corresponding functional module for performing the method For details of the techniques not described in the above embodiments, reference may be made to the method of detecting a sound playing device provided by any of the embodiments of the present disclosure.

Abstract

Provided are a sound playback device detection method, apparatus, storage medium, and terminal. The method comprises: if it is detected that a detection event of a sound playback device has been triggered, playing a preset audio file at a preset volume level by means of the sound playback device and controlling a microphone to acquire a sample audio signal; comparing the sample audio signal to a preset audio signal, said preset audio signal being an audio signal of a preset audio file which is played at a preset volume level when no foreign objects are present at the sound position of the sound playback device and which is acquired by means of the microphone; if the result of comparison satisfies a preset condition, then determining that a foreign object is present at the sound position of the sound playback device.

Description

声音播放器件的检测方法、装置、存储介质及终端Method, device, storage medium and terminal for detecting sound playing device
本公开要求申请日为2017年8月18日、申请号为201710710680.X的中国专利申请的优先权,该申请的全部内容通过引用结合在本公开中。The present application claims the priority of the Chinese Patent Application Serial No. PCT Application No.
技术领域Technical field
本公开涉及终端技术领域,例如涉及一种声音播放器件的检测方法、装置、存储介质及终端。The present disclosure relates to the field of terminal technologies, for example, to a method, an apparatus, a storage medium, and a terminal for detecting a sound playing device.
背景技术Background technique
为了满足用户在生活以及工作中的语音通话、视频通话、收听音乐以及观看视频等视听需求,多数终端都具备音频播放功能,如手机、平板电脑、音乐播放器以及录音笔等。In order to meet the audio and video needs of users in life and work, such as voice calls, video calls, music listening and watching videos, most terminals have audio playback functions, such as mobile phones, tablets, music players and voice recorders.
终端可利用扬声器或听筒等声音播放器件来播放声音,其中,听筒用于通话。扬声器和听筒的发声原理基本相同,是利用电磁感应原理将电能转化为机械能,并将机械能转化为声能的过程。以扬声器为例,扬声器中的线圈通电时,其线圈就会产生磁场,在与磁铁的磁场相互作用下,线圈振动,从而带动振膜的振动,振膜排开空气实现发声。The terminal can play sound by using a sound playing device such as a speaker or an earpiece, wherein the earpiece is used for a call. The sounding principle of the speaker and the earpiece is basically the same, which is the process of converting electrical energy into mechanical energy and converting mechanical energy into sound energy by using the principle of electromagnetic induction. Taking the speaker as an example, when the coil in the speaker is energized, the coil generates a magnetic field. Under the interaction with the magnetic field of the magnet, the coil vibrates, thereby driving the vibration of the diaphragm, and the diaphragm discharges the air to realize the sound.
发明内容Summary of the invention
本公开提供声音播放器件的检测方法、装置、存储介质及终端,可以自动对声音播放器件进行检测。The present disclosure provides a method, device, storage medium and terminal for detecting a sound playing device, which can automatically detect a sound playing device.
一种声音播放器件的检测方法,包括:监测到声音播放器件的检测事件被触发时,以预设音量等级通过声音播放器件播放预设音频文件并控制麦克风采集样本音频信号;将所述样本音频信号与预设音频信号进行比较,其中,所述预设音频信号为在所述声音播放器件的发声位置不存在异物的情况下以所述预设音量等级播放所述预设音频文件并通过所述麦克风采集到的音频信号;以及当比较结果满足预设条件时确定所述声音播放器件的发声位置存在异物。A method for detecting a sound playing device, comprising: detecting that a detection event of a sound playing device is triggered, playing a preset audio file through a sound playing device at a preset volume level, and controlling a microphone to collect a sample audio signal; The signal is compared with a preset audio signal, wherein the preset audio signal is played at the preset volume level in the absence of foreign matter at the sounding position of the sound playing device and passes through the preset audio file. Depicting an audio signal collected by the microphone; and determining that there is a foreign object in the sounding position of the sound playing device when the comparison result satisfies the preset condition.
一种声音播放器件的检测装置,包括:播放控制模块,设置为在监测到声音播放器件的检测事件被触发时,以预设音量等级通过声音播放器件播放预设音频文件。A detecting device for a sound playing device, comprising: a playing control module configured to play a preset audio file through a sound playing device at a preset volume level when a detection event of the sound playing device is detected is triggered.
音频采集控制模块,设置为在以预设音量等级通过声音播放器件播放预设音频文件的同时控制麦克风采集样本音频信号。The audio collection control module is configured to control the microphone to collect the sample audio signal while playing the preset audio file through the sound playback device at a preset volume level.
信号比较模块,设置为将所述样本音频信号与预设音频信号进行比较,其中,所述预设音频信号为在所述声音播放器件的发声位置不存在异物的情况下以所述预设音量等级播放所述预设音频文件并通过所述麦克风采集到的音频信号。a signal comparison module configured to compare the sample audio signal with a preset audio signal, wherein the preset audio signal is at the preset volume without a foreign object in a sounding position of the sound playing device Level playing the preset audio file and the audio signal collected by the microphone.
异物判定模块,设置为在比较结果满足预设条件时确定所述声音播放器件的发声位置存在异物。The foreign matter determination module is configured to determine that there is a foreign object in the sounding position of the sound playing device when the comparison result satisfies the preset condition.
一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如本公开所述的声音播放器件的检测方法。A computer readable storage medium having stored thereon a computer program that, when executed by a processor, implements a method of detecting a sound playback device as described in the present disclosure.
一种移动终端,包括麦克风,声音播放器件,存储器,处理器及存储在存储器上并可在处理器运行的计算机程序,所述处理器执行所述计算机程序时实现如本公开所述的声音播放器件的检测方法。A mobile terminal comprising a microphone, a sound playing device, a memory, a processor, and a computer program stored on the memory and operable on the processor, the processor executing the computer program to implement sound playback as described in the present disclosure Device detection method.
附图说明DRAWINGS
图1为一实施例提供的一种声音播放器件的检测方法的流程示意图;1 is a schematic flow chart of a method for detecting a sound playing device according to an embodiment;
图2为一实施例提供的一种智能手机的音频处理硬件系统结构示意图;FIG. 2 is a schematic structural diagram of an audio processing hardware system of a smart phone according to an embodiment; FIG.
图3为一实施例提供的一种音频系统架构框图;3 is a block diagram of an audio system architecture provided by an embodiment;
图4为一实施例提供的一种扬声器的检测方法的流程示意图;4 is a schematic flow chart of a method for detecting a speaker according to an embodiment;
图5为一实施例提供的一种听筒的检测方法的流程示意图;FIG. 5 is a schematic flowchart of a method for detecting an earpiece according to an embodiment; FIG.
图6为一实施例提供的一种声音播放器件的检测装置的结构框图;FIG. 6 is a structural block diagram of a detecting apparatus of a sound playing device according to an embodiment; FIG.
图7为一实施例提供的一种终端的结构示意图。FIG. 7 is a schematic structural diagram of a terminal according to an embodiment.
具体实施方式Detailed ways
下面结合附图并通过具体实施方式来说明本公开。一些示例性实施例被描述成作为流程图描绘的处理或方法。虽然流程图将各步骤描述成顺序的处理,但是其中的许多步骤可以被并行地、并发地或者同时实施。此外,各步骤的顺序可以被重新安排。当其操作完成时所述处理可以被终止,但是还可以具有未包括在附图中的附加步骤。所述处理可以对应于方法、函数、规程、子例程、子程序等等。The present disclosure is described below in conjunction with the drawings and by way of specific embodiments. Some example embodiments are described as a process or method depicted as a flowchart. Although the flowcharts describe the various steps as a sequential process, many of the steps can be implemented in parallel, concurrently, or concurrently. In addition, the order of the steps can be rearranged. The process may be terminated when its operation is completed, but may also have additional steps not included in the figures. The processing may correspond to methods, functions, procedures, subroutines, subroutines, and the like.
图1为本实施例提供的一种声音播放器件的检测方法的流程示意图,该方 法可以由屏幕显示的控制装置执行,其中该装置可由软件和/或硬件实现,一般可集成在终端中。如图1所示,该方法包括以下步骤。FIG. 1 is a schematic flowchart diagram of a method for detecting a sound playing device according to an embodiment of the present invention. The method may be performed by a control device of a screen display, wherein the device may be implemented by software and/or hardware, and may be integrated into a terminal. As shown in Figure 1, the method includes the following steps.
在步骤101中,监测到声音播放器件的检测事件被触发时,以预设音量等级通过声音播放器件播放预设音频文件并控制麦克风采集样本音频信号。In step 101, when it is detected that the detection event of the sound playing device is triggered, the preset audio file is played by the sound playing device at a preset volume level and the microphone is controlled to collect the sample audio signal.
示例性的,本实施例中的终端可包括手机、平板电脑、音乐播放器以及录音笔等配置有麦克风及声音播放器件的设备。麦克风可以是内置的,也可以是外置的。Exemplarily, the terminal in this embodiment may include a device configured with a microphone and a sound playing device, such as a mobile phone, a tablet computer, a music player, and a voice recorder. The microphone can be either built-in or external.
麦克风(简称mic,又称传声器或话筒)是一种将声音信号转换为电信号的能量转换器件,当声音的振动传到麦克风的振动膜上后,会导致里面的磁铁形成变化的电流信号,由声音处理电路对电流信号进行处理后传输到通话对端或进行存储,进而实现通话或录音。本实施例对麦克风的类型、数量及所在位置不做限定,例如,对于手机来说,可以是设置在手机下侧面的一个或多个驻极体式麦克风。A microphone (referred to as a microphone, also known as a microphone or a microphone) is an energy conversion device that converts a sound signal into an electrical signal. When the vibration of the sound is transmitted to the diaphragm of the microphone, the magnet inside changes a current signal. The current signal is processed by the sound processing circuit and transmitted to the opposite end of the call or stored, thereby implementing a call or recording. In this embodiment, the type, the number, and the location of the microphone are not limited. For example, for a mobile phone, it may be one or more electret microphones disposed on the lower side of the mobile phone.
本实施例中的声音播放器件可包括扬声器或听筒等。扬声器和听筒的发声原理基本相同,是利用电磁感应原理将电能转化为机械能,并将机械能转化为声能的过程。以扬声器为例,扬声器中的线圈通电时,其线圈就会产生磁场,在与磁铁的磁场相互作用下,线圈振动,从而带动振膜的振动,振膜排开空气实现发声。由上述发声原理可知,扬声器或听筒需要排开空气实现发声,那么当扬声器或听筒的发声位置存在异物时,就会对声音播放产生影响,一般会导致播放音量变小。本实施例为终端增设的自动检测功能,当声音播放器件的发声位置存在异物时能够被终端自动检测出来。The sound playing device in this embodiment may include a speaker or an earpiece or the like. The sounding principle of the speaker and the earpiece is basically the same, which is the process of converting electrical energy into mechanical energy and converting mechanical energy into sound energy by using the principle of electromagnetic induction. Taking the speaker as an example, when the coil in the speaker is energized, the coil generates a magnetic field. Under the interaction with the magnetic field of the magnet, the coil vibrates, thereby driving the vibration of the diaphragm, and the diaphragm discharges the air to realize the sound. It can be known from the above sounding principle that the speaker or the earpiece needs to discharge air to realize the sound, and when there is a foreign object in the sounding position of the speaker or the earpiece, the sound playback is affected, and the playback volume is generally reduced. In this embodiment, the automatic detection function added by the terminal can be automatically detected by the terminal when there is a foreign object in the sounding position of the sound playing device.
示例性的,声音播放器件的检测事件可以由系统自动触发,例如在系统中预先设置声音播放器件检测事件的条件,该条件可以是终端开机时,可以是预设时间间隔检测一次,也可以在接收到声音播放请求时等等;也可根据用户操作触发,如在终端的系统设置菜单中增加触发声音播放器件检测事件的选项,当用户选择该选项时,声音播放器件的检测事件被触发。对于不同的声音播放器件,如扬声器和听筒,分别对应的扬声器检测事件和听筒检测事件的触发条件可以不同。Exemplarily, the detection event of the sound playing device can be automatically triggered by the system, for example, the condition of the sound playing device detecting event is preset in the system, and the condition may be that the terminal is detected when the device is powered on, or may be detected at a preset time interval, or may be When a sound playback request is received, etc.; it may also be triggered according to a user operation, such as an option to trigger a sound playback device detection event in the system setting menu of the terminal, and when the user selects the option, the detection event of the sound playback device is triggered. For different sound playback devices, such as speakers and earpieces, the trigger conditions for the corresponding speaker detection event and handset detection event may be different.
下面以智能手机为例对音频处理硬件系统及系统架构进行介绍。The following takes the smart phone as an example to introduce the audio processing hardware system and system architecture.
图2为本实施例提供的一种智能手机的音频处理硬件系统结构示意图。音频处理电路一般处于主控电路板中,由于不同手机的设计不同,音频处理电路 的位置也可能不同。智能手机的音频处理电路包括音频信号处理电路、基带信号处理电路、音频功率放大器、耳机信号放大器、听筒、扬声器、麦克风及耳机接口等。其中,音频信号处理电路是整个音频处理电路的核心。音频处理电路由接收音频电路、送话电路、耳机通话电路等组成,包括模拟音频的模拟/数字(A/D)转换、数字/模拟(A/D)转换、数字语音信号处理及模拟音频放大电路等。FIG. 2 is a schematic structural diagram of an audio processing hardware system of a smart phone according to an embodiment of the present invention. The audio processing circuit is usually in the main control board. The location of the audio processing circuit may be different due to the different designs of different mobile phones. The audio processing circuit of the smartphone includes an audio signal processing circuit, a baseband signal processing circuit, an audio power amplifier, a headphone signal amplifier, an earpiece, a speaker, a microphone, and a headphone interface. Among them, the audio signal processing circuit is the core of the entire audio processing circuit. The audio processing circuit is composed of a receiving audio circuit, a sending circuit, a headphone talking circuit, and the like, including analog/digital (A/D) conversion, digital/analog (A/D) conversion, digital voice signal processing, and analog audio amplification of analog audio. Circuits, etc.
在通话时,首先通话本地端麦克风把声音的机械声波信号转化为模拟音频信号,通过模拟音频放大电路进行放大,经内部的多模转换器进行A/D转换,得到数字音频信号;其次把此数字音频信号送到基带处理器,进行语音编码、信道编码等处理;再次进行加密、交织等一系列处理;最后送到基带处理器中的数字窄带调制模块进行调制,产生发射基带信号送入射频电路调制成发射中频,发送给通话对方。在接听电话时,首先从射频电路解调出接收基带信息,送到基带处理器内部进行数字窄带解调,分离出控制信号和语音信号;其次把语音信号进行解密、去交织、重组等一系列处理,然后进行信道解码、语音解码;最后得到纯正数字语音信号,送入语音信号处理器中的多模转换器进行D/A转换;还原成模拟音频信号后,经过音频功率放大后推动听筒发声。若选择免提受话,基带处理器则关闭听筒受话放大器,启动免提受话放大管(振铃放大管)工作,把音频信号功率放大后推动扬声器发声。During the call, the local microphone is first called to convert the sound acoustic signal of the sound into an analog audio signal, amplified by an analog audio amplifier circuit, and subjected to A/D conversion by an internal multimode converter to obtain a digital audio signal; The digital audio signal is sent to the baseband processor for speech encoding, channel encoding, etc.; a series of processing such as encryption and interleaving is performed again; finally, the digital narrowband modulation module sent to the baseband processor is modulated to generate the transmitted baseband signal and sent to the radio frequency. The circuit is modulated into a transmitting intermediate frequency and sent to the other party. When answering the telephone, the baseband information is first demodulated from the radio frequency circuit, sent to the baseband processor for digital narrowband demodulation, and the control signal and the voice signal are separated; secondly, the voice signal is decrypted, deinterleaved, recombined, etc. Processing, then performing channel decoding and speech decoding; finally obtaining a pure digital speech signal, which is sent to a multi-mode converter in the speech signal processor for D/A conversion; after being restored to an analog audio signal, after the audio power is amplified, the handset is sounded . If the speakerphone is selected, the baseband processor turns off the handset receiver amplifier, activates the hands-free receiver amplifier (ringing amplifier), and amplifies the audio signal power to push the speaker to sound.
在录音时,与上述过程类似,首先由麦克风把声音的机械声波信号转化为模拟音频信号,通过模拟音频放大电路进行放大,经过A/D转换后得到数字音频信号,按照预设的音频格式进行编码及存储。在播放录音或其他音频文件时,将音频文件进行解码得到数字音频信号,经过D/A换后还原成模拟音频信号,把音频信号功率放大后推动扬声器发声。When recording, similar to the above process, the mechanical sound wave signal of the sound is first converted into an analog audio signal by a microphone, amplified by an analog audio amplifying circuit, and digital audio signal is obtained after A/D conversion, according to a preset audio format. Coding and storage. When playing a recording or other audio file, the audio file is decoded to obtain a digital audio signal, which is converted into an analog audio signal after D/A conversion, and the audio signal power is amplified to drive the speaker to sound.
本实施例中可预先在终端中存储预设音频文件,对该预设音频文件进行播放。预存音频文件以及预设音量等级可由设计人员根据实际情况进行选取,不同的声音播放器件对应的预设音频文件和/或预设音量等级可以不同。麦克风采集的音频信号可以是上述的由机械声波信号转换而来的模拟音频信号,也可以是经过放大后的模拟音频信号,还可以是经过A/D转换后的数字音频信号等,可根据信号形式的不同分别设置相应的下文中的预设条件。为了方便终端与用户之间的交互,终端一般会向用户提供音量调节功能,用户可采用调节音量调节按钮或音量调节进度条等方式对终端播放声音的音量等级进行调整,而终端 根据用户调整后的音量等级对需要播放的音频信号进行相应的放大处理,如功率放大,以满足用户的收听需求。不同的终端中对音量等级的划分策略可能不同,即音量等级的总数量以及每个音量等级对应的音量大小都可能不同。In this embodiment, a preset audio file may be stored in the terminal in advance, and the preset audio file is played. The pre-stored audio file and the preset volume level can be selected by the designer according to the actual situation, and the preset audio file and/or the preset volume level corresponding to different sound playing devices can be different. The audio signal collected by the microphone may be the above-mentioned analog audio signal converted from the mechanical sound wave signal, or may be an amplified analog audio signal, or may be an A/D converted digital audio signal, etc., according to the signal. The different forms are respectively set corresponding to the preset conditions below. In order to facilitate the interaction between the terminal and the user, the terminal generally provides a volume adjustment function to the user, and the user can adjust the volume level of the sound played by the terminal by adjusting the volume adjustment button or the volume adjustment progress bar, and the terminal adjusts according to the user. The volume level of the audio signal to be played is correspondingly amplified, such as power amplification, to meet the user's listening needs. The division strategy for the volume level may be different in different terminals, that is, the total number of volume levels and the volume level corresponding to each volume level may be different.
如图3所示,本实施例提供的音频系统架构包括用户空间、内核空间和硬件系统。用户空间包括应用(Application)层、应用框架(Framework)层和硬件抽象层(Hardware Abstraction Layer,HAL),内核空间包括驱动(Driver)层,硬件系统包括扬声器。应用层是音频体系的最上层,可通过编写一个应用程序来执行对应的逻辑操作,例如检测触发录音事件的应用程序,预先设置标准音频条件,下发音频播放指令等。应用框架层包括音频控制接口和标准化插件模块负责提供音频播放形式控制接口,以及扬声器音量大小控制接口等。应用框架层提供了AudioTrack和AudioRecorder两个类,以及AudioManager、AudioService及AudioSystem类。在应用框架层和硬件抽象层之间还包括一个系统运行库(Libraries)层。Framework层的很多类,实际上只是应用程序使用Android库文件的“中介”而已。因为上层应用一般采用java语言编写,它们需要最直接的java接口的支持,这就是framework层存在的意义之一。而作为“中介”,framework层并不会真正去实现具体的功能,或者只实现其中的一部分功能,而把重心放在库中来完成。比如上面的AudioTrack、AudioRecorder、MediaPlayer和MediaRecorder等等在库中都能找到相对应的类。这一部分代码集中放置在工程的frameworks/av/media/libmedia中,多数是C++语言编写的。音频方面的硬件抽象层分为两部分,即AudioFlinger和AudioPolicyService。实际上后者并不是一个真实的设备,只是采用虚拟设备的方式来让厂商可以方便地定制出自己的策略。根据产品的不同,音频设备存在很大差异,在Android的音频架构中,这些问题都是由HAL层的audio.primary等来解决的,而不需要大规模地修改上层实现。硬件抽象层是应用框架层到驱动层的过渡,以实现底层硬件的兼容。驱动层按照音频编解码器的特性对其进行控制,确保音频编解码器可以正常工作,将音频编解码器获取到的音频数据提供给系统层。本实施例中在进行预设音频信号播放以及后面的声音播放时,设计的类为上述的AudioTrack类;在进行音频信号采集时,涉及的类为上述的AudioRecorder类。As shown in FIG. 3, the audio system architecture provided in this embodiment includes a user space, a kernel space, and a hardware system. The user space includes an application layer, an application framework layer, and a hardware abstraction layer (HAL). The kernel space includes a driver layer, and the hardware system includes a speaker. The application layer is the top layer of the audio system. You can write an application to perform corresponding logical operations, such as detecting an application that triggers a recording event, presetting standard audio conditions, and issuing audio playback commands. The application framework layer includes an audio control interface and a standardized plug-in module to provide an audio playback form control interface, as well as a speaker volume control interface. The application framework layer provides two classes, AudioTrack and AudioRecorder, as well as the AudioManager, AudioService, and AudioSystem classes. A system runtime layer (Libraries) is also included between the application framework layer and the hardware abstraction layer. Many of the classes in the Framework layer are actually just "mediations" for applications that use Android library files. Because upper-level applications are generally written in Java, they require the most direct support of the Java interface, which is one of the meanings of the framework layer. As an "intermediary", the framework layer does not really implement specific functions, or only implement some of the functions, but focus on the library to complete. For example, the above AudioTrack, AudioRecorder, MediaPlayer and MediaRecorder can find the corresponding class in the library. This part of the code is placed in the frameworks/av/media/libmedia of the project, mostly written in C++. The hardware abstraction layer of audio is divided into two parts, namely AudioFlinger and AudioPolicyService. In fact, the latter is not a real device, just a virtual device to allow manufacturers to easily customize their own strategies. Depending on the product, audio devices vary widely. In the audio architecture of Android, these problems are solved by the audio.primary of the HAL layer, etc., without the need to modify the upper layer implementation on a large scale. The hardware abstraction layer is the transition from the application framework layer to the driver layer to achieve compatibility with the underlying hardware. The driver layer controls the audio codec according to the characteristics of the audio codec to ensure that the audio codec can work normally, and the audio data obtained by the audio codec is provided to the system layer. In the embodiment, when the preset audio signal is played and the subsequent sound is played, the designed class is the above-mentioned AudioTrack class; when the audio signal is collected, the class involved is the above-mentioned AudioRecorder class.
在步骤102中,将所述样本音频信号与预设音频信号进行比较。In step 102, the sample audio signal is compared to a preset audio signal.
其中,所述预设音频信号为在所述声音播放器件的发声位置不存在异物的情况下以所述预设音量等级播放所述预设音频文件并通过所述麦克风采集到的 音频信号。示例性的,预设音频信号可由终端出厂前录制并存储,也可由用户在确认声音播放器件的发生位置不存在异物的情况下自行录制并存储。在一些实施例中,预设音频信号可以是上述的由机械声波信号转换而来的模拟音频信号,也可以是经过放大处理后的模拟音频信号,还可以是经过A/D转换后的数字音频信号等。一般的,样本音频信号与预设音频信号相对应,即当预设音频信号为由机械声波信号转换而来的模拟音频信号时,样本音频信号也是由机械声波信号转换而来的模拟音频信号;当预设音频信号为经过放大处理后的模拟音频信号时,样本音频信号也是经过放大处理后的模拟音频信号,且放大处理方式相同,放大倍数相同。对经过放大处理后的模拟音频信号进行比较,能够更方便比较两者的差异。The preset audio signal is an audio signal that is played by the preset audio file at the preset volume level and is collected by the microphone in the absence of a foreign object in the sounding position of the sound playing device. Exemplarily, the preset audio signal can be recorded and stored by the terminal before leaving the factory, or can be recorded and stored by the user without confirming the occurrence of the sound playing device. In some embodiments, the preset audio signal may be an analog audio signal converted from a mechanical sound wave signal as described above, or may be an amplified analog audio signal, or may be an A/D converted digital audio. Signals, etc. Generally, the sample audio signal corresponds to a preset audio signal, that is, when the preset audio signal is an analog audio signal converted from a mechanical sound wave signal, the sample audio signal is also an analog audio signal converted from a mechanical sound wave signal; When the preset audio signal is an amplified analog audio signal, the sample audio signal is also an amplified analog audio signal, and the amplification processing is the same, and the magnification is the same. Comparing the amplified analog audio signals makes it easier to compare the differences between the two.
由上文可知,扬声器或听筒需要排开空气实现发声,当扬声器或听筒的发声位置存在异物时,一般会导致相应的播放音量变小。若扬声器的发声位置存在异物时,通过扬声器播放预设音频信号时播放音量相比于不存在异物的情况会变小,因此麦克风采集到的样本音频信号对应的声音大小相比于不存在异物的情况也会变小。同理,若听筒的发声位置存在异物时,通过听筒播放预设音频信号时播放音量相比于不存在异物的情况会变小,因此麦克风采集到的样本音频信号对应的声音大小相比于不存在异物的情况也会变小。因此,可将样本音频信号与预设音频信号进行比较,从而根据比较结果判断是否存在异物。As can be seen from the above, the speaker or the earpiece needs to be ventilated to achieve sound, and when there is a foreign object in the sounding position of the speaker or the earpiece, the corresponding playback volume is generally reduced. If there is a foreign object in the sounding position of the speaker, the playback volume will be smaller when the preset audio signal is played through the speaker, and the sound volume corresponding to the sample audio signal collected by the microphone is smaller than that of the foreign object. The situation will also be smaller. Similarly, if there is a foreign object in the sounding position of the earpiece, the playing volume when playing the preset audio signal through the earpiece will become smaller than that in the case where no foreign matter exists, so the sound volume corresponding to the sample audio signal collected by the microphone is compared with The situation of foreign matter will also become smaller. Therefore, the sample audio signal can be compared with the preset audio signal to determine whether or not foreign matter is present based on the comparison result.
声音的三个属性为音量、音调和音色。其中,音量又称响度或音强,是指人耳对所听到的声音大小强弱的主观感受,其客观评价尺度是声音的振幅大小。振幅指物体震动过程中偏离原来位置的最大距离,人耳听到的声音的响度与音源的振幅相关,一般振幅越大响度越强。The three properties of the sound are volume, pitch, and tone. Among them, the volume is also called loudness or sound intensity, which refers to the subjective feeling of the human ear on the strength of the sound heard. The objective evaluation scale is the amplitude of the sound. Amplitude refers to the maximum distance from the original position during the vibration of the object. The loudness of the sound heard by the human ear is related to the amplitude of the sound source. Generally, the louder the louder the stronger the amplitude.
在步骤103中,当比较结果满足预设条件时确定所述声音播放器件的发声位置存在异物。In step 103, when the comparison result satisfies the preset condition, it is determined that there is a foreign object in the sounding position of the sound playing device.
示例性的,预设条件可通过实验或仿真来确定。由于播放环境差异的存在,可能导致样本音频信号与预设音频信号不完全相同,而两者差异处于一定的预设范围内时,可认为当前不存在异物,而两者差异超出该预设范围时,可认为声音播放器件的发声位置存在异物。Illustratively, the preset conditions can be determined experimentally or by simulation. Due to the difference in the playing environment, the sample audio signal may not be exactly the same as the preset audio signal, and when the difference between the two is within a certain preset range, it may be considered that there is no foreign object currently, and the difference between the two exceeds the preset range. At the time, it is considered that there is a foreign matter in the sounding position of the sound playing device.
本实施例中提供的声音播放器件的检测方法,监测到声音播放器件的检测事件被触发时,以预设音量等级通过声音播放器件播放预设音频文件并控制麦克风采集样本音频信号,将样本音频信号与预设音频信号进行比较,当比较结 果满足预设条件时确定声音播放器件的发声位置存在异物。通过采用上述技术方案,终端能够自动检测出扬声器或听筒等声音播放器件被异物堵塞,丰富了终端的功能。The detecting method of the sound playing device provided in this embodiment detects that when the detecting event of the sound playing device is triggered, playing the preset audio file through the sound playing device at a preset volume level and controlling the microphone to collect the sample audio signal, the sample audio is The signal is compared with the preset audio signal, and when the comparison result satisfies the preset condition, it is determined that there is a foreign object in the sounding position of the sound playing device. By adopting the above technical solution, the terminal can automatically detect that the sound playing device such as the speaker or the earpiece is blocked by foreign matter, enriching the function of the terminal.
在一些实施例中,在将所述样本音频信号与预设音频信号进行比较之前,所述声音播放器件的检测方法还包括:对所述样本音频信号进行去噪处理,以滤除播放环境中的噪声对所述样本音频信号的干扰。本实施例中,可将与预设音频文件中的声音无关的声音均认为是播放环境的噪声,例如,在播放预设音频文件时,旁边有人大声说话,或者有车鸣笛等,这些都会对比较结果造成很大的干扰,所以,上述对所述样本音频信号进行去噪处理的操作,可以提高判定是否存在异物的准确度,防止发生误判的情况。In some embodiments, before the comparing the sample audio signal with the preset audio signal, the detecting method of the sound playing device further comprises: performing denoising processing on the sample audio signal to filter out the playing environment. The interference of the noise on the sample audio signal. In this embodiment, the sounds that are not related to the sound in the preset audio file are considered to be the noise of the playing environment. For example, when playing the preset audio file, someone next to them speaks loudly, or there is a car whistle, etc. Since the comparison result causes a large interference, the above-described operation of denoising the sample audio signal can improve the accuracy of determining whether or not foreign matter is present, and preventing a misjudgment.
在一些实施例中,可将对应同一预设时段的所述样本音频信号的第一声音响度与预设音频信号的第二声音响度进行比较,以得到声音响度比较结果。其中,所述第一声音响度包括所述预设时段内的所述样本音频信号的振幅平均值,所述第二声音响度包括所述预设时段内的预设音频信号的振幅平均值。由于预设音频文件的播放以及麦克风的音频信号采集是同时进行的,所以,样本音频信号与预设音频信号对应的声音内容是基本相同的,对应同一预设时段的两个音频信号的声音响度能够用于衡量声音播放器件的发声位置是否存在异物。预设时段的起点、时长以及数量可根据预设音频文件的特点进行设置。例如,可以是开始录制的第5秒至第15秒为预设时段,还可以是开始录制的第5秒开始,接下来每个时长为1秒的时间段为一个预设时段。In some embodiments, the first sound level of the sample audio signal corresponding to the same preset time period may be compared with the second sound level of the preset audio signal to obtain a sound level comparison result. The first acoustic sound level includes an amplitude average value of the sample audio signal in the preset time period, and the second sound sound level includes an amplitude average value of a preset audio signal in the preset time period. Since the playing of the preset audio file and the audio signal acquisition of the microphone are performed simultaneously, the sound content corresponding to the preset audio signal is substantially the same, and the sound level of the two audio signals corresponding to the same preset time period is Can be used to measure the presence of foreign objects in the sounding position of the sound playback device. The start time, duration, and number of preset time periods can be set according to the characteristics of the preset audio file. For example, it may be that the 5th to 15th seconds of the start of recording is the preset time period, or may be the 5th second of the start of recording, and then the time period of each time of 1 second is a preset time period.
在一些实施例中,所述当比较结果满足预设条件时确定所述声音播放器件的发声位置存在异物,包括:当所述声音响度比较结果中包括所述第一声音响度小于所述第二声音响度与预设比例值的乘积时,确定所述声音播放器件的发声位置存在异物。示例性的,预设比例值可根据实际需求设置,一般可小于1,如0.9,当然,也可等于1。In some embodiments, determining that the sounding position of the sound playing device has a foreign object when the comparison result satisfies the preset condition, including: when the sound sound level comparison result includes the first sound level is less than the first When the product of the two-tone sound level and the preset ratio value is determined, it is determined that there is a foreign object in the sounding position of the sound playing device. Exemplarily, the preset ratio value may be set according to actual needs, and may generally be less than 1, such as 0.9, and may of course be equal to 1.
在一些实施例中,当所述声音响度比较结果中包括所述第一声音响度大于或等于所述第二声音响度与预设比例值的乘积时,确定所述声音播放器件的发声位置不存在异物。In some embodiments, when the first sound level is greater than or equal to a product of the second sound level and a preset ratio value, determining that the sounding position of the sound playing device is not There is a foreign object.
在一些实施例中,在所述确定所述声音播放器件的发声位置存在异物之后,所述声音播放器件的检测方法还包括:监测到声音播放事件时,对当前播放方式进行调整,以提高播放音量。当存在异物时,播放的声音会变小,影响用户 的收听,所以可对当前播放方式进行调整,以提高播放音量。示例性的,对当前播放方式进行调整的实施方式可以有很多种,以下给出几种方式作为示意性说明。第一种,通过调节硬件增益对需要播放的模拟音频信号进行增益提升调节,提高放大倍数,从而提高播放音量;第二种,对需要播放的音频数据进行处理,如对音频数据乘以预设系数,如1.2,从而提升数字音频信号对应的模拟音频信号的幅值,从而提高播放音量;第三种,以目标音量等级通过所述声音播放器件进行声音播放,其中,所述目标音量等级高于当前音量等级的设置值,例如,当前音量等级的设置值为5,可以目标音量等级7进行声音播放。其中,第三种对当前播放方式进行调整的方式,调整方式简单快捷,响应速度快,且对需要播放的音频本身影响较小,避免失真。In some embodiments, after the determining that there is a foreign object in the sounding position of the sound playing device, the detecting method of the sound playing device further comprises: adjusting the current playing mode to improve the playing when the sound playing event is monitored volume. When there is a foreign object, the played sound will become smaller, affecting the user's listening, so the current play mode can be adjusted to increase the playback volume. Illustratively, there may be many implementations for adjusting the current play mode, and several ways are given below as illustrative illustrations. The first one is to adjust the gain of the analog audio signal to be played by adjusting the hardware gain to increase the magnification, thereby increasing the playback volume. Secondly, processing the audio data to be played, such as multiplying the audio data by a preset. a coefficient, such as 1.2, thereby increasing the amplitude of the analog audio signal corresponding to the digital audio signal, thereby increasing the playback volume; and a third, playing the sound through the sound playback device at the target volume level, wherein the target volume level is high The setting value of the current volume level, for example, the setting value of the current volume level is 5, and the sound can be played at the target volume level 7. Among them, the third way to adjust the current play mode, the adjustment method is simple and fast, the response speed is fast, and the impact on the audio itself to be played is small, and the distortion is avoided.
在一些实施例中,在所述确定所述声音播放器件的发声位置存在异物之后,所述声音播放器件的检测方法还包括:根据所述乘积与所述第一声音响度确定对应的音量等级调整值;所述以目标音量等级通过所述声音播放器件进行声音播放,包括:根据当前音量等级的设置值与所述音量等级调整值确定目标音量等级;以所述目标音量等级通过所述声音播放器件进行声音播放。示例性的,可根据所述乘积与第一声音响度的差值确定对应的音量等级调整值,终端可预先存储不同的差值与音量等级调整值的对应关系;也可根据所述乘积与第一声音响度的商确定对应的音量等级调整值,终端可预先存储不同的商与音量等级调整值的对应关系。In some embodiments, after the determining that there is a foreign object in the sounding position of the sound playing device, the detecting method of the sound playing device further comprises: determining a corresponding sound level according to the product and the first sound level Adjusting a value; the sound playing by the sound playing device at a target volume level, comprising: determining a target volume level according to a set value of a current volume level and the volume level adjustment value; and passing the sound at the target volume level Play the device for sound playback. For example, the corresponding volume level adjustment value may be determined according to the difference between the product and the first sound level, and the terminal may pre-store the correspondence between different difference values and the volume level adjustment value; or according to the product and The quotient of the first sound level determines the corresponding volume level adjustment value, and the terminal can pre-store the correspondence between different quotient and volume level adjustment values.
在一些实施例中,在所述确定所述声音播放器件的发声位置存在异物之后,声音播放器件的检测方法还包括:控制所述声音播放器件产生超声波。这样的设置,能够自动对发声位置存在的异物进行清除。可选的,在产生超声波后,可再次播放预设音频文件,并执行上述的相关操作,判断异物是否已被清除。In some embodiments, after the determining that there is a foreign object in the sounding position of the sound playing device, the detecting method of the sound playing device further comprises: controlling the sound playing device to generate the ultrasonic wave. Such a setting can automatically clear the foreign matter present at the sounding position. Optionally, after the ultrasonic wave is generated, the preset audio file may be played again, and the related operations described above are performed to determine whether the foreign object has been cleared.
图4为本实施例提供的一种扬声器的检测方法的流程示意图,该方法包括以下步骤。FIG. 4 is a schematic flowchart diagram of a method for detecting a speaker according to an embodiment of the present invention, where the method includes the following steps.
在步骤401中,监测到扬声器检测事件被触发时,以预设音量等级a通过扬声器播放预设音频文件并控制麦克风采集样本音频信号。In step 401, when it is detected that the speaker detection event is triggered, the preset audio file is played through the speaker at a preset volume level a and the microphone is controlled to acquire the sample audio signal.
其中的扬声器还可以替换为听筒等声音播放器件。The speaker can also be replaced by a sound playback device such as an earpiece.
在步骤402中,将对应同一预设时段的样本音频信号的第一声音响度A与预设音频信号的第二声音响度B进行比较,以得到声音响度比较结果。In step 402, the first sound level A of the sample audio signal corresponding to the same preset time period is compared with the second sound level B of the preset audio signal to obtain a sound level comparison result.
在步骤403中,判断A是否小于k×B,若A小于k×B,则执行步骤404; 若A大于或者等于k×B,结束流程。其中,k为预设比例值,“×”为乘法运算。In step 403, it is determined whether A is smaller than k×B. If A is smaller than k×B, step 404 is performed; if A is greater than or equal to k×B, the flow is ended. Where k is the preset scale value and "x" is the multiplication operation.
在步骤404中,确定扬声器的发声位置存在异物。In step 404, it is determined that there is a foreign object in the sounding position of the speaker.
在步骤405中,根据(k×B-A)的值确定对应的音量等级调整值b,“-”为减法运算。例如,终端可预先存储不同的差值与音量等级调整值的对应关系,根据(k×B-A)的值,以及预先存储的不同差值与音量等级调整值的对应关系确定音量等级调整值b。In step 405, a corresponding volume level adjustment value b is determined based on the value of (k x B-A), and "-" is a subtraction operation. For example, the terminal may pre-store the correspondence between different difference values and volume level adjustment values, and determine the volume level adjustment value b according to the value of (k×B-A) and the correspondence between the previously stored different difference values and the volume level adjustment values.
在步骤406中,根据当前音量等级的设置值c与音量等级调整值b确定目标音量等级为d=c+b,“+”为加法运算。In step 406, the target volume level is determined to be d=c+b according to the set value c of the current volume level and the volume level adjustment value b, and "+" is an addition operation.
在步骤407中,以目标音量等级d通过扬声器进行声音播放。In step 407, sound playback is performed through the speaker at the target volume level d.
本实施例提供的扬声器的检测方法,能够自动检测出扬声器的发声位置是否存在异物,并在存在异物时,提升音量等级,保证所播放的声音不会因存在异物而受到影响。The method for detecting the speaker provided in this embodiment can automatically detect whether there is a foreign object in the sounding position of the speaker, and when there is a foreign object, raise the volume level to ensure that the played sound is not affected by the presence of foreign matter.
图5为本实施例提供的一种听筒的检测方法的流程示意图,该方法包括以下步骤。FIG. 5 is a schematic flowchart of a method for detecting an earpiece according to an embodiment of the present invention, where the method includes the following steps.
在步骤501中,监测到听筒检测事件被触发时,以预设音量等级e通过扬声器播放预设音频文件并控制麦克风采集样本音频信号。In step 501, when it is detected that the earpiece detection event is triggered, the preset audio file is played through the speaker at a preset volume level e and the microphone is controlled to acquire the sample audio signal.
其中的听筒还可以替换为扬声器等声音播放器件。The earpiece can also be replaced by a sound playback device such as a speaker.
在步骤502中,对所述样本音频信号进行去噪处理,以滤除播放环境中的噪声对所述样本音频信号的干扰。In step 502, the sample audio signal is denoised to filter out interference of the noise in the playback environment to the sample audio signal.
在步骤503中,将对应同一预设时段的样本音频信号的第一声音响度C与预设音频信号的第二声音响度D进行比较,以得到声音响度比较结果。In step 503, the first sound level C of the sample audio signal corresponding to the same preset time period is compared with the second sound level D of the preset audio signal to obtain a sound level comparison result.
在步骤504中,判断C是否小于y×D,若C小于y×D,则执行步骤505;若C大于或者等于y×D,结束流程。其中,y为预设比例值,“×”为乘法运算。In step 504, it is determined whether C is less than y×D. If C is less than y×D, step 505 is performed; if C is greater than or equal to y×D, the flow is ended. Where y is the preset scale value and "x" is the multiplication operation.
在步骤505中,确定听筒的发声位置存在异物。In step 505, it is determined that there is a foreign object in the sounding position of the earpiece.
在步骤506中,根据(y×D÷C)的值确定对应的音量等级调整值f,“÷”为除法运算。例如,终端可预先存储不同的商与音量等级调整值的对应关系,根据(y×D÷C)的值,以及预先存储的不同的商与音量等级调整值的对应关系确定音量等级调整值f。In step 506, a corresponding volume level adjustment value f is determined based on the value of (y x D ÷ C), and "÷" is a division operation. For example, the terminal may pre-store the correspondence between different quotient and volume level adjustment values, and determine the volume level adjustment value f according to the value of (y×D÷C) and the correspondence between the different quotient and volume level adjustment values stored in advance. .
在步骤507中,根据当前音量等级的设置值g与音量等级调整值f确定目标音量等级h=[g×f],[]为取整运算。In step 507, the target volume level h = [g x f] is determined based on the set value g of the current volume level and the volume level adjustment value f, and [] is a rounding operation.
在步骤508中,以目标音量等级h通过听筒进行声音播放。In step 508, the sound is played through the earpiece at the target volume level h.
本实施例提供的听筒的检测方法,能够自动检测出听筒的发声位置是否存在异物,并在存在异物时,提升音量等级,保证用户使用终端与他人通话时,所听到的通话对端声音的大小不会因存在异物而受到影响。The method for detecting the earpiece provided by the embodiment can automatically detect whether there is a foreign object in the sounding position of the earpiece, and when there is a foreign object, raise the volume level to ensure that the user hears the voice of the opposite end when using the terminal to talk with another person. The size is not affected by the presence of foreign objects.
图6为本实施例提供的一种声音播放器件的检测装置的结构框图,该装置可由软件和/或硬件实现,一般集成在终端中,可通过执行声音播放器件的检测方法来对声音播放器件发声位置的异物情况进行检测。如图6所示,该装置包括以下模块。FIG. 6 is a structural block diagram of a detecting apparatus of a sound playing device according to an embodiment of the present invention. The device may be implemented by software and/or hardware, and is generally integrated in a terminal, and the sound playing device may be implemented by executing a detecting method of the sound playing device. The foreign matter at the utterance position is detected. As shown in Figure 6, the device includes the following modules.
播放控制模块601,设置为在监测到声音播放器件的检测事件被触发时,以预设音量等级通过声音播放器件播放预设音频文件。The play control module 601 is configured to play the preset audio file through the sound playing device at a preset volume level when the detection event that the sound playing device is detected is triggered.
音频采集控制模块602,设置为在以预设音量等级通过声音播放器件播放预设音频文件的同时控制麦克风采集样本音频信号。The audio collection control module 602 is configured to control the microphone to acquire the sample audio signal while playing the preset audio file through the sound playing device at a preset volume level.
信号比较模块603,设置为将所述样本音频信号与预设音频信号进行比较,其中,所述预设音频信号为在所述声音播放器件的发声位置不存在异物的情况下以所述预设音量等级播放所述预设音频文件并通过所述麦克风采集到的音频信号。The signal comparison module 603 is configured to compare the sample audio signal with a preset audio signal, wherein the preset audio signal is the preset in the case where no foreign object exists in the sounding position of the sound playing device. The volume level plays the preset audio file and the audio signal collected by the microphone.
异物判定模块604,设置为在比较结果满足预设条件时确定所述声音播放器件的发声位置存在异物。The foreign object determination module 604 is configured to determine that there is a foreign object in the sounding position of the sound playing device when the comparison result satisfies the preset condition.
本实施例提供的声音播放器件的检测装置,监测到声音播放器件的检测事件被触发时,以预设音量等级通过声音播放器件播放预设音频文件并控制麦克风采集样本音频信号,将样本音频信号与预设音频信号进行比较,当比较结果满足预设条件时确定声音播放器件的发声位置存在异物。通过采用上述技术方案,终端能够自动检测出扬声器或听筒等声音播放器件被异物堵塞,丰富了终端的功能。The detecting device of the sound playing device provided by the embodiment detects that the detecting event of the sound playing device is triggered, plays the preset audio file through the sound playing device at a preset volume level, and controls the microphone to collect the sample audio signal, and the sample audio signal is Comparing with the preset audio signal, when the comparison result satisfies the preset condition, it is determined that there is a foreign object in the sounding position of the sound playing device. By adopting the above technical solution, the terminal can automatically detect that the sound playing device such as the speaker or the earpiece is blocked by foreign matter, enriching the function of the terminal.
在一实施例中,该装置还可包括去噪模块,设置为在将所述样本音频信号与预设音频信号进行比较之前,对所述样本音频信号进行去噪处理,以滤除播放环境中的噪声对所述样本音频信号的干扰。In an embodiment, the apparatus may further include a denoising module configured to perform denoising processing on the sample audio signal to compare the sample audio signal with the preset audio signal to filter out the playing environment. The interference of the noise on the sample audio signal.
在一实施例中,所述信号比较模块还设置为:将对应同一预设时段的所述样本音频信号的第一声音响度与预设音频信号的第二声音响度进行比较,以得到声音响度比较结果。In an embodiment, the signal comparison module is further configured to: compare a first sound level of the sample audio signal corresponding to the same preset time period with a second sound level of the preset audio signal to obtain an acoustic sound level Comparing results.
在一实施例中,所述异物判定模块还设置为:当所述声音响度比较结果中包括所述第一声音响度小于所述第二声音响度与预设比例值的乘积时,确定所 述声音播放器件的发声位置存在异物。In an embodiment, the foreign object determination module is further configured to: when the sound intensity comparison result includes the product of the first sound level being less than the product of the second sound level and a preset ratio value, determining the There is a foreign object in the sounding position of the sound playback device.
在一实施例中,该装置还可包括播放调整模块,设置为在所述确定所述声音播放器件的发声位置存在异物之后,监测到声音播放事件时,对当前播放方式进行调整,以提高播放音量。In an embodiment, the device may further include a play adjustment module, configured to adjust the current play mode to improve the play after the sound play event is detected after the determining that the sound play position of the sound playing device exists. volume.
在一实施例中,所述播放调整模块,还设置为:以目标音量等级通过所述声音播放器件进行声音播放,其中,所述目标音量等级高于当前音量等级的设置值。In an embodiment, the play adjustment module is further configured to: perform sound play by the sound playback device at a target volume level, wherein the target volume level is higher than a set value of the current volume level.
在一实施例中,该装置还可包括调整值确定模块,设置为在所述确定所述声音播放器件的发声位置存在异物之后,根据所述乘积与所述第一声音响度确定对应的音量等级调整值;所述播放调整模块,还设置为:根据当前音量等级的设置值与所述音量等级调整值确定目标音量等级;以所述目标音量等级通过所述声音播放器件进行声音播放。In an embodiment, the apparatus may further include an adjustment value determining module configured to determine a corresponding volume according to the product and the first acoustic sound level after the determining that there is a foreign object in the sounding position of the sound playing device The level adjustment value is further set to: determine a target volume level according to the set value of the current volume level and the volume level adjustment value; and perform sound playback by the sound playing device at the target volume level.
本实施例还提供一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行一种提示方法,该方法包括以下步骤。The present embodiment also provides a storage medium containing computer executable instructions for performing a prompting method when executed by a computer processor, the method comprising the following steps.
监测到声音播放器件的检测事件被触发时,以预设音量等级通过声音播放器件播放预设音频文件并控制麦克风采集样本音频信号。When it is detected that the detection event of the sound playing device is triggered, the preset audio file is played by the sound playing device at a preset volume level and the microphone is controlled to collect the sample audio signal.
将所述样本音频信号与预设音频信号进行比较,其中,所述预设音频信号为在所述声音播放器件的发声位置不存在异物的情况下以所述预设音量等级播放所述预设音频文件并通过所述麦克风采集到的音频信号。以及Comparing the sample audio signal with a preset audio signal, wherein the preset audio signal is played at the preset volume level in the absence of foreign matter at a sounding position of the sound playing device An audio file and an audio signal collected by the microphone. as well as
当比较结果满足预设条件时确定所述声音播放器件的发声位置存在异物。When the comparison result satisfies the preset condition, it is determined that there is a foreign object at the sounding position of the sound playing device.
存储介质——任何的各种类型的存储器设备或存储设备,包括非暂态的存储介质。术语“存储介质”旨在包括:安装介质,例如CD-ROM、软盘或磁带装置;计算机系统存储器或随机存取存储器,诸如DRAM、DDR RAM、SRAM、EDO RAM,兰巴斯(Rambus)RAM等;非易失性存储器,诸如闪存、磁介质(例如硬盘或光存储);寄存器或其它相似类型的存储器元件等。存储介质可以还包括其它类型的存储器或其组合。另外,存储介质可以位于程序在其中被执行的第一计算机系统中,或者可以位于不同的第二计算机系统中,第二计算机系统通过网络(诸如因特网)连接到第一计算机系统。第二计算机系统可以提供程序指令给第一计算机用于执行。术语“存储介质”可以包括可以驻留在不同位置中(例如在通过网络连接的不同计算机系统中)的两个或更多存储介质。存储介质可以存储可由一个或多个处理器执行的程序指令(例如实现为计算机程序)。Storage Media - Any of various types of memory devices or storage devices, including non-transitory storage media. The term "storage medium" is intended to include: a mounting medium such as a CD-ROM, a floppy disk or a tape device; a computer system memory or a random access memory such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc. Non-volatile memory, such as flash memory, magnetic media (such as hard disk or optical storage); registers or other similar types of memory elements, and the like. The storage medium may also include other types of memory or a combination thereof. Additionally, the storage medium may be located in a first computer system in which the program is executed, or may be located in a different second computer system, the second computer system being coupled to the first computer system via a network, such as the Internet. The second computer system can provide program instructions to the first computer for execution. The term "storage medium" can include two or more storage media that can reside in different locations (eg, in different computer systems connected through a network). A storage medium may store program instructions (eg, implemented as a computer program) executable by one or more processors.
本实施例所提供的一种包含计算机可执行指令的存储介质,其计算机可执行指令设置为执行如上所述的声音播放器件的检测操作,还可以执行本公开任意实施例所提供的声音播放器件的检测方法中的相关操作。A storage medium containing computer executable instructions, the computer executable instructions being configured to perform the detecting operation of the sound playing device as described above, and the sound playing device provided by any embodiment of the present disclosure may also be provided. Related operations in the detection method.
本实施例提供了一种终端,该终端中可集成本实施例提供的声音播放器件的检测装置。图7为本实施例提供的一种终端的结构示意图。该终端例如可以是移动终端,如图7所示,该终端可以包括:壳体(图中未示出)、存储器701、中央处理器(Central Processing Unit,CPU)702(又称处理器,以下简称CPU)、电路板(图中未示出)、电源电路(图中未示出)、麦克风713和声音播放器件(如图中的扬声器711)。所述电路板安置在所述壳体围成的空间内部;所述CPU702和所述存储器701设置在所述电路板上;所述电源电路,用于为所述终端的多个电路或器件供电;所述存储器701,用于存储可执行程序代码;所述CPU702通过读取所述存储器701中存储的可执行程序代码来运行与所述可执行程序代码对应的计算机程序,以实现以下步骤。The embodiment provides a terminal in which the detecting device of the sound playing device provided in this embodiment can be integrated. FIG. 7 is a schematic structural diagram of a terminal according to an embodiment of the present disclosure. The terminal may be, for example, a mobile terminal. As shown in FIG. 7, the terminal may include a casing (not shown), a memory 701, and a central processing unit (CPU) 702 (also referred to as a processor, below). Referred to as CPU), a circuit board (not shown), a power supply circuit (not shown), a microphone 713, and a sound playback device (such as speaker 711 in the figure). The circuit board is disposed inside a space enclosed by the casing; the CPU 702 and the memory 701 are disposed on the circuit board; and the power circuit is configured to supply power to a plurality of circuits or devices of the terminal The memory 701 is configured to store executable program code; the CPU 702 runs a computer program corresponding to the executable program code by reading executable program code stored in the memory 701 to implement the following steps.
监测到声音播放器件的检测事件被触发时,以预设音量等级通过声音播放器件播放预设音频文件并控制麦克风采集样本音频信号。When it is detected that the detection event of the sound playing device is triggered, the preset audio file is played by the sound playing device at a preset volume level and the microphone is controlled to collect the sample audio signal.
将所述样本音频信号与预设音频信号进行比较,其中,所述预设音频信号为在所述声音播放器件的发声位置不存在异物的情况下以所述预设音量等级播放所述预设音频文件并通过所述麦克风采集到的音频信号。以及Comparing the sample audio signal with a preset audio signal, wherein the preset audio signal is played at the preset volume level in the absence of foreign matter at a sounding position of the sound playing device An audio file and an audio signal collected by the microphone. as well as
当比较结果满足预设条件时确定所述声音播放器件的发声位置存在异物。When the comparison result satisfies the preset condition, it is determined that there is a foreign object at the sounding position of the sound playing device.
所述终端还包括:外设接口703、RF(Radio Frequency,射频)电路705、音频电路706、扬声器711、电源管理芯片708、输入/输出(I/O)子系统709、触摸屏712、其他输入/控制设备710以及外部端口704,这些部件通过一个或多个通信总线或信号线707来通信。The terminal further includes: a peripheral interface 703, an RF (Radio Frequency) circuit 705, an audio circuit 706, a speaker 711, a power management chip 708, an input/output (I/O) subsystem 709, a touch screen 712, and other inputs. / Control device 710 and external port 704, these components communicate via one or more communication buses or signal lines 707.
图示终端700仅仅是终端的一个范例,并且终端700可以具有比图中所示出的更多的或者更少的部件,可以组合两个或更多的部件,或者可以具有不同的部件配置。图中所示出的各种部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。The illustrated terminal 700 is merely one example of a terminal, and the terminal 700 may have more or fewer components than those shown in the figures, two or more components may be combined, or may have different component configurations. The various components shown in the figures can be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
下面就本实施例提供的用于提示用户的终端进行描述,该终端以手机为例。The following describes the terminal for prompting the user provided in this embodiment, and the terminal takes a mobile phone as an example.
存储器701,所述存储器701可以被CPU702、外设接口703等访问,所述存储器701可以包括高速随机存取存储器,还可以包括非易失性存储器,例如一个或多个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory 701 can be accessed by the CPU 702, the peripheral interface 703, etc., and the memory 701 can include a high speed random access memory, and can also include a non-volatile memory, such as one or more magnetic disk storage devices, flash memory devices. Or other volatile solid-state storage devices.
外设接口703,所述外设接口703可以将设备的输入和输出外设连接到CPU702和存储器701。 Peripheral interface 703, which can connect the input and output peripherals of the device to CPU 702 and memory 701.
I/O子系统709,所述I/O子系统709可以将设备上的输入输出外设,例如触摸屏712和其他输入/控制设备710,连接到外设接口703。I/O子系统709可以包括显示控制器7091和用于控制其他输入/控制设备710的一个或多个输入控制器7092。其中,一个或多个输入控制器7092从其他输入/控制设备710接收电信号或者向其他输入/控制设备710发送电信号,其他输入/控制设备710可以包括物理按钮(按压按钮、摇臂按钮等)、拨号盘、滑动开关、操纵杆、点击滚轮。输入控制器7092可以与以下任一个连接:键盘、红外端口、USB接口以及诸如鼠标的指示设备。I/O subsystem 709, which can connect input and output peripherals on the device, such as touch screen 712 and other input/control devices 710, to peripheral interface 703. The I/O subsystem 709 can include a display controller 7091 and one or more input controllers 7092 for controlling other input/control devices 710. Wherein, one or more input controllers 7092 receive electrical signals from other input/control devices 710 or transmit electrical signals to other input/control devices 710, and other input/control devices 710 may include physical buttons (press buttons, rocker buttons, etc.) ), dial, slide switch, joystick, click wheel. The input controller 7092 can be connected to any of the following: a keyboard, an infrared port, a USB interface, and a pointing device such as a mouse.
触摸屏712,所述触摸屏712是用户移动终端与用户之间的输入接口和输出接口,将可视输出显示给用户,可视输出可以包括图形、文本、图标、视频等。The touch screen 712 is an input interface and an output interface between the user mobile terminal and the user, and displays the visual output to the user. The visual output may include graphics, text, icons, videos, and the like.
I/O子系统709中的显示控制器7091从触摸屏712接收电信号或者向触摸屏712发送电信号。触摸屏712检测触摸屏上的接触,显示控制器7091将检测到的接触转换为与显示在触摸屏712上的用户界面对象的交互,即实现人机交互,显示在触摸屏712上的用户界面对象可以是运行游戏的图标、联网到相应网络的图标等。其中,设备还可以包括光鼠,光鼠是不显示可视输出的触摸敏感表面,或者是由触摸屏形成的触摸敏感表面的延伸。 Display controller 7091 in I/O subsystem 709 receives an electrical signal from touch screen 712 or an electrical signal to touch screen 712. Touch screen 712 detects contact on the touch screen, display controller 7091 converts the detected contact into interaction with a user interface object displayed on touch screen 712, ie, implements human-computer interaction, and the user interface object displayed on touch screen 712 can be operational The icon of the game, the icon of the network to the corresponding network, and the like. Wherein, the device may further comprise a light mouse, which is a touch sensitive surface that does not display a visual output, or an extension of a touch sensitive surface formed by the touch screen.
RF电路705,设置为建立手机与无线网络(即网络侧)的通信,实现手机与无线网络的数据接收和发送。例如收发短信息、电子邮件等。RF电路705接收并发送RF信号,RF信号也称为电磁信号,RF电路705将电信号转换为电磁信号或将电磁信号转换为电信号,并且通过该电磁信号与通信网络以及其他设备进行通信。RF电路705可以包括用于执行这些功能的已知电路,其包括天线系统、RF收发机、一个或多个放大器、调谐器、一个或多个振荡器、数字信号处理器、编译码器(COder-DECoder,CODEC)芯片组、用户标识模块(Subscriber Identity Module,SIM)等等。The RF circuit 705 is configured to establish communication between the mobile phone and the wireless network (ie, the network side) to implement data reception and transmission between the mobile phone and the wireless network. For example, sending and receiving short messages, emails, and the like. The RF circuit 705 receives and transmits an RF signal, also referred to as an electromagnetic signal, which converts the electrical signal into an electromagnetic signal or converts the electromagnetic signal into an electrical signal and communicates with the communication network and other devices through the electromagnetic signal. The RF circuit 705 may include known circuitry for performing these functions, including an antenna system, an RF transceiver, one or more amplifiers, a tuner, one or more oscillators, a digital signal processor, a codec (COder) -DECoder, CODEC) Chipset, Subscriber Identity Module (SIM), etc.
音频电路706,设置为从外设接口703接收音频数据,将该音频数据转换为电信号,并且将该电信号发送给扬声器711。The audio circuit 706 is arranged to receive audio data from the peripheral interface 703, convert the audio data into an electrical signal, and transmit the electrical signal to the speaker 711.
扬声器711,设置为将手机通过RF电路705从无线网络接收的语音信号,还原为声音并向用户播放该声音。The speaker 711 is arranged to restore the voice signal received by the mobile phone from the wireless network through the RF circuit 705 to sound and play the sound to the user.
电源管理芯片708,设置为为CPU702、I/O子系统及外设接口所连接的硬 件进行供电及电源管理。The power management chip 708 is configured to provide power and power management for the hardware connected to the CPU 702, the I/O subsystem, and the peripheral interface.
本实施例提供的终端,能够自动检测出扬声器或听筒等声音播放器件被异物堵塞,丰富了终端的功能。The terminal provided in this embodiment can automatically detect that the sound playing device such as the speaker or the earpiece is blocked by foreign matter, thereby enriching the function of the terminal.
上述实施例中提供的声音播放器件的检测装置及终端可执行本公开任意实施例所提供的声音播放器件的检测方法,具备执行该方法相应的功能模块。未在上述实施例中描述的技术细节,可参见本公开任意实施例所提供的声音播放器件的检测方法。The detecting device and the terminal of the sound playing device provided in the above embodiments may perform the detecting method of the sound playing device provided by any embodiment of the present disclosure, and have a corresponding functional module for performing the method. For details of the techniques not described in the above embodiments, reference may be made to the method of detecting a sound playing device provided by any of the embodiments of the present disclosure.

Claims (20)

  1. 一种声音播放器件的检测方法,包括:A method for detecting a sound playing device, comprising:
    监测到声音播放器件的检测事件被触发时,以预设音量等级通过声音播放器件播放预设音频文件并控制麦克风采集样本音频信号;When it is detected that the detection event of the sound playing device is triggered, playing the preset audio file through the sound playing device at a preset volume level and controlling the microphone to collect the sample audio signal;
    将所述样本音频信号与预设音频信号进行比较,其中,所述预设音频信号为在所述声音播放器件的发声位置不存在异物的情况下以所述预设音量等级播放所述预设音频文件并通过所述麦克风采集到的音频信号;Comparing the sample audio signal with a preset audio signal, wherein the preset audio signal is played at the preset volume level in the absence of foreign matter at a sounding position of the sound playing device An audio file and an audio signal collected by the microphone;
    当比较结果满足预设条件时,确定所述声音播放器件的发声位置存在异物。When the comparison result satisfies the preset condition, it is determined that there is a foreign object in the sounding position of the sound playing device.
  2. 根据权利要求1所述的方法,其中,在将所述样本音频信号与预设音频信号进行比较之前,所述方法还包括:对所述样本音频信号进行去噪处理,以滤除播放环境中的噪声对所述样本音频信号的干扰。The method of claim 1, wherein before comparing the sample audio signal with a preset audio signal, the method further comprises: performing a denoising process on the sample audio signal to filter out a playback environment The interference of the noise on the sample audio signal.
  3. 根据权利要求1或2所述的方法,其中,所述将所述样本音频信号与预设音频信号进行比较,包括:将对应同一预设时段的所述样本音频信号的第一声音响度与预设音频信号的第二声音响度进行比较,以得到声音响度比较结果。The method according to claim 1 or 2, wherein said comparing said sample audio signal with a preset audio signal comprises: first sounding the first sound level of said sample audio signal corresponding to the same preset time period The second acoustic level of the preset audio signal is compared to obtain a sound acoustic comparison result.
  4. 根据权利要求3所述的方法,其中,所述当比较结果满足预设条件时确定所述声音播放器件的发声位置存在异物,包括:当所述声音响度比较结果中包括所述第一声音响度小于所述第二声音响度与预设比例值的乘积时,确定所述声音播放器件的发声位置存在异物。The method according to claim 3, wherein the determining that there is a foreign object in the sounding position of the sound playing device when the comparison result satisfies the preset condition comprises: including the first sound sound in the sound sound level comparison result When the degree is less than the product of the second acoustic sound level and the preset proportional value, it is determined that there is a foreign object in the sounding position of the sound playing device.
  5. 根据权利要求4所述的方法,其中,在所述确定所述声音播放器件的发声位置存在异物之后,所述方法还包括:监测到声音播放事件时,对当前播放方式进行调整,以提高播放音量。The method according to claim 4, wherein after the determining that there is a foreign object in the sounding position of the sound playing device, the method further comprises: adjusting the current playing mode to improve the playing when the sound playing event is monitored volume.
  6. 根据权利要求5所述的方法,其中,所述对当前播放方式进行调整,包括:以目标音量等级通过所述声音播放器件进行声音播放,其中,所述目标音量等级高于当前音量等级的设置值。The method according to claim 5, wherein the adjusting the current play mode comprises: performing sound play by the sound playback device at a target volume level, wherein the target volume level is higher than a current volume level setting value.
  7. 根据权利要求6所述的方法,其中,在所述确定所述声音播放器件的发声位置存在异物之后,所述方法还包括:The method according to claim 6, wherein after the determining that there is a foreign object in the sounding position of the sound playing device, the method further comprises:
    根据所述乘积与所述第一声音响度确定对应的音量等级调整值;Determining a corresponding volume level adjustment value according to the product and the first acoustic sound level;
    所述以目标音量等级通过所述声音播放器件进行声音播放,包括:Performing sound playback by the sound playing device at a target volume level, including:
    根据当前音量等级的设置值与所述音量等级调整值确定目标音量等级;Determining a target volume level according to the set value of the current volume level and the volume level adjustment value;
    以所述目标音量等级通过所述声音播放器件进行声音播放。Sound playback is performed by the sound playback device at the target volume level.
  8. 一种声音播放器件的检测装置,包括:A detecting device for a sound playing device, comprising:
    播放控制模块,设置为在监测到声音播放器件的检测事件被触发时,以预设音量等级通过声音播放器件播放预设音频文件;a play control module configured to play the preset audio file through the sound playing device at a preset volume level when the detection event of the sound playing device is detected is triggered;
    音频采集控制模块,设置为在以预设音量等级通过声音播放器件播放预设音频文件的同时控制麦克风采集样本音频信号;The audio collection control module is configured to control the microphone to collect the sample audio signal while playing the preset audio file through the sound playing device at a preset volume level;
    信号比较模块,设置为将所述样本音频信号与预设音频信号进行比较,其中,所述预设音频信号为在所述声音播放器件的发声位置不存在异物的情况下以所述预设音量等级播放所述预设音频文件并通过所述麦克风采集到的音频信号;a signal comparison module configured to compare the sample audio signal with a preset audio signal, wherein the preset audio signal is at the preset volume without a foreign object in a sounding position of the sound playing device Level playing the preset audio file and the audio signal collected by the microphone;
    异物判定模块,设置为在比较结果满足预设条件时确定所述声音播放器件的发声位置存在异物。The foreign matter determination module is configured to determine that there is a foreign object in the sounding position of the sound playing device when the comparison result satisfies the preset condition.
  9. 根据权利要求8所述的装置,还包括去噪模块,设置为在将所述样本音频信号与预设音频信号进行比较之前,对所述样本音频信号进行去噪处理,以滤除播放环境中的噪声对所述样本音频信号的干扰。The apparatus of claim 8, further comprising a denoising module configured to perform denoising processing on the sample audio signal prior to comparing the sample audio signal with a preset audio signal to filter out a playback environment The interference of the noise on the sample audio signal.
  10. 根据权利要求8或9所述的装置,其中,所述信号比较模块还设置为:将对应同一预设时段的所述样本音频信号的第一声音响度与预设音频信号的第二声音响度进行比较,以得到声音响度比较结果。The apparatus according to claim 8 or 9, wherein the signal comparison module is further configured to: the first sound level of the sample audio signal corresponding to the same preset time period and the second sound level of the preset audio signal Compare to get the sound and sound comparison results.
  11. 根据权利要求10所述的装置,所述异物判定模块还设置为:当所述声音响度比较结果中包括所述第一声音响度小于所述第二声音响度与预设比例值的乘积时,确定所述声音播放器件的发声位置存在异物。The apparatus according to claim 10, wherein the foreign object determination module is further configured to: when the first sound level is less than the product of the second sound level and the preset ratio value, It is determined that there is a foreign matter in the sounding position of the sound playing device.
  12. 根据权利要求11所述的装置,还包括播放调整模块,设置为在所述确定所述声音播放器件的发声位置存在异物之后,监测到声音播放事件时,对当前播放方式进行调整,以提高播放音量。The apparatus according to claim 11, further comprising a play adjustment module configured to adjust a current play mode to improve playback after detecting a sound play event after determining that a foreign object exists in a sounding position of the sound playing device volume.
  13. 根据权利要求12所述的装置,所述播放调整模块,还设置为:以目标音量等级通过所述声音播放器件进行声音播放,其中,所述目标音量等级高于当前音量等级的设置值。The apparatus according to claim 12, wherein the play adjustment module is further configured to: perform sound playback by the sound playback device at a target volume level, wherein the target volume level is higher than a set value of the current volume level.
  14. 根据权利要求13所述的装置,还包括调整值确定模块,设置为在所述确定所述声音播放器件的发声位置存在异物之后,根据所述乘积与所述第一声音响度确定对应的音量等级调整值;The apparatus according to claim 13, further comprising an adjustment value determining module configured to determine a corresponding volume according to the product and the first acoustic sound level after the determining that there is a foreign object in the sounding position of the sound playing device Level adjustment value;
    所述播放调整模块,还设置为:根据当前音量等级的设置值与所述音量等级调整值确定目标音量等级;以所述目标音量等级通过所述声音播放器件进行声音播放。The play adjustment module is further configured to: determine a target volume level according to the set value of the current volume level and the volume level adjustment value; and perform sound playback by the sound playing device at the target volume level.
  15. 一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如权利要求1-7中任一所述的声音播放器件的检测方法。A computer readable storage medium having stored thereon a computer program, the program being executed by a processor to implement the method of detecting a sound playing device according to any one of claims 1-7.
  16. 一种终端,包括麦克风,声音播放器件,存储器,处理器及存储在存储器上并可在处理器运行的计算机程序,其中,所述处理器执行所述计算机程序时实现如权利要求1-7任一所述的声音播放器件的检测方法。A terminal comprising a microphone, a sound playing device, a memory, a processor, and a computer program stored on the memory and operable on the processor, wherein the processor executes the computer program as claimed in any of claims 1-7 A method of detecting a sound playback device as described.
  17. 根据权利要求16所述的终端,还包括:外设接口、射频电路、音频电路以及扬声器,所述外设接口、射频电路、音频电路以及扬声器之间通过一个或多个通信总线或信号线通信。The terminal of claim 16, further comprising: a peripheral interface, a radio frequency circuit, an audio circuit, and a speaker, wherein the peripheral interface, the radio frequency circuit, the audio circuit, and the speaker communicate via one or more communication buses or signal lines .
  18. 根据权利要求17所述的终端,其中,所述射频电路设置为建立所述终端与无线网络的通信,实现所述终端与所述无线网络的数据接收和发送。The terminal of claim 17, wherein the radio frequency circuit is configured to establish communication between the terminal and a wireless network to implement data reception and transmission by the terminal and the wireless network.
  19. 根据权利要求18所述的终端,所述音频电路,设置为从所述外设接口接收音频数据,将所述音频数据转换为电信号,并将所述电信号发送给所述扬声器。The terminal of claim 18, said audio circuit being arranged to receive audio data from said peripheral interface, convert said audio data into an electrical signal, and transmit said electrical signal to said speaker.
  20. 根据权利要求19所述的终端,所述扬声器,设置为将所述电信号还原为声音,并播放所述声音。The terminal of claim 19, said speaker being arranged to restore said electrical signal to sound and play said sound.
PCT/CN2018/099660 2017-08-18 2018-08-09 Sound playback device detection method, apparatus, storage medium, and terminal WO2019033986A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710710680.X 2017-08-18
CN201710710680.XA CN107509153B (en) 2017-08-18 2017-08-18 Detection method and device of sound playing device, storage medium and terminal

Publications (1)

Publication Number Publication Date
WO2019033986A1 true WO2019033986A1 (en) 2019-02-21

Family

ID=60692064

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/099660 WO2019033986A1 (en) 2017-08-18 2018-08-09 Sound playback device detection method, apparatus, storage medium, and terminal

Country Status (2)

Country Link
CN (1) CN107509153B (en)
WO (1) WO2019033986A1 (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107509153B (en) * 2017-08-18 2020-01-14 Oppo广东移动通信有限公司 Detection method and device of sound playing device, storage medium and terminal
CN108196991A (en) * 2017-12-27 2018-06-22 长沙联远电子科技有限公司 Embedded device quality self-assessment control method, device and storage medium
CN109040937B (en) * 2018-07-24 2020-08-28 Oppo(重庆)智能科技有限公司 Microphone blockage reminding method and related device
CN109005272B (en) * 2018-07-24 2021-01-29 Oppo(重庆)智能科技有限公司 Voice pickup method and related product
CN108958699B (en) * 2018-07-24 2021-12-07 Oppo(重庆)智能科技有限公司 Voice pickup method and related product
CN109003619A (en) * 2018-07-24 2018-12-14 Oppo(重庆)智能科技有限公司 Voice data generation method and relevant apparatus
CN112203206B (en) 2018-07-26 2022-01-25 Oppo广东移动通信有限公司 Microphone hole blockage detection method and related product
CN109147821A (en) * 2018-08-20 2019-01-04 Oppo广东移动通信有限公司 Intelligent terminal audio-frequency detection, electronic device and computer readable storage medium
CN109218913B (en) * 2018-08-27 2021-08-31 奇酷互联网络科技(深圳)有限公司 Sound adjusting method, terminal equipment and device with storage function
CN110995921A (en) * 2019-11-19 2020-04-10 维沃移动通信有限公司 Call processing method, electronic device and computer readable storage medium
CN111627416B (en) * 2020-05-13 2023-10-20 广州国音智能科技有限公司 Audio noise elimination method, device, equipment and storage medium
CN111654800B (en) * 2020-05-28 2021-09-17 维沃移动通信有限公司 Speaker control method, speaker control device, electronic device, and medium
CN111836166A (en) * 2020-06-16 2020-10-27 钟杰东 Integrated audio system of mobile communication terminal
CN116208700B (en) * 2023-04-25 2023-07-21 深圳市华卓智能科技有限公司 Control method and system for communication between mobile phone and audio equipment
CN116866809B (en) * 2023-07-18 2024-02-09 广东保伦电子股份有限公司 Audio playing equipment fault detection method

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0373879A (en) * 1989-08-15 1991-03-28 Sumitomo Metal Ind Ltd Automatic volume control method of acoustic device for automobile
CN103202006A (en) * 2011-02-17 2013-07-10 夏普株式会社 Electronic device, controlling method and controlling program for electronic device, and recording medium
US20150201278A1 (en) * 2014-01-14 2015-07-16 Cisco Technology, Inc. Muting a sound source with an array of microphones
CN104853036A (en) * 2015-04-22 2015-08-19 惠州Tcl移动通信有限公司 Mobile terminal for automatically adjusting ringing volume and method thereof
CN105100330A (en) * 2015-08-26 2015-11-25 广东欧珀移动通信有限公司 Method and mobile terminal for optimizing equipment sound effect
CN107509153A (en) * 2017-08-18 2017-12-22 广东欧珀移动通信有限公司 Detection method, device, storage medium and the terminal of Audio Players part

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8374362B2 (en) * 2008-01-31 2013-02-12 Qualcomm Incorporated Signaling microphone covering to the user
WO2015127194A1 (en) * 2014-02-20 2015-08-27 Harman International Industries, Inc. Environment sensing intelligent apparatus
CN105989853B (en) * 2015-02-28 2020-08-18 科大讯飞股份有限公司 Audio quality evaluation method and system
DE102015217565A1 (en) * 2015-09-15 2017-03-16 Ford Global Technologies, Llc Method and device for processing audio signals
CN105224280A (en) * 2015-09-25 2016-01-06 联想(北京)有限公司 Control method, device and electronic equipment
CN106850966A (en) * 2016-12-28 2017-06-13 努比亚技术有限公司 A kind of method for realizing volume control, device and mobile terminal
CN106792423B (en) * 2017-02-28 2020-04-14 维沃移动通信有限公司 Method for removing foreign matters in loudspeaker and mobile terminal
CN106911996A (en) * 2017-03-03 2017-06-30 广东欧珀移动通信有限公司 The detection method of microphone state, device and terminal device
CN106851516A (en) * 2017-03-03 2017-06-13 广东欧珀移动通信有限公司 Electronic installation and the detection method based on loudness

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0373879A (en) * 1989-08-15 1991-03-28 Sumitomo Metal Ind Ltd Automatic volume control method of acoustic device for automobile
CN103202006A (en) * 2011-02-17 2013-07-10 夏普株式会社 Electronic device, controlling method and controlling program for electronic device, and recording medium
US20150201278A1 (en) * 2014-01-14 2015-07-16 Cisco Technology, Inc. Muting a sound source with an array of microphones
CN104853036A (en) * 2015-04-22 2015-08-19 惠州Tcl移动通信有限公司 Mobile terminal for automatically adjusting ringing volume and method thereof
CN105100330A (en) * 2015-08-26 2015-11-25 广东欧珀移动通信有限公司 Method and mobile terminal for optimizing equipment sound effect
CN107509153A (en) * 2017-08-18 2017-12-22 广东欧珀移动通信有限公司 Detection method, device, storage medium and the terminal of Audio Players part

Also Published As

Publication number Publication date
CN107509153A (en) 2017-12-22
CN107509153B (en) 2020-01-14

Similar Documents

Publication Publication Date Title
WO2019033986A1 (en) Sound playback device detection method, apparatus, storage medium, and terminal
US11251763B2 (en) Audio signal adjustment method, storage medium, and terminal
WO2019033987A1 (en) Prompting method and apparatus, storage medium, and terminal
US20170126192A1 (en) Method, device, and computer-readable medium for adjusting volume
CN107105367B (en) Audio signal processing method and terminal
JP6505252B2 (en) Method and apparatus for processing audio signals
CN107506167B (en) Volume control method and device of mobile terminal, storage medium and mobile terminal
CN107562405B (en) Audio playing control method and device, storage medium and mobile terminal
CN107371102B (en) Audio playing volume control method and device, storage medium and mobile terminal
CN108449507B (en) Voice call data processing method and device, storage medium and mobile terminal
WO2019174492A1 (en) Voice call data detection method, device, storage medium and mobile terminal
CN107122161B (en) Audio data playing control method and terminal
CN107483735A (en) Method for controlling volume, device and the storage medium and mobile terminal of mobile terminal
CN107493500A (en) Multimedia resource player method and device
CN108418968B (en) Voice call data processing method and device, storage medium and mobile terminal
WO2017020422A1 (en) Audio circuit selection method, device, circuit, and handheld terminal
CN108172237B (en) Voice call data processing method and device, storage medium and mobile terminal
CN104021148A (en) Method and device for adjusting sound effect
CN106453838B (en) Volume adjusting method and device
CN109087650A (en) voice awakening method and device
CN107547732A (en) A kind of media play volume adjusting method, device, terminal and storage medium
CN105101013A (en) Method and device for playing voice signals
CN107799113B (en) Audio processing method and device, storage medium and mobile terminal
CN111988704B (en) Sound signal processing method, device and storage medium
WO2015030642A1 (en) Volume reduction for an electronic device

Legal Events

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

Ref document number: 18846877

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

Country of ref document: EP

Kind code of ref document: A1