A volume adjustment method, an electronic device, and a readable storage medium
By collecting and processing sound data, the volume of electronic devices is automatically adjusted to adapt to the external noise environment, the problem of user manual adjustment of volume is solved, and the user experience and device intelligence is improved.
Patent Information
- Application Number
- CN202210322505.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-29
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2042-03-29
AI Technical Summary
Existing electronic devices require users to manually adjust the volume under the influence of external noise environment, resulting in poor user experience.
By collecting sound data, sampling and processing of voice and noise data, the device volume is automatically adjusted to adapt to the external noise environment.
Automatic adjustment of device volume is realized, improving user experience, ensuring that the device does not interfere with the user during conversation, and keeping the volume stable when the noise changes.
Smart Images

Figure CN114664320B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of electronic devices, and in particular, relates to a volume adjustment method, an electronic device and a readable storage medium. Background Art
[0002] With the development of science and technology, various electronic devices continue to appear in people's lives, providing great convenience for people. However, when smart speakers, AR (Augmented Reality) devices, VR (Virtual Reality) devices, headphones, etc. play sounds, the sound played by the device is covered by the external noise due to the influence of the external noise environment, thus affecting the user's ability to hear the sound played by the device. At this time, it is necessary to manually adjust the volume of the device's sound so that the sound played by the device can be heard by the user; in addition, the external noise environment is unstable, and the noise is sometimes loud and sometimes soft. As a result, users need to constantly adjust the volume of the sound played by the device, which brings inconvenience to users and affects user experience. Summary of the invention
[0003] The present application aims to provide a volume adjustment method, an electronic device and a readable storage medium to solve the problem that existing sound-generating devices require users to constantly adjust the volume of the played sound to adapt to the external noise environment.
[0004] In a first aspect, the present application provides a volume adjustment method, comprising:
[0005] Collect sound data;
[0006] Sampling the voice data in the sound data once, calculating a voice effective value according to a sample formed by the once sampling, and comparing the voice effective value with a preset value;
[0007] If the speech effective value is greater than the preset value, the electronic device stops playing the sound; if the speech effective value is less than the preset value, the sound data is resampled, the sound effective value is calculated based on the samples formed by the resampling, and the volume of the sound played by the electronic device is adjusted according to the sound effective value.
[0008] Optionally, the electronic device includes an external speaker, the sound data further includes noise data and external speaker data; and the secondary sampling of the sound data includes:
[0009] The externally played data is eliminated, and secondary sampling is performed according to the voice data and the noise data in the sound data.
[0010] Optionally, the eliminating the external data includes:
[0011] Eliminate the external sound data in the sound data through an echo cancellation method.
[0012] Optionally, the secondary sampling of the sound data and the calculation of the effective sound value based on the samples formed by the secondary sampling include:
[0013] Perform secondary sampling on the sound data within a predetermined time at a predetermined sampling frequency, and calculate the effective sound value based on the collected samples.
[0014] Optionally, the predetermined time is 5 seconds and / or the sampling frequency is 48 kHz.
[0015] Optionally, the collection of the sound data includes: collecting the sound data through a microphone array provided on the electronic device.
[0016] Optionally, the calculation of the effective speech value based on the samples formed by the primary sampling includes: performing a root mean square calculation on the amplitudes of the samples formed by the primary sampling, and the obtained value is the effective speech value.
[0017] Optionally, the calculation of the effective sound value based on the samples formed by the secondary sampling includes: performing a root mean square calculation on the amplitudes of the samples formed by the secondary sampling, and the obtained value is the effective sound value.
[0018] In a second aspect, the present application provides an electronic device for performing the above-mentioned volume adjustment method.
[0019] Optionally, the electronic device includes:
[0020] Temple arms and a frame, the temple arms are provided on the frame;
[0021] A microphone array, the microphone array includes a plurality of microphones, and the plurality of microphones are distributed on the temple arms and / or the frame.
[0022] Optionally, the electronic device further includes a prompting component. The microphone array can judge the speech direction, and in a state where the microphone array judges the speech direction, the prompting component makes a response.
[0023] In a third aspect, the present application provides an electronic device, including a processor, a memory, and a program or instruction stored on the memory and executable on the processor. When the program or instruction is executed by the processor, the steps of the volume adjustment method as described above are implemented.
[0024] In a fourth aspect, the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the volume adjustment method as described above are implemented.
[0025] One technical effect of the application is that by processing and calculating the collected sound data, the volume of the device can be automatically adjusted so that the volume of the sound played by the device adapts to the external noise environment, enabling the user to clearly identify the sound played by the device.
[0026] Other features and advantages of the present application will become clear from the following detailed description of the exemplary embodiments of the present application with reference to the accompanying drawings. Description of the Drawings
[0027] The drawings incorporated in and constituting a part of this specification illustrate embodiments of the present application and, together with the description, are used to explain the principles of the present application.
[0028] Figure 1 is a flowchart of a volume adjustment method provided by the present application;
[0029] Figure 2 is a schematic structural diagram of smart glasses applying the above volume adjustment method.
[0030] Reference Numerals:
[0031] 1, temple; 2, frame; 3, microphone. Detailed Embodiments
[0032] Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. It should be noted that: unless otherwise specifically stated, the relative arrangements, numerical expressions, and numerical values of the components and steps set forth in these embodiments do not limit the scope of the present application.
[0033] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way a limitation on the present application or its application or use.
[0034] Techniques, methods, and devices known to those of ordinary skill in the relevant art may not be discussed in detail, but where appropriate, such techniques, methods, and devices should be regarded as part of the specification.
[0035] In all the examples shown and discussed herein, any specific values should be construed as merely exemplary and not as limitations. Accordingly, other examples of the exemplary embodiments may have different values.
[0036] It should be noted that: like reference numerals and letters denote like items in the following drawings, and thus, once an item is defined in one drawing, it need not be further discussed in subsequent drawings.
[0037] In a first aspect, the present application provides a volume adjustment method, as Figure 1As shown, sound data needs to be collected in this method. During the operation of the electronic device, the sound data around the electronic device is collected in real time, facilitating the processing of the collected sound data in subsequent steps. Specifically, the sound around the device can be collected through the audio input device on the device and formed into sound data for subsequent analysis. For example, the microphone 3 provided on the device can be used for real-time recording, and then the recorded sound data is processed.
[0038] Specifically, the device can be an AR glasses, on which a microphone 3 and a processing module are provided. During the operation of the AR glasses, the microphone 3 records the sound around the AR glasses in real time and forms sound data, and the processing module of the AR glasses receives and processes the above sound data.
[0039] This method needs to perform a first sampling on the speech data in the sound data, calculate the speech effective value according to the samples formed by the first sampling, and compare the speech effective value with a preset value. By sampling, calculating, and comparing with the preset value according to the speech data in the sound data, it can be judged whether the user of the electronic device is talking to others through the comparison result, and then control whether the electronic device plays sound. The judgment of whether the user is in a conversation state based on the speech data is relatively accurate, which can reduce the misjudgment of the electronic device and avoid reducing the user experience.
[0040] It should be noted that the speech data in the sound data can be screened through specific algorithms or specific components to remove the noise other than the speech data in the sound data. The speech data specifically refers to the conversation sound. Specifically, the sound data is obtained by collecting the sound around the electronic device, and the sound around the electronic device includes both the noise formed by the surrounding environment, such as the conversation sound of passers-by, the sound of vehicle driving, etc., and the conversation sound of the user of the electronic device. In this application, the speech data is all the conversation sounds mentioned above. The first sampling can be to extract discrete multiple first data at multiple time nodes for continuous speech data within a unit time, and the multiple discrete first data are the samples formed by the first sampling. The speech effective value and the preset value belong to the same or similar concepts, representing the strength of the conversation sound. A preset value is set artificially as a reference. When the conversation sound is greater than the preset value, the electronic device judges that the user is in a conversation state. When the conversation sound is less than the preset value, the electronic device judges that the user is in a non-conversation state. For example, when the user is not talking and there is only the conversation sound of passers-by in the speech data, the speech effective value calculated according to the speech data of only the passers-by's conversation sound is less than the preset value, and the electronic device judges that the user is not talking.
[0041] Specifically, the electronic device is an AR glasses, on which a microphone 3 and a processing module are provided. During the operation of the AR glasses, the microphone 3 records the sounds around the AR glasses in real time to form sound data, and the processing module of the AR glasses receives the above-mentioned sound data, and samples, calculates the voice data in the above-mentioned sound data through the processing module, and compares it with a preset value.
[0042] Optionally, the secondary sampling of the sound data and the calculation of the effective sound value according to the samples formed by the secondary sampling include performing a first sampling on the voice data within a predetermined time at a predetermined sampling frequency. This can avoid the too-fast speed of the first sampling and calculation, which may cause the electronic device to frequently feedback on the comparison result and affect the user experience. For example, when passers-by are talking loudly and just pass by the user, if the sampling and calculation speed is too fast, the device may misjudge that the user is in a conversation state, and then adjust the electronic device, but this adjustment is not needed, and at this time, it will affect the user experience of the customer; if the duration of continuous voice data is appropriately extended and the sampling frequency is increased, the device can more accurately determine whether the user is in a conversation state, so as to more accurately adjust the electronic device. For example, it is set to collect 5 seconds of voice data with a sampling frequency of 48KHz. That is to say, a total of 48K * 5 discrete data are collected in the first sampling, and then the effective voice value is calculated according to the above-mentioned discrete data, and the calculation result is compared with the preset value, which can more accurately determine whether the user is in a conversation state.
[0043] If the effective voice value is greater than the preset value, the electronic device determines that the user is in a conversation state, then the electronic device stops playing sound, which can avoid the sound played by the electronic device from affecting the user's conversation, achieve the self-adjustment of the usage state of the electronic device according to the external environment, and improve the user experience.
[0044] Further, after the electronic device stops playing sound, the electronic device continues to perform the steps of collecting sound data, performing a first sampling on the voice data in the sound data, calculating the effective voice value according to the samples formed by the first sampling, and comparing the effective voice value with the preset value. At this time, when the calculated effective voice value is less than the preset value, the electronic device continues to play. After the user finishes the conversation, the electronic device can automatically resume the state of playing sound, further improving the user experience.
[0045] If the effective voice value is less than the preset value, perform secondary sampling on the sound data, calculate the effective sound value according to the samples formed by the secondary sampling, and adjust the volume of the sound played by the electronic device according to the effective sound value.
[0046] It should be noted that the secondary sampling can be to extract continuous sound data at multiple time nodes in a unit time to form a plurality of discrete second data, and the plurality of discrete second data are samples formed by secondary sampling. The sound effective value represents the strength of the sound in the environment surrounding the electronic device. The sound effective value and the volume of the sound played by the electronic device are in a one-to-one correspondence. When a specific sound effective value is calculated, the electronic device automatically adjusts the volume to the volume corresponding to the specific sound effective value. Among them, the sound effective value can be a specific value or a specific range of values.
[0047] The present application can automatically adjust the volume of the device by processing and calculating the collected sound data, so that the volume of the sound played by the device is adapted to the external noise environment, so that the user can clearly identify the sound played by the device. In addition, when talking with outsiders, the electronic device can automatically stop playing the sound, ensuring that the electronic device will not affect the user's conversation, thereby improving the intelligence of the electronic device.
[0048] Optionally, the device includes an external speaker, and the external speaker includes a speaker or other device that can transmit sound over a certain distance and can play sound externally. When the external speaker works in the form of external speaker, the external speaker can collect sound data in its surrounding environment. At this time, the sound data includes voice data, noise data and external speaker data. The voice data is the conversation sound around the electronic device or the user's own conversation sound, etc. The noise data includes the sound of vehicles driving around the electronic device or the sound formed at a construction site, etc. The external speaker data is the sound played by the electronic device itself in the form of external speaker. Secondary sampling of the sound data includes eliminating the external speaker data in the sound data, and performing secondary sampling based on the voice data and the noise data in the sound data.
[0049] During secondary sampling, the external speaker data is eliminated, and only the voice data and the noise data are used for secondary sampling, which can prevent the electronic device from forming howling caused by positive feedback. Specifically, without eliminating the external speaker data, when the overall sound around the electronic device increases and the effective value of the sound increases, the external speaker volume of the electronic device increases, and the increase in the external speaker volume of the electronic device will further increase the sound around the electronic device, and then further increase the external speaker volume of the electronic device. In theory, this will be an infinite cycle, causing the sound played by the electronic device to increase infinitely. If the external speaker data is eliminated during secondary sampling, and only the voice data and the noise data are sampled and calculated, the above problems will not occur, ensuring the reliability of the electronic device. Among them, when there is no conversation around the electronic device, the voice data is zero, which does not affect the sound data collected by the electronic device including the voice data.
[0050] Optionally, the sound data within a predetermined time is subsampled at a predetermined sampling frequency, and the effective sound value is calculated based on the collected samples. This can prevent the subsampling and calculation from being too fast, which may cause the electronic device to provide frequent feedback on the calculation results and affect the user experience. For example, when the sound around the electronic device suddenly increases and then quickly returns to normal, if the subsampling and calculation are too fast, the volume of the device may suddenly increase and then decrease, resulting in a sudden change in the volume of the electronic device, which is not desired and will affect the user experience at this time. If the duration of continuous sound data is appropriately extended and the sampling frequency is increased, the volume adjustment of the device can be made more stable, and the volume of the electronic device will not fluctuate significantly, ensuring the user experience.
[0051] Optionally, the predetermined time is 5 seconds and / or the sampling frequency is 48 kHz. For example, the predetermined time is 5 seconds and the sampling frequency is 48 kHz. That is to say, a total of 48K * 5 discrete data are collected during subsampling, and then the effective sound value is calculated based on the above discrete data, which can make the sound adjustment of the electronic device relatively stable.
[0052] Optionally, the external sound data in the sound data is eliminated by an echo cancellation method. The echo cancellation method is creatively applied to this application to eliminate the voice signal in the sound signal collected by the electronic device, ensuring that only voice data and noise data are targeted during subsampling and calculation. Furthermore, it can prevent the electronic device from forming positive feedback and causing howling, guaranteeing the user experience. Among them, the echo cancellation method can be implemented by an adaptive filter, which is already an existing technology and will not be elaborated here. Specifically, the electronic device is an AR glasses, and the above processing process can also be performed in the processing module of the AR glasses.
[0053] Optionally, the collection of sound data includes collecting the sound data through a microphone 3 array provided on the device. The microphone 3 array is composed of multiple microphones 3 combined in a certain spatial distribution on the electronic device. The microphone 3 array can search for the position of the speaker under the control of an algorithm. After searching for the position of the speaker, it can direct the beam towards the current speaker to capture the speaker's voice, enabling the voice data in the sound data collected by the microphone 3 array to be more distinct, and enabling the electronic device to more accurately determine whether the user is in a conversation state.
[0054] Specifically, the electronic device can be an AR glasses, and multiple microphones 3 can be distributed on the temple 1 or the frame 2 of the AR glasses. The distance between adjacent microphones 3 or the layout among multiple microphones 3 varies according to different microphone 3 array algorithms. For example, under the first algorithm, the distance between each microphone 3 is no more than 2 cm, and under the second algorithm, the distance between each microphone 3 is no more than 5 cm.
[0055] Optionally, calculating the voice effective value based on the samples formed by the first sampling includes calculating the root mean square of the amplitudes of the samples formed by the first sampling, and the obtained value is the voice effective value. The value corresponding to each sample of the first sampling is the sound intensity value, such as 45 decibels. The root mean square of all the values obtained from the first sampling is calculated to obtain the voice effective value. It can reliably determine whether the user of the electronic device is in a conversation state in the form of data.
[0056] Optionally, calculating the sound effective value based on the samples formed by the second sampling includes calculating the root mean square of the amplitudes of the samples formed by the second sampling, and the obtained value is the sound effective value. The value corresponding to each sample of the second sampling is the sound intensity value, such as 50 decibels. The root mean square of all the values obtained from the second sampling is calculated to obtain the sound effective value. It can reliably determine the state of the external environment in the form of data and adjust the volume of the electronic device according to the state of the external environment. For example, when the conversation and noise in the external environment are relatively large, the electronic device can automatically increase its volume so that the user can clearly identify the sound played by the electronic device; when the conversation and noise in the external environment are relatively small, the electronic device can automatically lower its volume to ensure that the sound of the electronic device is just at a level where the user can clearly identify the sound played by the electronic device, avoiding the sound played by the electronic device from being too loud.
[0057] In a second aspect, the present application provides an electronic device for performing the above-mentioned volume adjustment method.
[0058] Optionally, the electronic device includes temple 1, frame 2, and microphone 3 array. That is to say, the electronic device is a pair of smart glasses. The temple 1 is used to wear the smart glasses on the user's head, and the user's eyes can face the lenses installed on the frame 2. The temple 1 is provided on the frame 2. The microphone 3 array includes multiple microphones 3, and the multiple microphones 3 are distributed on the temple 1 and / or the frame 2. It can ensure the rationality of the spatial distribution of the microphone 3 array and ensure the reliable operation of the present application.
[0059] Specifically, as Figure 2 shown, the temple 1 includes a first temple 1 and a second temple 1, and the first temple 1 and the second temple 1 are respectively provided on both sides of the frame 2. A microphone 3 is respectively provided in the middle of the first temple 1 and the second temple 1 in the length direction. A microphone 3 is respectively provided at the part of the upper edge of the frame 2 close to the first temple 1 and the second temple 1. A microphone 3 is provided in the middle of the upper edge of the frame 2. Two microphones 3 are provided at the lower edge of the frame 2, and the two microphones 3 are symmetrically arranged on the lower edge of the frame 2.
[0060] Optionally, the electronic device further includes a prompting component. The microphone array can determine the voice direction. In a state where the microphone array determines the voice direction, the prompting component makes a response to facilitate communication between the user and the other party.
[0061] The prompting component may include one or several of a speaker, a display, a vibrator, etc.
[0062] When the prompting component is one of the components listed above, the prompting component makes a single prompt. For example, when the prompting component is a speaker and the microphone array determines that the voice direction is on the right side of the user, the speaker emits a prompt sound indicating that the voice direction is on the right side. Similarly, when the prompting component is a display, the display shows the voice direction.
[0063] When the prompting component is multiple of the components listed above, the prompting component makes a combined prompt. For example, when the prompting component is a display and a speaker, the speaker emits a prompt sound of the voice direction. At the same time, the display shows the voice direction. Another example is that when the prompting component is a display and a camera module, the camera module captures an external image, and the display is used to display the image captured by the camera module, and the display prompts the voice direction, so that the user can know the sound source when wearing the electronic device of the present application and can see the other party through the display, facilitating communication.
[0064] In a third aspect, the present application provides an electronic device, including a processor, a memory, and a program or instruction stored on the memory and executable on the processor. When the program or instruction is executed by the processor, the steps of the volume adjustment method as described above are implemented.
[0065] According to the implementation subject of the method embodiment executed by the electronic device, it may be a server or a terminal device, which is not limited herein.
[0066] In an embodiment, any module in the above device embodiments can be implemented by a processor.
[0067] In a fourth aspect, the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the volume adjustment method as described above are implemented.
[0068] One embodiment or multiple embodiments of this specification may be a system, a method, and / or a computer program product. The computer program product may include a computer-readable storage medium, on which computer-readable program instructions for causing a processor to implement various aspects of this specification are loaded.
[0069] A computer-readable storage medium can be a tangible device that can hold and store instructions for use by an instruction execution device. A computer-readable storage medium may be, for example—but not limited to—an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disc (DVD), a memory stick, a floppy disk, a mechanically encoded device, such as a punched card or raised structures in grooves storing instructions thereon, and any suitable combination of the foregoing. The computer-readable storage medium used herein is not construed as an instantaneous signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated through a waveguide or other transmission medium (e.g., an optical pulse through an optical fiber cable), or an electrical signal transmitted through a wire.
[0070] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to various computing / processing devices, or downloaded to an external computer or external storage device through a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network may include a copper transmission cable, an optical fiber transmission, a wireless transmission, a router, a firewall, a switch, a gateway computer, and / or an edge server. A network adapter or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing / processing device.
[0071] The computer program instructions for performing the operations of the embodiments of this specification may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or it may be connected to an external computer (e.g., by using an Internet service provider to connect through the Internet). In some embodiments, by using the state information of the computer-readable program instructions to customize an electronic circuit, such as a programmable logic circuit, a field-programmable gate array (FPGA), or a programmable logic array (PLA), the electronic circuit can execute the computer-readable program instructions to implement various aspects of this specification.
[0072] Aspects of this specification are described herein with reference to the flowchart and / or block diagram of a method, apparatus (system), and computer program product according to an embodiment of this specification. It should be understood that each block of the flowchart and / or block diagram, and the combination of blocks in the flowchart and / or block diagram, can be implemented by computer-readable program instructions.
[0073] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine such that when these instructions are executed by the processor of the computer or other programmable data processing device, a device is produced that implements the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause a computer, a programmable data processing device, and / or other devices to work in a specific manner. Thus, the computer-readable medium storing the instructions includes a manufactured article that includes instructions for implementing various aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0074] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices, causing a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other devices to generate a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other devices to implement the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0075] The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present specification. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a part of an instruction, which contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions noted in the blocks may occur in an order different from that noted in the figures. For example, two consecutive blocks may actually be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, implementation by software, and implementation by a combination of software and hardware are equivalent.
[0076] Although some specific embodiments of the present application have been described in detail by way of examples, those skilled in the art should understand that the above examples are for illustrative purposes only and not for limiting the scope of the present application. Those skilled in the art should understand that the above embodiments can be modified without departing from the scope and spirit of the present application. The scope of the present application is defined by the appended claims.
Claims
1. A volume adjustment method, characterized in that, include: Collect sound data; Sampling the voice data in the sound data once, calculating a voice effective value according to a sample formed by the once sampling, and comparing the voice effective value with a preset value; If the voice validity value is greater than the preset value, the electronic device stops playing the sound; If the speech effective value is less than the preset value, resampling the sound data, calculating the sound effective value according to the samples formed by the resampling, and adjusting the volume of the sound played by the electronic device according to the sound effective value; The electronic device includes an external speaker, and the sound data also includes noise data and external speaker data; Subsampling the sound data comprises: The externally played data is eliminated, and secondary sampling is performed based on the voice data and the noise data in the sound data.
2. The volume adjustment method according to claim 1, wherein The eliminating the external data includes: The externally played data in the sound data is eliminated by an echo cancellation method.
3. The volume adjustment method according to claim 1, wherein The sub-sampling of the sound data and calculating the sound effective value according to the samples formed by the sub-sampling include: The sound data within a predetermined time is subsampled at a predetermined sampling frequency, and the sound effective value is calculated based on the collected samples.
4. The volume adjustment method according to claim 3, characterized in that The predetermined time is 5 seconds and / or the sampling frequency is 48 kHz.
5. The volume adjustment method according to claim 1, characterized in that, The collecting of sound data includes: collecting the sound data through a microphone array provided on the electronic device.
6. The volume adjustment method according to claim 1, wherein The calculating of the speech effective value according to the sample formed by the one-time sampling includes: performing root mean square calculation on the amplitude of the sample formed by the one-time sampling, and the obtained value is the speech effective value.
7. The volume adjustment method according to claim 1, wherein The calculating the sound effective value according to the sample formed by the secondary sampling includes: performing a root mean square calculation on the amplitude of the sample formed by the secondary sampling, and the obtained value is the sound effective value.
8. An electronic device, characterized in that, The method comprises a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the volume adjustment method according to any one of claims 1 to 7.
9. The electronic device according to claim 8, characterized in that, include: Temples and a mirror frame, wherein the temples are arranged on the mirror frame; A microphone array, wherein the microphone array includes a plurality of microphones, and the plurality of microphones are distributed on the temples and / or the frame.
10. The electronic device according to claim 9, characterized in that The electronic device also includes a prompt component, and the microphone array can determine the direction of speech. When the microphone array determines the direction of speech, the prompt component responds.
11. A readable storage medium, characterized in that, The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the volume adjustment method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Control method for multimedia playing and mobile terminal
CN105096977A
Intelligent glasses with ESIM and TWS functions
CN211653331U