CN111083289B - Audio playing method and device, storage medium and mobile terminal - Google Patents

Audio playing method and device, storage medium and mobile terminal Download PDF

Info

Publication number
CN111083289B
CN111083289B CN201911368033.0A CN201911368033A CN111083289B CN 111083289 B CN111083289 B CN 111083289B CN 201911368033 A CN201911368033 A CN 201911368033A CN 111083289 B CN111083289 B CN 111083289B
Authority
CN
China
Prior art keywords
preset
frequency spectrum
audio file
spectrum characteristic
playing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911368033.0A
Other languages
Chinese (zh)
Other versions
CN111083289A (en
Inventor
徐云峰
刘世顺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huizhou TCL Mobile Communication Co Ltd
Original Assignee
Huizhou TCL Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huizhou TCL Mobile Communication Co Ltd filed Critical Huizhou TCL Mobile Communication Co Ltd
Priority to CN201911368033.0A priority Critical patent/CN111083289B/en
Publication of CN111083289A publication Critical patent/CN111083289A/en
Application granted granted Critical
Publication of CN111083289B publication Critical patent/CN111083289B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/72442User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality for playing music files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/16Sound input; Sound output
    • G06F3/165Management of the audio stream, e.g. setting of volume, audio stream path
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72448User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions
    • H04M1/72454User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions according to context-related or environment-related conditions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72484User interfaces specially adapted for cordless or mobile telephones wherein functions are triggered by incoming communication events

Landscapes

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

Abstract

The application discloses an audio playing method, an audio playing device, a storage medium and a mobile terminal, wherein the method comprises the following steps: when a message or an incoming call is received, playing prompt information according to a preset volume value; recording the prompt information in the playing process to obtain a current scene audio file; extracting the frequency spectrum characteristic of the current scene audio file, and judging whether the extracted target frequency spectrum characteristic value is in a preset frequency spectrum characteristic value range, wherein the preset frequency spectrum characteristic value range is a frequency spectrum characteristic value range obtained by extracting the frequency spectrum characteristic of a preset audio file; and if the target frequency spectrum characteristic value is not in the range of the preset frequency spectrum characteristic value, adjusting the preset volume value based on the preset audio file, and playing the preset audio file according to the adjusted volume value. The spectral feature extraction is carried out on the recorded audio file of the current scene to judge whether the current scene is a noisy environment or not, so that the volume value is automatically adjusted, and a user can hear prompt information.

Description

Audio playing method and device, storage medium and mobile terminal
Technical Field
The present application relates to the field of communications, and in particular, to an audio playing method, apparatus, storage medium, and mobile terminal.
Background
With the rapid development of the upstream accessories of the mobile phone in recent years, the form of the mobile phone is also greatly changed, and the ultra-thin machine, the full-screen machine and the bang screen machine are gradually favored by users with light, thin and beautiful shapes, however, the hardware such as a loudspeaker, a vibration motor and the like cannot be improved and can only be limited in a narrow space due to the light and thin of the existing mobile phone, and further, when the mobile phone receives an incoming call or a short message in a noisy environment, the user cannot feel a vibration, cannot hear vibration prompt information and cannot hear sound.
Disclosure of Invention
The embodiment of the application provides an audio playing method, which can improve vibration sound under the conditions of not changing structural design and not increasing cost.
The embodiment of the application provides an audio playing method, which comprises the following steps:
when a message or an incoming call is received, playing prompt information according to a preset volume value;
recording the prompt information in the playing process to obtain a current scene audio file;
extracting the frequency spectrum characteristic of the current scene audio file, and judging whether the extracted target frequency spectrum characteristic value is in a preset frequency spectrum characteristic value range, wherein the preset frequency spectrum characteristic value range is a frequency spectrum characteristic value range obtained by extracting the frequency spectrum characteristic of a preset audio file;
and if the target frequency spectrum characteristic value is not in the range of the preset frequency spectrum characteristic value, adjusting the preset volume value based on the preset audio file, and playing the preset audio file according to the adjusted volume value.
An embodiment of the present application further provides an audio playing device, including:
the first playing unit is used for playing the prompt message according to a preset volume value when a message or an incoming call is received;
the recording unit is used for recording the prompt information in the playing process to obtain a current scene audio file;
the judgment unit is used for extracting the frequency spectrum characteristic of the current scene audio file and judging whether the extracted target frequency spectrum characteristic value is in a preset frequency spectrum characteristic value range, wherein the preset frequency spectrum characteristic value range is a frequency spectrum characteristic value range obtained by extracting the frequency spectrum characteristic of a preset audio file;
and the second playing unit is used for adjusting the preset volume value based on the preset audio file if the target frequency spectrum characteristic value is not in the range of the preset frequency spectrum characteristic value, and playing the preset audio file according to the adjusted volume value.
An embodiment of the present application further provides a storage medium, in which a computer program is stored, and when the computer program runs on a computer, the computer is enabled to execute the audio playing method as described above.
The embodiment of the present application further provides a mobile terminal, where the mobile terminal includes a processor and a memory, where the memory stores a computer program, and the processor is configured to execute the audio playing method described above by calling the computer program stored in the memory.
The audio playing method provided by the embodiment of the application comprises the following steps: when a message or an incoming call is received, playing prompt information according to a preset volume value; recording the prompt information in the playing process to obtain a current scene audio file; extracting the frequency spectrum characteristic of the current scene audio file, and judging whether the extracted target frequency spectrum characteristic value is in a preset frequency spectrum characteristic value range, wherein the preset frequency spectrum characteristic value range is a frequency spectrum characteristic value range obtained by extracting the frequency spectrum characteristic of a preset audio file; and if the target frequency spectrum characteristic value is not in the range of the preset frequency spectrum characteristic value, adjusting the preset volume value based on the preset audio file, and playing the preset audio file according to the adjusted volume value. The spectral feature extraction is carried out on the recorded audio file of the current scene to judge whether the current scene is a noisy environment or not, so that the volume value is automatically adjusted, and a user can hear prompt information.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart of a first audio playing method according to an embodiment of the present disclosure.
Fig. 2 is a frequency distribution characteristic diagram obtained by recording vibration prompt information played by a mobile terminal in a quiet environment and extracting spectral features according to an embodiment of the present application.
Fig. 3 is a schematic flowchart of a second audio playing method according to an embodiment of the present application.
Fig. 4 is a schematic structural diagram of an audio playing device according to an embodiment of the present application.
Fig. 5 is a specific structural diagram of a mobile terminal according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, fig. 1 is a first flowchart illustrating an audio playing method according to an embodiment of the present disclosure.
The audio playing method comprises the following steps:
step 101, when a message or an incoming call is received, playing a prompt message according to a preset volume value.
Specifically, when the mobile terminal receives an incoming call or a message from another person, the prompt message is played according to a preset volume value set by a user on a setting interface of the mobile terminal. The mobile terminal may be a mobile phone, a tablet computer, a notebook computer, a personal digital assistant, and the like, and various application programs, such as applications having an entertainment function (e.g., a video application, an audio playing application, a game application, and reading software), and applications having a service function (e.g., a map navigation application, a dining application, and the like), are stored in the mobile terminal.
The prompt may be an audible prompt or a vibratory prompt, such as: a voice prompt message generated through a speaker of the mobile terminal, or a vibration prompt message generated by a vibration motor of the mobile terminal through vibration. It should be noted that if the prompt message is a vibration prompt message, since the volume values of the vibration prompt messages generated by different vibration frequencies are different, playing the vibration prompt message according to the preset volume value is to play the vibration prompt message according to the preset vibration frequency.
And 102, recording the prompt information in the playing process to obtain the current scene audio file.
When the prompt information is played according to the preset volume value, the mobile terminal records the prompt information played in the current scene, and certainly, if the user is in the operation scene, the user can also record external sounds except the mobile terminal.
Specifically, taking an operating system of the mobile terminal as an Android system (Android) as an example, the prompt information during recording and playing can be recorded through an interface of an Android development kit (Android SDK). And calling or triggering the interface of the Android SDK to record the prompt message played in the current scene every time the mobile terminal receives an incoming call or a message.
And 103, extracting the frequency spectrum characteristic of the current scene audio file, and judging whether the extracted target frequency spectrum characteristic value is within a preset frequency spectrum characteristic value range.
Specifically, the preset spectral feature value range is a spectral feature value range obtained by extracting spectral features of a preset audio file. In order to determine whether the current scene of the user is a noisy environment, it is necessary to ensure that the preset audio file is recorded by the mobile terminal in a quiet environment, and the mobile terminal must play the same prompt information as in step 101 in the quiet environment, otherwise, different prompt information cannot be compared according to the extracted spectral feature value.
The spectral feature extraction may adopt a fourier transform (FFT) algorithm to convert the acquired audio file into a frequency domain, thereby obtaining a frequency distribution characteristic. Referring to fig. 2, fig. 2 is a frequency distribution characteristic diagram obtained by recording vibration prompt information played by a mobile terminal in a quiet environment and extracting spectral features. As shown in fig. 2, in a quiet environment, the feature values of the sound generated when the mobile phone starts playing the vibration prompt message are 260Hz, 518Hz, and 775Hz, and since the frequency spectrum fluctuation of the mobile phone on different material surfaces (such as wood, plastic, glass, etc.) is ± 10Hz, taking the prompt message as the vibration prompt message as an example, if the frequency spectrum feature values of the current scene audio file are within 250Hz to 270Hz, 508Hz to 528Hz, and 765Hz to 785Hz, it is indicated that the current environment where the mobile terminal is located is the quiet environment; if the frequency spectrum characteristic value of the current scene audio file is not within 250 Hz-270 Hz, 508 Hz-528 Hz and 765 Hz-785 Hz, the current environment where the mobile terminal is located is a noisy environment.
In order to improve the accuracy of the mobile terminal in determining the current scene, the preset audio time of the preset audio file may be determined first, and when the prompt information in the playing process is recorded in step 102, the recording is also performed according to the preset audio time. Therefore, recording the prompt information in the playing process to obtain the current scene audio file includes:
and recording the prompt information in the playing process according to the preset duration to obtain the current scene audio file.
And step 104, if the target frequency spectrum characteristic value is not within the range of the preset frequency spectrum characteristic value, adjusting the preset volume value based on the preset audio file, and playing the preset audio file according to the adjusted volume value.
Specifically, if the target spectrum characteristic value is not within the preset spectrum characteristic value range, it indicates that the mobile terminal is currently in the noisy environment, and the preset volume value needs to be adjusted, so that the user can hear the sound emitted by the terminal in the noisy environment. The adjustment mode can be that the maximum amplitude value of a preset audio file recorded by the mobile terminal in a quiet environment is searched, and the maximum decibel value of the audio file coding mode is determined. For example: if the maximum amplitude of the audio file is preset to be A and the encoding mode of the audio file is PCM-8 BIT, it can be determined that the maximum decibel value allowed by the encoding mode is 27128, the ratio of the maximum decibel value to the maximum amplitude value is determined to be
Figure BDA0002338953310000051
It is determined to amplify the preset volume value
Figure BDA0002338953310000052
And (4) doubling. Therefore, adjusting the preset volume value based on the preset audio file includes:
acquiring the maximum amplitude of the preset audio file, acquiring a target amplitude, and acquiring a target coding mode of the audio file;
determining the maximum decibel value of the target coding mode to obtain a target decibel value;
determining an adjustment multiple according to the target decibel value and the target amplitude;
and adjusting the preset volume value according to the adjusting multiple.
The maximum amplitude is used for amplification, and distortion can be avoided after sound amplification.
In addition, if the target spectrum characteristic value is within the preset spectrum characteristic value range, which indicates that the mobile terminal is currently in a quiet environment, the prompt information may be played in a normal manner, for example, a speaker is used for playing a song, or a vibration motor is used for vibrating to prompt the user through vibration and sound. Thus, the method further comprises:
and if the target frequency spectrum characteristic value is within the preset frequency spectrum characteristic value range, playing prompt information according to a preset volume value.
The audio playing method provided by the embodiment of the application comprises the following steps: when a message or an incoming call is received, playing prompt information according to a preset volume value; recording the prompt information in the playing process to obtain a current scene audio file; extracting the frequency spectrum characteristic of the current scene audio file, and judging whether the extracted target frequency spectrum characteristic value is in a preset frequency spectrum characteristic value range, wherein the preset frequency spectrum characteristic value range is a frequency spectrum characteristic value range obtained by extracting the frequency spectrum characteristic of a preset audio file; and if the target frequency spectrum characteristic value is not in the range of the preset frequency spectrum characteristic value, adjusting the preset volume value based on the preset audio file, and playing the preset audio file according to the adjusted volume value. The spectral feature extraction is carried out on the recorded audio file of the current scene to judge whether the current scene is a noisy environment or not, so that the volume value is automatically adjusted, and a user can hear prompt information.
In some embodiments, there is provided an audio playing method as shown in fig. 3, the audio playing method including:
step 201, when a message or an incoming call is received, playing a prompt message according to a preset volume value.
Specifically, when the mobile terminal receives an incoming call or a message from another person, the prompt message is played according to a preset volume value set by a user on a setting interface of the mobile terminal. The mobile terminal may be a mobile phone, a tablet computer, a notebook computer, a personal digital assistant, and the like, and various application programs, such as applications having an entertainment function (e.g., a video application, an audio playing application, a game application, and reading software), and applications having a service function (e.g., a map navigation application, a dining application, and the like), are stored in the mobile terminal.
The prompt may be an audible prompt or a vibratory prompt, such as: a voice prompt message generated through a speaker of the mobile terminal, or a vibration prompt message generated by a vibration motor of the mobile terminal through vibration. It should be noted that if the prompt message is a vibration prompt message, since the volume values of the vibration prompt messages generated by different vibration frequencies are different, playing the vibration prompt message according to the preset volume value is to play the vibration prompt message according to the preset vibration frequency.
Step 202, recording a preset audio file in playing according to a preset duration to obtain a current scene audio file.
When the prompt information is played according to the preset volume value, the mobile terminal records the prompt information played in the current scene, and certainly, if the user is in the operation scene, the user can also record external sounds except the mobile terminal.
Specifically, taking an operating system of the mobile terminal as an Android system (Android) as an example, the prompt information during recording and playing can be recorded through an interface of an Android development kit (Android SDK). And calling or triggering the interface of the Android SDK to record the prompt message played in the current scene every time the mobile terminal receives an incoming call or a message.
Specifically, in order to improve the accuracy of the mobile terminal in judging the current scene, the preset audio time of the preset audio file may be determined first, and the prompt information in the playing process is recorded according to the preset audio time.
Step 203, extracting the frequency spectrum characteristic of the current scene audio file, and judging whether the extracted target frequency spectrum characteristic value is within a preset frequency spectrum characteristic value range.
The spectral feature extraction may adopt a fourier transform (FFT) algorithm to convert the acquired audio file into a frequency domain, thereby obtaining a frequency distribution characteristic. Under a quiet environment, the characteristic values of sound generated when the mobile phone starts to play the vibration prompt information are 260Hz, 518Hz and 775Hz, and the frequency spectrum fluctuation of the mobile phone on different material surfaces (such as wood, plastic, glass and the like) is +/-10 Hz, so that the prompt information is taken as the vibration prompt information as an example, if the frequency spectrum characteristic values of the current scene audio file are within 250 Hz-270 Hz, 508 Hz-528 Hz and 765 Hz-785 Hz, the current environment where the mobile terminal is located is the quiet environment; if the frequency spectrum characteristic value of the current scene audio file is not within 250 Hz-270 Hz, 508 Hz-528 Hz and 765 Hz-785 Hz, the current environment where the mobile terminal is located is a noisy environment.
And 204, if the target frequency spectrum characteristic value is not in the range of the preset frequency spectrum characteristic value, acquiring the maximum amplitude of the preset audio file, acquiring the target amplitude, and acquiring the target coding mode of the audio file.
Specifically, if the target spectrum characteristic value is not within the preset spectrum characteristic value range, it indicates that the mobile terminal is currently in the noisy environment, and the preset volume value needs to be adjusted, so that the user can hear the sound emitted by the terminal in the noisy environment. The adjustment mode can be that the maximum amplitude value of a preset audio file recorded by the mobile terminal in a quiet environment is searched, and the maximum decibel value of the audio file coding mode is determined. For example: if the maximum amplitude of the audio file is preset to be A and the encoding mode of the audio file is PCM-8 BIT, it can be determined that the maximum decibel value allowed by the encoding mode is 27128, the ratio of the maximum decibel value to the maximum amplitude value is determined to be
Figure BDA0002338953310000071
It is determined to amplify the preset volume value
Figure BDA0002338953310000072
And (4) doubling.
Specifically, the preset spectral feature value range is a spectral feature value range obtained by extracting spectral features of a preset audio file. In order to determine whether the current scene of the user is a noisy environment, it is necessary to ensure that the preset audio file is recorded by the mobile terminal in a quiet environment, and the mobile terminal must play the same prompt information as in step 101 in the quiet environment, otherwise, different prompt information cannot be compared according to the extracted spectral feature value.
The maximum amplitude is used for amplification, and distortion can be avoided after sound amplification.
And step 205, determining the maximum decibel value of the target coding mode to obtain a target decibel value.
And step 206, determining an adjustment multiple according to the target decibel value and the target amplitude.
And step 207, adjusting the preset volume value according to the adjustment multiple.
And 208, playing the preset audio file according to the adjusted volume value.
After the adjustment multiple is calculated in steps 205 to 207 and the preset volume value is adjusted accordingly, the preset audio file can be played according to the adjusted volume value.
And 209, if the target frequency spectrum characteristic value is within the preset frequency spectrum characteristic value range, playing prompt information according to a preset volume value.
If the target frequency spectrum characteristic value is within the preset frequency spectrum characteristic value range, indicating that the mobile terminal is in a quiet environment at present, the prompt information can be played in a normal mode, for example, a loudspeaker is used for playing songs, or a vibration motor is used for vibrating to prompt a user through vibration sense and sound.
The audio playing method provided by the embodiment of the application comprises the following steps: when a message or an incoming call is received, playing prompt information according to a preset volume value; recording the prompt information in the playing process to obtain a current scene audio file; extracting the frequency spectrum characteristic of the current scene audio file, and judging whether the extracted target frequency spectrum characteristic value is in a preset frequency spectrum characteristic value range, wherein the preset frequency spectrum characteristic value range is a frequency spectrum characteristic value range obtained by extracting the frequency spectrum characteristic of a preset audio file; and if the target frequency spectrum characteristic value is not in the range of the preset frequency spectrum characteristic value, adjusting the preset volume value based on the preset audio file, and playing the preset audio file according to the adjusted volume value. The spectral feature extraction is carried out on the recorded audio file of the current scene to judge whether the current scene is a noisy environment or not, so that the volume value is automatically adjusted, and a user can hear prompt information.
Referring to fig. 4, fig. 4 is a schematic structural diagram of an audio playing device according to an embodiment of the present disclosure. The audio playing device comprises: a first playing unit 31, a recording unit 32, a judging unit 33 and a second playing unit 34.
The first playing unit 31 is configured to play the prompt message according to a preset volume value when a message or an incoming call is received.
Specifically, when the mobile terminal receives an incoming call or a message from another person, the prompt message is played according to a preset volume value set by a user on a setting interface of the mobile terminal. The mobile terminal may be a mobile phone, a tablet computer, a notebook computer, a personal digital assistant, and the like, and various application programs, such as applications having an entertainment function (e.g., a video application, an audio playing application, a game application, and reading software), and applications having a service function (e.g., a map navigation application, a dining application, and the like), are stored in the mobile terminal.
The prompt may be an audible prompt or a vibratory prompt, such as: a voice prompt message generated through a speaker of the mobile terminal, or a vibration prompt message generated by a vibration motor of the mobile terminal through vibration. It should be noted that if the prompt message is a vibration prompt message, since the volume values of the vibration prompt messages generated by different vibration frequencies are different, playing the vibration prompt message according to the preset volume value is to play the vibration prompt message according to the preset vibration frequency.
The recording unit 32 is configured to record the prompt information during playing to obtain a current scene audio file.
When the prompt information is played according to the preset volume value, the mobile terminal records the prompt information played in the current scene, and certainly, if the user is in the operation scene, the user can also record external sounds except the mobile terminal.
Specifically, taking an operating system of the mobile terminal as an Android system (Android) as an example, the prompt information during recording and playing can be recorded through an interface of an Android development kit (Android SDK). And calling or triggering the interface of the Android SDK to record the prompt message played in the current scene every time the mobile terminal receives an incoming call or a message.
The judging unit 33 is configured to perform spectrum feature extraction on the current scene audio file, and judge whether the extracted target spectrum feature value is within a preset spectrum feature value range.
Specifically, the preset spectral feature value range is a spectral feature value range obtained by extracting spectral features of a preset audio file. In order to determine whether the current scene of the user is a noisy environment, it is necessary to ensure that the preset audio file is recorded by the mobile terminal in a quiet environment, and the mobile terminal must play the same prompt information as that of the first playing unit 31 in the quiet environment, otherwise, different prompt information cannot be compared according to the extracted spectral feature value.
The second playing unit 34 is configured to, if the target frequency spectrum characteristic value is not within the preset frequency spectrum characteristic value range, adjust the preset volume value based on the preset audio file, and play the preset audio file according to the adjusted volume value.
Specifically, if the target spectrum characteristic value is not within the preset spectrum characteristic value range, it indicates that the mobile terminal is currently in the noisy environment, and the preset volume value needs to be adjusted, so that the user can hear the sound emitted by the terminal in the noisy environment. The adjustment mode can be that the maximum amplitude value of a preset audio file recorded by the mobile terminal in a quiet environment is searched, and the maximum decibel value of the audio file coding mode is determined.
In some embodiments, the second playback unit 34 may further include:
the acquisition subunit is used for acquiring the maximum amplitude of the preset audio file, acquiring a target amplitude and acquiring a target coding mode of the audio file;
the first determining subunit is configured to determine a maximum decibel value of the target coding mode, and obtain a target decibel value;
the second determining subunit is used for determining an adjustment multiple according to the target decibel value and the target amplitude;
and the adjusting subunit is used for adjusting the preset volume value according to the adjusting multiple.
In some embodiments, the audio playing apparatus may further include:
and the third playing unit is used for playing the preset audio file according to the preset volume value if the target frequency spectrum characteristic value is within the preset frequency spectrum characteristic value range.
Based on the above method, the present invention further provides a storage medium having a plurality of instructions stored thereon, wherein the instructions are suitable for being loaded by a processor and executing the audio playing method as described above.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable storage medium, and the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Fig. 5 is a block diagram illustrating a specific structure of a terminal according to an embodiment of the present invention, where the terminal may be used to implement the audio playing method, the storage medium, and the terminal provided in the foregoing embodiments.
As shown in fig. 5, the mobile terminal 1200 may include an RF (Radio Frequency) circuit 110, a memory 120 including one or more computer-readable storage media (only one shown), an input unit 130, a display unit 140, a sensor 150, an audio circuit 160, a transmission module 170, a processor 180 including one or more processing cores (only one shown), and a power supply 190. Those skilled in the art will appreciate that the mobile terminal 1200 configuration illustrated in fig. 5 is not intended to be limiting of the mobile terminal 1200 and may include more or less components than those illustrated, or some components in combination, or a different arrangement of components. Wherein:
the RF circuitry 110 may include various existing circuit elements for performing these functions, such as an antenna, a radio frequency transceiver, a digital signal processor, an encryption/decryption chip, a Subscriber Identity Module (SIM) card, memory, and so forth. The RF circuit 110 may communicate with various networks such as the internet, an intranet, a wireless network, or with a second device over a wireless network. The wireless network may comprise a cellular telephone network, a wireless local area network, or a metropolitan area network.
The memory 120 may be configured to store software programs and modules, such as the bright screen duration control method, apparatus, storage medium, and program instructions/modules corresponding to the mobile terminal in the foregoing embodiments, and the processor 180 executes various functional applications and data processing by operating the software programs and modules stored in the memory 120, so as to implement the function of mutual chip identification. Memory 120 may include high speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or a second non-volatile solid-state memory. In some examples, memory 120 may be a storage medium as described above.
The input unit 130 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, the input unit 130 may include a touch-sensitive surface 131 as well as other input devices 132. The touch-sensitive surface 131, also referred to as a touch display screen or a touch pad, may collect touch operations by a user on or near the touch-sensitive surface 131 (e.g., operations by a user on or near the touch-sensitive surface 131 using a finger, a stylus, or any other suitable object or attachment), and drive the corresponding connection device according to a predetermined program. Alternatively, the touch sensitive surface 131 may comprise two parts, a touch detection means and a touch controller.
The display unit 140 may be used to display information input by or provided to the user and various graphic user interfaces of the mobile terminal 1200, which may be configured by graphics, text, icons, video, and any combination thereof. The display unit 140 may include a display panel 141, and further, the touch-sensitive surface 131 may cover the display panel 141. The display interface of the mobile terminal in the above embodiment may be represented by the display unit 140, that is, the display content displayed by the display interface may be displayed by the display unit 140.
The mobile terminal 1200 may also include at least one sensor 150, such as a light sensor, a motion sensor, and a second sensor. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 141 according to the brightness of ambient light, and a proximity sensor that may turn off the display panel 141 and/or the backlight when the mobile terminal 1200 is moved to the ear. As for the second sensor such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which may be further configured in the mobile terminal 1200, the detailed description is omitted here.
Audio circuitry 160, speaker 161, and microphone 162 may provide an audio interface between a user and mobile terminal 1200. The audio circuit 160 may transmit the electrical signal converted from the received audio data to the speaker 161, and convert the electrical signal into a sound signal for output by the speaker 161; on the other hand, the microphone 162 converts the collected sound signal into an electric signal, converts the electric signal into audio data after being received by the audio circuit 160, and then outputs the audio data to the processor 180 for processing, and then to the RF circuit 110 to be transmitted to, for example, another terminal, or outputs the audio data to the memory 120 for further processing. The audio circuitry 160 may also include an earbud jack to provide communication of peripheral headphones with the mobile terminal 1200.
The mobile terminal 1200, which can help a user send and receive e-mails, browse web pages, access streaming media, etc., provides the user with wireless broadband internet access through the transmission module 170.
The processor 180 is a control center of the mobile terminal 1200, connects various parts of the entire mobile phone using various interfaces and lines, and performs various functions of the mobile terminal 1200 and processes data by operating or executing software programs and/or modules stored in the memory 120 and calling data stored in the memory 120, thereby integrally monitoring the mobile phone. Optionally, processor 180 may include one or more processing cores; in some embodiments, the processor 180 may integrate an application processor, which primarily handles operating systems, user interfaces, applications, etc., and a modem processor, which primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 180.
Specifically, the processor 180 includes: an Arithmetic Logic Unit (ALU), an application processor, a Global Positioning System (GPS) and a control and status Bus (Bus) (not shown).
The mobile terminal 1200 also includes a power supply 190 (e.g., a battery) for powering the various components, which may be logically coupled to the processor 180 via a power management system in some embodiments to provide management of power, and power consumption via the power management system. The power supply 190 may also include any component including one or more of a dc or ac power source, a re-power system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
Although not shown, the mobile terminal 1200 may further include a camera (e.g., a front camera, a rear camera), a bluetooth module, and the like, which are not described in detail herein.
Specifically, in the present embodiment, the display unit 140 of the mobile terminal 1200 is a touch screen display, and the mobile terminal 1200 further includes a memory 120 and one or more programs, wherein the one or more programs are stored in the memory 120, and the one or more programs configured to be executed by the one or more processors 180 include instructions for:
when a message or an incoming call is received, playing prompt information according to a preset volume value;
recording the prompt information in the playing process to obtain a current scene audio file;
extracting the frequency spectrum characteristic of the current scene audio file, and judging whether the extracted target frequency spectrum characteristic value is in a preset frequency spectrum characteristic value range, wherein the preset frequency spectrum characteristic value range is a frequency spectrum characteristic value range obtained by extracting the frequency spectrum characteristic of a preset audio file;
and if the target frequency spectrum characteristic value is not in the range of the preset frequency spectrum characteristic value, adjusting the preset volume value based on the preset audio file, and playing the preset audio file according to the adjusted volume value.
In some embodiments, when adjusting the preset volume value based on the preset audio file, the processor 380 may further execute the instructions of:
acquiring the maximum amplitude of the preset audio file, acquiring a target amplitude, and acquiring a target coding mode of the audio file;
determining the maximum decibel value of the target coding mode to obtain a target decibel value;
determining an adjustment multiple according to the target decibel value and the target amplitude;
and adjusting the preset volume value according to the adjusting multiple.
In some embodiments, processor 380 may also execute instructions to:
and if the target frequency spectrum characteristic value is within the preset frequency spectrum characteristic value range, playing prompt information according to a preset volume value.
In some embodiments, the preset audio duration of the audio file is a preset duration, and when the prompt information in the recording and playing process is obtained to obtain the current scene audio file, the processor 380 may further execute the following instructions:
and recording the preset audio file in the playing process according to the preset duration to obtain the current scene audio file.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
The audio playing method, the audio playing device, the storage medium and the mobile terminal provided by the embodiments of the present application are described in detail above, and a specific example is applied in the text to explain the principle and the implementation of the present application, and the description of the above embodiments is only used to help understand the technical scheme and the core idea of the present application; those of ordinary skill in the art will understand that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications or substitutions do not depart from the spirit and scope of the present disclosure as defined by the appended claims.

Claims (8)

1. An audio playing method, comprising:
when a message or an incoming call is received, playing prompt information according to a preset volume value;
recording the prompt information in the playing process to obtain a current scene audio file;
extracting the frequency spectrum characteristic of the current scene audio file, judging whether the extracted target frequency spectrum characteristic value is in a preset frequency spectrum characteristic value range, wherein the preset frequency spectrum characteristic value range is the frequency spectrum characteristic range obtained by extracting the frequency spectrum characteristic of the preset audio file and calculating the frequency spectrum fluctuation, and the preset audio file is the audio file obtained by recording and playing the prompt information in a quiet environment;
if the target frequency spectrum characteristic value is not in the range of the preset frequency spectrum characteristic value, acquiring the maximum amplitude of the preset audio file, acquiring a target amplitude, and acquiring a target coding mode of the preset audio file;
determining the maximum decibel value of the target coding mode to obtain a target decibel value;
determining the ratio of the target decibel value to the target amplitude as an adjustment multiple;
and adjusting the preset volume value according to the adjustment multiple, and playing the preset audio file according to the adjusted volume value.
2. The audio playing method according to claim 1, wherein the method further comprises:
and if the target frequency spectrum characteristic value is within the preset frequency spectrum characteristic value range, playing prompt information according to a preset volume value.
3. The audio playing method according to claim 2, wherein the audio duration of the preset audio file is a preset duration, and the recording the prompt information during playing to obtain the current scene audio file comprises:
and recording the preset audio file in the playing process according to the preset duration to obtain the current scene audio file.
4. The audio playing method according to claim 2, wherein the prompt message is a sound prompt message or a vibration prompt message.
5. An audio playback apparatus, comprising:
the first playing unit is used for playing the prompt message according to a preset volume value when a message or an incoming call is received;
the recording unit is used for recording the prompt information in the playing process to obtain a current scene audio file;
the judging unit is used for extracting the frequency spectrum characteristic of the current scene audio file, judging whether the extracted target frequency spectrum characteristic value is within a preset frequency spectrum characteristic value range, wherein the preset frequency spectrum characteristic value range is the frequency spectrum characteristic extraction of the preset audio file, and calculating the frequency spectrum fluctuation range to obtain the frequency spectrum characteristic value range, and the preset audio file is the audio file obtained by recording and playing the prompt information in a quiet environment;
the second playing unit is used for acquiring the maximum amplitude of the preset audio file to obtain a target amplitude and acquiring a target coding mode of the preset audio file if the target frequency spectrum characteristic value is not within the range of the preset frequency spectrum characteristic value;
determining the maximum decibel value of the target coding mode to obtain a target decibel value;
determining the ratio of the target decibel value to the target amplitude as an adjustment multiple;
and adjusting the preset volume value according to the adjustment multiple, and playing the preset audio file according to the adjusted volume value.
6. The audio playback device of claim 5, further comprising:
and the third playing unit is used for playing the preset audio file according to the preset volume value if the target frequency spectrum characteristic value is within the preset frequency spectrum characteristic value range.
7. A computer-readable storage medium, in which a computer program is stored which, when run on a computer, causes the computer to execute the audio playback method according to any one of claims 1 to 4.
8. A mobile terminal, characterized in that the mobile terminal comprises a processor and a memory, wherein the memory stores a computer program, and the processor is used for executing the audio playing method according to any one of claims 1 to 4 by calling the computer program stored in the memory.
CN201911368033.0A 2019-12-26 2019-12-26 Audio playing method and device, storage medium and mobile terminal Active CN111083289B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911368033.0A CN111083289B (en) 2019-12-26 2019-12-26 Audio playing method and device, storage medium and mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911368033.0A CN111083289B (en) 2019-12-26 2019-12-26 Audio playing method and device, storage medium and mobile terminal

Publications (2)

Publication Number Publication Date
CN111083289A CN111083289A (en) 2020-04-28
CN111083289B true CN111083289B (en) 2021-08-03

Family

ID=70318367

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911368033.0A Active CN111083289B (en) 2019-12-26 2019-12-26 Audio playing method and device, storage medium and mobile terminal

Country Status (1)

Country Link
CN (1) CN111083289B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112000835A (en) * 2020-08-31 2020-11-27 上海商米科技集团股份有限公司 Dynamic sound effect loading system and method for electronic equipment
CN112269559B (en) * 2020-10-26 2024-04-19 北京三快在线科技有限公司 Volume adjustment method and device, electronic equipment and storage medium
CN112269895A (en) * 2020-11-06 2021-01-26 Oppo广东移动通信有限公司 Vibration control method and device and computer readable storage medium
CN112667192A (en) * 2020-12-22 2021-04-16 北京小米移动软件有限公司 Shell display state control method and device, electronic equipment and storage medium
CN113676595B (en) * 2021-07-12 2023-07-21 杭州逗酷软件科技有限公司 Volume adjustment method, terminal device, and computer-readable storage medium
CN113873325B (en) * 2021-10-29 2024-05-17 深圳市兆驰股份有限公司 Sound processing method, device, equipment and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7869768B1 (en) * 2006-08-10 2011-01-11 Natan Vishlitzky Techniques for controlling speaker volume of a portable communications device
CN102883121A (en) * 2012-09-24 2013-01-16 北京多看科技有限公司 Method and device for regulating volume, and digital terminal
CN105657136A (en) * 2014-11-13 2016-06-08 东莞宇龙通信科技有限公司 Method and device for changing motor vibration frequency based on environment and mobile terminal
CN108347522A (en) * 2017-01-25 2018-07-31 北京小米移动软件有限公司 Adjust the method and device of volume

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7869768B1 (en) * 2006-08-10 2011-01-11 Natan Vishlitzky Techniques for controlling speaker volume of a portable communications device
CN102883121A (en) * 2012-09-24 2013-01-16 北京多看科技有限公司 Method and device for regulating volume, and digital terminal
CN105657136A (en) * 2014-11-13 2016-06-08 东莞宇龙通信科技有限公司 Method and device for changing motor vibration frequency based on environment and mobile terminal
CN108347522A (en) * 2017-01-25 2018-07-31 北京小米移动软件有限公司 Adjust the method and device of volume

Also Published As

Publication number Publication date
CN111083289A (en) 2020-04-28

Similar Documents

Publication Publication Date Title
CN111083289B (en) Audio playing method and device, storage medium and mobile terminal
CN107705778B (en) Audio processing method, device, storage medium and terminal
US10964300B2 (en) Audio signal processing method and apparatus, and storage medium thereof
CN107509153B (en) Detection method and device of sound playing device, storage medium and terminal
CN106782613B (en) Signal detection method and device
US10628119B2 (en) Sound effect processing method and mobile terminal
CN109817241B (en) Audio processing method, device and storage medium
US20230252964A1 (en) Method and apparatus for determining volume adjustment ratio information, device, and storage medium
CN109243488B (en) Audio detection method, device and storage medium
CN110568926B (en) Sound signal processing method and terminal equipment
CN107731241B (en) Method, apparatus and storage medium for processing audio signal
WO2017215661A1 (en) Scenario-based sound effect control method and electronic device
WO2021139535A1 (en) Method, apparatus and system for playing audio, and device and storage medium
WO2017215654A1 (en) Method for preventing abrupt change of sound effect, and terminal
CN108492837B (en) Method, device and storage medium for detecting audio burst white noise
CN110675848A (en) Audio processing method, device and storage medium
CN110599989A (en) Audio processing method, device and storage medium
CN106126170B (en) Sound effect setting method of terminal and terminal
WO2019061292A1 (en) Noise reduction method for terminal and terminal
CN110336918B (en) Bright screen control method and device, storage medium and mobile terminal
CN109119101B (en) Audio data processing method and device and mobile terminal
CN111081283A (en) Music playing method and device, storage medium and terminal equipment
WO2023011370A1 (en) Audio playing method and apparatus
CN105159655B (en) Behavior event playing method and device
CN113990363A (en) Audio playing parameter adjusting method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant