CN111583941B - Household appliance recording method and device, storage medium and household appliance - Google Patents

Household appliance recording method and device, storage medium and household appliance Download PDF

Info

Publication number
CN111583941B
CN111583941B CN202010378219.0A CN202010378219A CN111583941B CN 111583941 B CN111583941 B CN 111583941B CN 202010378219 A CN202010378219 A CN 202010378219A CN 111583941 B CN111583941 B CN 111583941B
Authority
CN
China
Prior art keywords
audio
recording
application program
audio data
voice application
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
CN202010378219.0A
Other languages
Chinese (zh)
Other versions
CN111583941A (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.)
Gree Electric Appliances Inc of Zhuhai
Original Assignee
Gree Electric Appliances Inc of Zhuhai
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 Gree Electric Appliances Inc of Zhuhai filed Critical Gree Electric Appliances Inc of Zhuhai
Priority to CN202010378219.0A priority Critical patent/CN111583941B/en
Publication of CN111583941A publication Critical patent/CN111583941A/en
Application granted granted Critical
Publication of CN111583941B publication Critical patent/CN111583941B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C7/00Arrangements for writing information into, or reading information out from, a digital store
    • G11C7/16Storage of analogue signals in digital stores using an arrangement comprising analogue/digital [A/D] converters, digital memories and digital/analogue [D/A] converters 
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L17/00Speaker identification or verification techniques
    • G10L17/22Interactive procedures; Man-machine interfaces
    • G10L17/24Interactive procedures; Man-machine interfaces the user being prompted to utter a password or a predefined phrase

Landscapes

  • Stored Programmes (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

The application relates to a household appliance recording method, a household appliance recording device, a storage medium and a household appliance. The method comprises the following steps: acquiring a recording request triggered by the household appliance equipment with the voice application program started, wherein the recording request carries a recording application identification mark; responding to the recording request, and collecting audio data based on an audio source corresponding to the voice application program; initializing the sampling rate in the audio parameters of the audio recorder, and resampling the acquired audio data according to the initialized sampling rate to obtain the processed audio data; and feeding the processed audio data back to the recording application program corresponding to the recording application identification mark. The method can realize multiplexing of the audio source of the voice application program, extracts the needed audio data from the multiplexed audio source, realizes the function of running the voice application program and the recording application program on the household appliance at the same time, better meets the requirements of users and improves the use convenience for the household appliance.

Description

Household appliance recording method and device, storage medium and household appliance
Technical Field
The present disclosure relates to the field of electrical appliances, and in particular, to a recording method and apparatus for a home appliance, a storage medium, and a home appliance.
Background
Along with the rapid development of electrical appliance technology and Internet of things, the household appliances gradually realize intellectualization and networking, and the intelligent household appliances are provided with voice functions applied to man-machine interaction. In the existing system design, only one path of hardware resources of the audio codec are arranged on the household appliance, namely only one audio source exists. In the online working scene of the voice application program of the household appliance, the voice application program needs to occupy the hardware resources of the audio coder-decoder in real time.
Because the voice application program on the existing household appliance with the voice function is always on line, the hardware resources of the audio coder-decoder are always occupied by the voice application program, and other recording application programs and the like cannot normally run. For example, the recording application program can not record audio, or the recorded audio is silent due to the fact that hardware resources of the audio codec can not be called, so that the existing household appliance can not meet the requirement that the voice application program and other recording application programs need to run simultaneously, and the use convenience is low.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a recording method, apparatus, storage medium, and home appliance capable of improving the convenience of use of the home appliance.
A method of recording a sound of a home device, the method comprising:
acquiring a recording request triggered by a household appliance with a voice application program started, wherein the recording request carries a recording application identification mark;
responding to the recording request, and collecting audio data based on an audio source corresponding to the voice application program; the voice application program processes audio data based on audio parameters of the audio recorder;
initializing a sampling rate in audio parameters of the audio recorder;
resampling the acquired audio data according to the initialized sampling rate to obtain processed audio data;
and feeding the processed audio data back to a recording application program of the household appliance corresponding to the recording application identification.
In one embodiment, the responding to the recording request, performing audio data collection based on the audio source corresponding to the voice application program, includes:
responding to the recording request, and creating an acquisition thread corresponding to the recording application identification mark;
And calling the acquisition thread, and acquiring audio data based on the audio source corresponding to the voice application program.
In one embodiment, the resampling the collected audio data according to the initialized sampling rate to obtain the processed audio data includes:
calling an audio manager, and creating a tracking thread corresponding to the recording application identification mark;
and calling the tracking thread, and resampling the acquired audio data according to the initialized sampling rate to obtain the processed audio data.
In one embodiment, the responding to the recording request, creating an acquisition thread corresponding to the recording application identification identifier includes:
responding to the recording request, calling a media recorder, and creating an audio recorder corresponding to the recording application identification mark;
and calling the audio recorder, and creating an acquisition thread corresponding to the recording application identification mark.
In one embodiment, the calling the audio manager to create a tracking thread corresponding to the recording application identification identifier includes:
calling an audio manager, and creating a recording object corresponding to the recording application identification mark;
And calling the recorded object, and creating a tracking thread corresponding to the record application identification mark.
In one embodiment, after the feeding back the processed audio data to the recording application program of the home appliance corresponding to the recording application identification, the method further includes:
based on the audio recorder, encoding the processed audio data to generate a recording file;
storing the sound record file into a cache corresponding to the household appliance;
when a record playing request based on the household electrical appliance is detected, responding to the playing request, extracting the corresponding record file from a cache corresponding to the household electrical appliance, and performing voice broadcasting.
A home device sound recording apparatus, the apparatus comprising:
the recording request acquisition module is used for acquiring a recording request triggered by the household appliance equipment which starts the voice application program, wherein the recording request carries a recording application identification mark;
the audio data acquisition module is used for responding to the recording request and acquiring audio data based on an audio source corresponding to the voice application program; the voice application program processes audio data based on audio parameters of the audio recorder;
The sampling rate initializing module is used for initializing the sampling rate in the audio parameters of the audio recorder;
the resampling processing module is used for resampling the acquired audio data according to the initialized sampling rate to obtain processed audio data;
and the audio data feedback module is used for feeding the processed audio data back to a recording application program of the household appliance corresponding to the recording application identification mark.
In one embodiment, the audio data acquisition module is further configured to:
responding to the recording request, and creating an acquisition thread corresponding to the recording application identification mark; and calling the acquisition thread, and acquiring audio data based on the audio source corresponding to the voice application program.
The household electrical appliance comprises a household electrical appliance main body, a sound acquisition/output device, a memory and a processor, wherein the sound acquisition/output device, the memory and the processor are arranged on the household electrical appliance main body; the memory stores a computer program, and the processor when executing the computer program realizes the following steps:
acquiring a recording request triggered by a household appliance with a voice application program started, wherein the recording request carries a recording application identification mark;
Responding to the recording request, and collecting audio data based on an audio source corresponding to the voice application program; the voice application program processes audio data based on audio parameters of the audio recorder;
initializing a sampling rate in audio parameters of the audio recorder;
resampling the acquired audio data according to the initialized sampling rate to obtain processed audio data;
and feeding the processed audio data back to a recording application program of the household appliance corresponding to the recording application identification.
A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
acquiring a recording request triggered by a household appliance with a voice application program started, wherein the recording request carries a recording application identification mark;
responding to the recording request, and collecting audio data based on an audio source corresponding to the voice application program; the voice application program processes audio data based on audio parameters of the audio recorder;
initializing a sampling rate in audio parameters of the audio recorder;
Resampling the acquired audio data according to the initialized sampling rate to obtain processed audio data;
and feeding the processed audio data back to a recording application program of the household appliance corresponding to the recording application identification.
According to the household electrical appliance recording method, the household electrical appliance recording device, the storage medium and the household electrical appliance, the recording request triggered by the household electrical appliance which starts the voice application program is obtained, the audio data acquisition is performed based on the audio source corresponding to the voice application program in response to the recording request, and multiplexing of the audio source of the voice application program is achieved. The voice application program processes the audio data based on the audio parameters of the audio recorder, and initializes the sampling rate in the audio parameters of the audio recorder to meet the requirements that different application programs have different audio sampling rates, and further resamples the collected audio data by using the initialized sampling rate to obtain the audio data meeting the requirements of the recording application program, and feeds the audio data back to the recording application program of the household appliance corresponding to the recording application identification mark carried by the recording request. Because the audio source of the voice application program of the household appliance is multiplexed, even if the voice application program is always on line and occupies the audio source, the needed audio data can be extracted from the multiplexed audio source, and the audio data which is needed by the recording application program can be obtained through resampling processing, so that the function of simultaneously running the voice application program and the recording application program on the household appliance is realized, the user requirement is better met, and the use convenience for the household appliance is improved.
Drawings
FIG. 1 is a schematic flow chart of a recording method of an electrical home appliance in one embodiment;
fig. 2 is a flow chart of a recording method of a home appliance in another embodiment;
FIG. 3 is a schematic diagram of an implementation architecture of a recording method of a home device in one embodiment;
FIG. 4 is a block diagram of a recording device of an electrical home appliance in one embodiment;
fig. 5 is an internal structural diagram of a home appliance in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
In one embodiment, as shown in fig. 1, a recording method of a home appliance is provided, and this embodiment is illustrated by applying the method to a home appliance terminal, it may be understood that the method may also be applied to a server, and may also be applied to a system including a home appliance terminal and a server, and implemented through interaction between the home appliance terminal and the server. In this embodiment, the method includes the steps of:
step S102, a recording request triggered by the household appliance which starts the voice application program is obtained, wherein the recording request carries a recording application identification mark.
Specifically, the user triggers the recording request to the home appliance with the voice application program started, so that the home appliance can start the recording application program corresponding to the recording application identification mark according to the recording request under the condition that the voice application program is always on.
In one embodiment, before triggering the recording request for the home device, the method further comprises:
and acquiring and responding to the wake-up word aiming at the household appliance, waking up the household appliance, and automatically starting the voice application program on the household appliance. After the voice application program is started, the media recorder is called, the audio recorder corresponding to the voice application program is newly built, and all audio parameters corresponding to the audio recorder are initialized by calling the audio manager. And calling an audio driver based on the audio hardware abstraction layer interface, acquiring audio data from hardware resources of the audio coder-decoder, and determining the acquired audio data as an audio source corresponding to the voice application program.
Specifically, after the wake-up word for the home appliance is acquired, the wake-up word is responded, and the home appliance is awakened. After the household appliance wakes up, the voice application program installed on the household appliance is automatically started, wherein the voice application program installed on the household appliance can be a voice assistant carried on the household appliance, and the voice assistant can realize the voice recognition function of the household appliance. After the voice application is started, an audio recorder (i.e., audioRecorder) corresponding to the voice application is newly built by calling a media recorder (i.e., mediaRecorder) arranged on the home appliance.
Wherein different applications create respective corresponding media recorders (mediarecorders) and create respective opposite audio recorders (audiorecorders) at the framework layer. The audio manager (i.e. AudioFlinger) is the core of the audio system of the home appliance, mainly bears audio mixing output, can process collected audio data and the like, and writes the processed audio data into an audio hardware abstraction layer (i.e. audio HAL).
When the audio device library file is loaded, the audio manager searches the library beginning with audio from/system/lib/hw/down, and simultaneously determines the name of the loaded audio device library according to the audio device name defined in audio_policy.
Based on the Audio hardware abstraction layer interface, the Audio driver can be called to acquire Audio data from the hardware resource of the Audio Codec (i.e. Audio Codec), and the acquired Audio data can be stored into a preset cache of the home appliance. The HAL layer is divided into two parts, wherein one part is various audio devices, each audio device is realized by a separate library file, and the other part is an audio strategy. Above the HAL layer is a core audio manager of the audio system, which realizes the management of various input and output audio streams, manages real-time available audio channels, selects audio channels for various audio streams, realizes the mixing of a plurality of audio streams, and the like.
Further, after initializing all audio parameters of the audio recorder corresponding to the voice application program, the voice application program performs voice recognition processing on the collected audio data by using each initialized audio parameter to obtain an audio file meeting the requirements.
The audio parameters of the audio recorder mainly include: (1) an audio source: can be understood as the source of the audio data. (2) sampling frequency: also referred to as sampling rate or sampling rate, defines the number of samples per second that are extracted from a continuous signal and that constitute a discrete signal, and is understood to be the number of samples of the signal that are acquired per second. (3) number of sampling bits: i.e. the sampling value or the sampling value, the parameter used for measuring the fluctuation change of the sound, i.e. the resolution of the sound processed by the sound card, refers to the binary bit number of the digital sound signal used by the sound card when collecting and playing the sound file, and the larger the value, the higher the resolution, and the more realistic the sound recorded and played back. (4) number of channels: the two channels are divided into a mono channel and a double channel, namely stereo, and the two channels occupy two lines in hardware, so that the tone quality and tone quality are good, and the space occupied by the digitized stereo is doubled compared with that of the mono channel. (5) number of quantization bits: the amplitude axis representing the analog audio signal is digitized, determining the dynamic range of the analog signal after digitization.
Step S104, responding to the recording request, and collecting audio data based on the audio source corresponding to the voice application program.
Specifically, in response to the recording request, an acquisition thread (i.e., recordThead) corresponding to the recording application identification representation is newly created, the acquisition thread is invoked, and audio data acquisition is performed based on an audio source corresponding to the voice application.
Further, in response to the recording request, calling a media recorder corresponding to the recording application identification mark, creating an audio recorder corresponding to the recording application identification mark, and creating an acquisition thread corresponding to the recording application identification mark by calling the audio recorder. Based on the acquisition thread, audio pulse code modulation data are read from an audio source corresponding to the voice application program circularly and continuously.
The voice application program processes the collected audio data based on the audio parameters of the audio recorder, including voice recognition processing.
Step S106, initializing the sampling rate in the audio parameters of the audio recorder.
Specifically, all audio parameters of the audio recorder corresponding to the voice application program are obtained, the sampling rate in the audio parameters is initialized, and the initialized sampling rate and other audio parameters including parameters such as an audio source, the number of channels, the sampling bit number, the quantization bit number and the like are determined as the audio parameters of the audio recorder corresponding to the recording application program.
Step S108, resampling processing is carried out on the collected audio data according to the initialized sampling rate, and the processed audio data are obtained.
Specifically, by calling an audio manager of the audio system of the home appliance, creating a tracking thread (namely, a TrackThread) corresponding to the recording application, calling the tracking thread, and resampling the acquired audio data according to the initialized sampling rate to obtain the processed audio data. In the speech recognition process, in order to meet the requirements of different sampling rates, the speech needs to be resampled, i.e. the original sampling frequency is converted into a new sampling frequency so as to adapt to the requirements of different sampling rates.
The main step of audio resampling is interpolation or decimation, and because the decimation may generate aliasing and the interpolation may generate images, anti-aliasing filtering is needed before the decimation, anti-image filtering is needed after the interpolation, and both anti-aliasing filtering and anti-image filtering can be realized by using a low-pass filter. The method for realizing resampling comprises the following steps: if the original analog signal x (t) can be regenerated or recorded, resampling can be performed; converting x (n) into an analog signal x (t) through digital-to-analog conversion D/A, and resampling the x (t) through analog-to-digital conversion A/D; thirdly, an L/M times sampling rate conversion algorithm converts the sampling rate of the sampled digital signal x (n) in a digital domain to obtain a new sampling rate, wherein the application of the third method is wider.
Further, by calling an audio manager of the audio system of the home appliance, a recording record object (namely, a RecordTrack object) corresponding to the recording application identifier is newly created, and by calling the recording record object, a tracking thread corresponding to the recording application identification representation is newly created.
Step S110, feeding the processed audio data back to a recording application program of the household appliance corresponding to the recording application identification mark.
Specifically, the processed audio data is fed back to the recording application program corresponding to the recording application identification representation, so that the recording application program encodes the processed audio data based on the audio source to generate a recording file, and the recording file is stored in a cache corresponding to the household appliance. After the audio driver starts to work, the system memory is applied, the collected audio data are put into the system memory for caching, and the upper layer application can obtain the collected audio data by reading the system memory.
Further, after generating the audio record file, the method further comprises: when a recording playing request based on the household appliance is detected, responding to the playing request, extracting a corresponding recording file from a cache corresponding to the household appliance, and performing voice broadcasting.
According to the household electrical appliance recording method, the recording request triggered by the household electrical appliance which starts the voice application program is obtained, the recording request is responded, audio data acquisition is carried out based on the audio source corresponding to the voice application program, and multiplexing of the audio source of the voice application program is achieved. The voice application program processes the audio data based on the audio parameters of the audio recorder, and initializes the sampling rate in the audio parameters of the audio recorder to meet the requirements that different application programs have different audio sampling rates, and further resamples the collected audio data by using the initialized sampling rate to obtain the audio data meeting the requirements of the recording application program, and feeds the audio data back to the recording application program of the household appliance corresponding to the recording application identification mark carried by the recording request. Because the audio source of the voice application program of the household appliance is multiplexed, even if the voice application program is always on line and occupies the audio source, the needed audio data can be extracted from the multiplexed audio source, and the audio data which is needed by the recording application program can be obtained through resampling processing, so that the function of simultaneously running the voice application program and the recording application program on the household appliance is realized, the user requirement is better met, and the use convenience for the household appliance is improved.
In one embodiment, as shown in fig. 2, another recording method for home appliances is provided, which specifically includes the following steps:
1) And acquiring and responding to the wake-up word aiming at the household appliance, and waking up the household appliance.
The household electrical appliance can be cooking equipment, including intelligent cooking equipment such as an oven, an electric cooker, a microwave oven, a steaming and baking integrated machine, an automatic cooking machine and the like, and can also be other household electrical appliances such as a refrigerator, an air conditioner and the like. For different household appliances, corresponding wake-up words are inconsistent, for example, for a steaming and baking all-in-one machine in cooking equipment, the corresponding wake-up words can be "start steaming and baking all-in-one machine", and when the wake-up words of "start steaming and baking all-in-one machine" are acquired, the steaming and baking all-in-one machine responds to the wake-up words and wakes up successfully.
2) And automatically starting a voice application program on the household appliance.
Specifically, the voice application program set on the home appliance may be a voice assistant, and after the home appliance wakes up, the voice assistant on the home appliance is automatically started, and performs voice recognition processing on the acquired audio data.
3) Calling the media recorder and newly establishing an audio recorder corresponding to the voice application program.
Specifically, the audio recorders of different application programs are different, after the voice application program is started, the corresponding media recorder is called, and the audio recorder corresponding to the voice application program is newly built.
4) The audio manager is invoked to initialize all audio parameters of the audio recorder corresponding to the voice application.
Specifically, the audio parameters of the voice application program comprise an audio source, a sampling rate, a sampling bit number, a channel number and a quantization bit number, and the initialization operation of all the audio parameters is realized by calling an audio manager.
5) Based on the interface of the audio hardware abstraction layer, calling an audio driver, and newly establishing an acquisition thread corresponding to the voice application program.
The HAL layer in the audio hardware abstraction layer interface, namely the audio HAL interface, is divided into two parts, wherein one part comprises various audio devices, each audio device is realized by a separate library file, and the other part is an audio strategy. The Audio driver is controlled by calling the Audio hardware abstraction layer interface, the acquisition thread corresponding to the voice application program is newly built, meanwhile, the Audio driver can be called based on the Audio hardware abstraction layer interface to acquire Audio data from the hardware resource of the Audio coder-decoder (namely Audio Codec), and the acquired Audio data can be stored in a preset cache of the household appliance.
6) And calling an acquisition thread corresponding to the voice application program, acquiring audio data from hardware resources of the audio codec, and determining the acquired audio data as an audio source corresponding to the voice application program.
Specifically, the acquisition of the audio data is realized by calling an acquisition thread corresponding to the voice application program, the acquired audio data is determined to be the audio source of the voice application program, and the multiplexing of the subsequent recording application program to the audio source of the voice application program is realized by acquiring the data from the audio source of the voice application program.
7) And acquiring a recording request triggered by the household appliance equipment with the started voice application program, wherein the recording request carries a recording application identification mark.
Specifically, under the condition that a voice application program of the home appliance is started and online, a recording request triggered by the home appliance is obtained, meanwhile, a recording application identification mark carried by the recording request is obtained, and a recording application program which specifically needs to be started can be determined based on the recording application identification mark.
8) And responding to the recording application request, and newly creating a media recorder corresponding to the recording application identification mark.
9) Calling a media recorder corresponding to the recording application identification mark, and creating an audio recorder corresponding to the recording application identification mark.
10 Calling an audio recorder corresponding to the recording application identification mark, and creating an acquisition thread corresponding to the recording application identification mark.
11 Calling an acquisition thread corresponding to the recording application identification mark, and acquiring audio data based on an audio source corresponding to the voice application program.
Specifically, the audio data acquisition is performed based on the audio source corresponding to the voice application program by calling the acquisition thread corresponding to the voice application identification mark, so that the multiplexing of the voice application program to the audio source of the voice application program is realized.
12 Initializing the sampling rate in the audio parameters of the audio recorder of the voice application to obtain the initialized sampling rate.
Specifically, by acquiring all audio parameters of an audio recorder of a voice application program and initializing sampling rates in the audio parameters, the obtained initialized sampling rates meet the requirements of the recording application program.
13 A sound frequency manager, a record object corresponding to the record application identification mark is newly built.
14 Calling the record object, and creating a tracking thread corresponding to the record application identification mark.
15 And (3) calling a tracking thread, and resampling the acquired audio data according to the initialized sampling rate to obtain the processed audio data.
Specifically, by calling the tracking thread, based on the initialized sampling rate, the method realizes resampling processing of audio data acquired from an audio source corresponding to the voice application program, and the audio data obtained after the resampling processing meets the requirement of the recording application program on coding processing.
16 The processed audio data is fed back to a recording application program of the household appliance corresponding to the recording application identification representation.
17 The recording application program encodes the processed audio data based on other audio parameters of the voice application program to generate a recording file, and stores the recording file in a cache corresponding to the household appliance.
Specifically, the recording application program realizes the coding processing of the received audio data based on other audio parameters of the audio recorder of the voice application program, including sampling bit number, quantization bit number, channel number and the like, further goes to a recording file and is stored in a preset cache of the household appliance. In the audio system of the home appliance, after the audio driver starts to work, the system memory is applied, the collected audio data is put into the system memory for caching, and the upper layer application can obtain the collected audio data by reading the system memory.
18 When the record playing request based on the household appliance is detected, responding to the playing request, extracting the corresponding record file from the cache corresponding to the household appliance, and performing voice broadcasting.
Specifically, when a recording playing request based on the household appliance is detected, a recording file identifier carried by the recording playing request is obtained, the recording file corresponding to the recording file identifier is extracted from a cache of the household appliance in response to the recording playing request, and voice broadcasting is carried out on the recording file.
In this embodiment, the multiplexing of the audio source of the voice application program is implemented by acquiring a recording request triggered by the home appliance device that has started the voice application program and performing audio data acquisition based on the audio source corresponding to the voice application program in response to the recording request. The voice application program processes the audio data based on the audio parameters of the audio recorder, the sampling rate in the audio parameters of the audio recorder is initialized to meet the requirements that different application programs have different audio sampling rates, the collected audio data is resampled by the initialized sampling rate to obtain audio data meeting the requirements of the recording application program, the audio data is fed back to the recording application program of the household appliance corresponding to the recording application identification mark carried by the recording request, and the recording application program can encode the obtained audio data by using other audio parameters of the audio recorder to generate a recording file. Because the audio source of the voice application program of the household appliance is multiplexed, even if the voice application program is always on line and occupies the audio source, the needed audio data can be extracted from the multiplexed audio source, and the audio data which is needed by the recording application program can be obtained through resampling processing, so that the function of simultaneously running the voice application program and the recording application program on the household appliance is realized, the user requirement is better met, and the use convenience for the household appliance is improved.
In one embodiment, the recording method of the home device shown in fig. 1 or fig. 2 is implemented based on an implementation architecture schematic of the recording method of the home device shown in fig. 3, referring to fig. 3, the implementation architecture of the recording method of the home device includes a hardware layer, a kernel layer, a hardware abstraction layer, a frame layer and an application layer, where the hardware layer includes an Audio hardware module, i.e., an Audio Codec (i.e., audio Codec), the kernel layer includes an Audio but driver, the hardware abstraction layer includes an Audio hardware abstraction layer interface (i.e., audio HAL interface), the frame layer includes an Audio manager, and a media recorder, an Audio recorder, an acquisition thread, a recording object and a trace line layer corresponding to a voice application program and a recording application program, respectively, and the application layer includes a voice application program and a recording application program.
As shown in fig. 3, a media recorder (MediaRecorder) and an audio recorder (AudioRecorder) corresponding to the voice application and the recording application are respectively provided in a frame layer (frame layer), and a corresponding audio recorder can be newly created by calling the media recorder. The Audio manager (audioplayer) can use the same interface to realize new creation of acquisition threads and record objects of different application programs, wherein the acquisition threads (RecordThread) of the voice application programs can realize cyclic acquisition of Audio data from hardware resources of an Audio Codec (Audio Codec) to generate Audio sources corresponding to the voice application programs. Through the collection thread of the recording application program, the audio pulse code modulation data can be read from the audio source corresponding to the voice application program.
Furthermore, by means of the record object (Recordtrack object) of the voice application program, all audio parameters of the audio recorder corresponding to the voice application program can be initialized, and by means of calling the record object, a tracking thread (TrackThread) corresponding to the voice application program can be newly built, so that resampling processing of the audio data stored in the buffer area of the audio data can be achieved. And feeding the processed audio data back to the voice application program, so that the voice application program carries out voice recognition processing on the acquired audio data.
Similarly, the initialization processing of the sampling rate of the audio recorder corresponding to the voice application program is realized through the recording object corresponding to the recording application program, and other audio parameters include the audio source, the number of channels, the sampling bit number, the quantization bit number and the like, so that the initialization processing is not needed. And creating a tracking thread corresponding to the recording application identification mark by calling the recording object corresponding to the recording application program. And calling a tracking thread corresponding to the recording application identification mark, and resampling the acquired audio data according to the initialized sampling rate to obtain the processed audio data. The processed audio data is fed back to the recording application program corresponding to the recording application identification representation, so that the recording application program encodes the processed audio data based on the audio source to generate a recording file, and the recording file is stored in a cache corresponding to the household appliance.
It should be understood that, although the steps in the flowcharts of fig. 1-2 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 1-2 may include multiple steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor do the order in which the steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with at least a portion of the steps or stages in other steps or other steps.
In one embodiment, as shown in fig. 4, there is provided a recording apparatus for home appliances, including: a recording request acquisition module 402, an audio data acquisition module 404, a sample rate initialization module 406, a resampling processing module 408, and an audio data feedback module 410, wherein:
the recording request obtaining module 402 is configured to obtain a recording request triggered by a home appliance device that has started a voice application, where the recording request carries a recording application identification identifier.
The audio data acquisition module 404 is configured to respond to the recording request and perform audio data acquisition based on an audio source corresponding to the voice application program; the voice application performs audio data processing based on the audio parameters of the audio recorder.
The sampling rate initialization module 406 is configured to initialize a sampling rate in audio parameters of the audio recorder.
The resampling processing module 408 is configured to resample the collected audio data according to the initialized sampling rate to obtain processed audio data.
The audio data feedback module 410 is configured to feed back the processed audio data to a recording application program of the home appliance corresponding to the recording application identification.
In the household electrical appliance recording device, the audio data acquisition is performed based on the audio source corresponding to the voice application program by acquiring the recording request triggered by the household electrical appliance with the voice application program started and responding to the recording request, so that the multiplexing of the audio source of the voice application program is realized. The voice application program processes the audio data based on the audio parameters of the audio recorder, and initializes the sampling rate in the audio parameters of the audio recorder to meet the requirements that different application programs have different audio sampling rates, and further resamples the collected audio data by using the initialized sampling rate to obtain the audio data meeting the requirements of the recording application program, and feeds the audio data back to the recording application program of the household appliance corresponding to the recording application identification mark carried by the recording request. Because the audio source of the voice application program of the household appliance is multiplexed, even if the voice application program is always on line and occupies the audio source, the needed audio data can be extracted from the multiplexed audio source, and the audio data which is needed by the recording application program can be obtained through resampling processing, so that the function of simultaneously running the voice application program and the recording application program on the household appliance is realized, the user requirement is better met, and the use convenience for the household appliance is improved.
In one embodiment, the audio data acquisition module is further configured to:
responding to the recording request, and creating an acquisition thread corresponding to the recording application identification mark;
and calling an acquisition thread, and acquiring audio data based on an audio source corresponding to the voice application program.
In one embodiment, the audio data acquisition module is further configured to:
calling a media recorder in response to the recording request, and creating an audio recorder corresponding to the recording application identification mark;
and calling an audio recorder, and creating an acquisition thread corresponding to the recording application identification mark.
In one embodiment, the resampling processing module is further to:
calling an audio manager, and creating a tracking thread corresponding to the record application identification mark;
and calling a tracking thread, and resampling the acquired audio data according to the initialized sampling rate to obtain the processed audio data.
In one embodiment, the resampling processing module is further to:
calling an audio manager, and creating a recording object corresponding to the recording application identification mark;
and calling the recorded object, and creating a tracking thread corresponding to the record application identification mark.
In one embodiment, the home device recording apparatus further includes:
And the audio data coding processing module is used for coding the processed audio data based on the audio recorder to generate a recording file.
And the recording file storage module is used for storing the recording file into a cache corresponding to the household appliance.
And the recording file playing module is used for responding to the playing request when detecting the recording playing request based on the household appliance, extracting the corresponding recording file from the cache corresponding to the household appliance and performing voice broadcasting.
For specific limitations of the recording device of the home appliance, reference may be made to the above limitation of the recording method of the home appliance, and no further description is given here. The modules in the recording device of the household appliance can be realized in whole or in part by software, hardware and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a home appliance, and the internal structure thereof may be as shown in fig. 5. The home appliance comprises a processor, a memory, a communication interface, a display screen and a sound acquisition/output device which are connected through a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless mode can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a home device recording method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structure shown in fig. 5 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, an electrical home appliance includes an electrical home appliance body, a sound collection/output device, a memory, and a processor, the sound collection/output device, the memory, and the processor being disposed on the electrical home appliance body; the memory stores a computer program which when executed by the processor performs the steps of:
acquiring a recording request triggered by a household appliance with a voice application program started, wherein the recording request carries a recording application identification mark;
responding to the recording request, and collecting audio data based on an audio source corresponding to the voice application program; the voice application program processes audio data based on audio parameters of the audio recorder;
initializing a sampling rate in audio parameters of the audio recorder;
Resampling the acquired audio data according to the initialized sampling rate to obtain processed audio data;
and feeding the processed audio data back to a recording application program of the household appliance corresponding to the recording application identification.
In one embodiment, the processor when executing the computer program further performs the steps of:
responding to the recording request, and creating an acquisition thread corresponding to the recording application identification mark;
and calling the acquisition thread, and acquiring audio data based on the audio source corresponding to the voice application program.
In one embodiment, the processor when executing the computer program further performs the steps of:
calling an audio manager, and creating a tracking thread corresponding to the recording application identification mark;
and calling the tracking thread, and resampling the acquired audio data according to the initialized sampling rate to obtain the processed audio data.
In one embodiment, the processor when executing the computer program further performs the steps of:
responding to the recording request, calling a media recorder, and creating an audio recorder corresponding to the recording application identification mark;
And calling the audio recorder, and creating an acquisition thread corresponding to the recording application identification mark.
In one embodiment, the processor when executing the computer program further performs the steps of:
calling an audio manager, and creating a recording object corresponding to the recording application identification mark;
and calling the recorded object, and creating a tracking thread corresponding to the record application identification mark.
In one embodiment, the processor when executing the computer program further performs the steps of:
based on the audio recorder, encoding the processed audio data to generate a recording file;
storing the sound record file into a cache corresponding to the household appliance;
when a record playing request based on the household electrical appliance is detected, responding to the playing request, extracting the corresponding record file from a cache corresponding to the household electrical appliance, and performing voice broadcasting.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring a recording request triggered by a household appliance with a voice application program started, wherein the recording request carries a recording application identification mark;
Responding to the recording request, and collecting audio data based on an audio source corresponding to the voice application program; the voice application program processes audio data based on audio parameters of the audio recorder;
initializing a sampling rate in audio parameters of the audio recorder;
resampling the acquired audio data according to the initialized sampling rate to obtain processed audio data;
and feeding the processed audio data back to a recording application program of the household appliance corresponding to the recording application identification.
In one embodiment, the computer program when executed by the processor further performs the steps of:
responding to the recording request, and creating an acquisition thread corresponding to the recording application identification mark;
and calling the acquisition thread, and acquiring audio data based on the audio source corresponding to the voice application program.
In one embodiment, the computer program when executed by the processor further performs the steps of:
calling an audio manager, and creating a tracking thread corresponding to the recording application identification mark;
and calling the tracking thread, and resampling the acquired audio data according to the initialized sampling rate to obtain the processed audio data.
In one embodiment, the computer program when executed by the processor further performs the steps of:
responding to the recording request, calling a media recorder, and creating an audio recorder corresponding to the recording application identification mark;
and calling the audio recorder, and creating an acquisition thread corresponding to the recording application identification mark.
In one embodiment, the computer program when executed by the processor further performs the steps of:
calling an audio manager, and creating a recording object corresponding to the recording application identification mark;
and calling the recorded object, and creating a tracking thread corresponding to the record application identification mark.
In one embodiment, the computer program when executed by the processor further performs the steps of:
based on the audio recorder, encoding the processed audio data to generate a recording file;
storing the sound record file into a cache corresponding to the household appliance;
when a record playing request based on the household electrical appliance is detected, responding to the playing request, extracting the corresponding record file from a cache corresponding to the household electrical appliance, and performing voice broadcasting.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, or the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (11)

1. A method of recording a sound of a home appliance, the method comprising:
starting a voice application program on the household appliance, calling a media recorder corresponding to the voice application program, creating an audio recorder corresponding to the voice application program, and initializing all audio parameters of the audio recorder corresponding to the voice application program;
acquiring a recording request triggered by a household appliance with a voice application program started, wherein the recording request carries a recording application identification mark;
Responding to the recording request, calling a media recorder to newly establish an audio recorder corresponding to the recording application identification mark, and continuously reading audio data from an audio source corresponding to the voice application program based on the audio recorder corresponding to the recording application identification mark in a circulating way; the voice application program processes audio data based on audio parameters of the audio recorder; the audio source corresponding to the voice application program is audio data obtained from hardware resources of an audio coder-decoder by an audio recorder corresponding to the voice application program, and the audio data are stored in a preset cache of the household appliance;
acquiring all audio parameters of an audio recorder corresponding to the voice application program, initializing sampling rates in all audio parameters, and determining the initialized sampling rates and other audio parameters in all audio parameters of the audio recorder corresponding to the voice application program as audio parameters of the audio recorder corresponding to the recording application identification mark;
resampling the acquired audio data according to the initialized sampling rate to obtain processed audio data;
And feeding the processed audio data back to a recording application program of the household appliance corresponding to the recording application identification.
2. The method of claim 1, wherein the audio recorder loop corresponding to the recording application identification based on the recording application identification continuously reads audio data from an audio source corresponding to the voice application, comprising:
calling an audio recorder corresponding to the recording application identification mark, and creating an acquisition thread corresponding to the recording application identification mark;
and calling the acquisition thread, and circularly and continuously reading the audio data from the audio source corresponding to the voice application program.
3. The method of claim 1, wherein resampling the collected audio data according to the initialized sampling rate to obtain processed audio data comprises:
calling an audio manager, and creating a tracking thread corresponding to the recording application identification mark;
and calling the tracking thread, and resampling the acquired audio data according to the initialized sampling rate to obtain the processed audio data.
4. The method of claim 3, wherein the invoking the audio manager to create a tracking thread corresponding to the recording application identification comprises:
Calling an audio manager, and creating a recording object corresponding to the recording application identification mark;
and calling the recorded object, and creating a tracking thread corresponding to the record application identification mark.
5. The method of claim 1, further comprising, after the feeding back the processed audio data to a recording application of a home device corresponding to the recording application identification,:
based on the audio recorder, encoding the processed audio data to generate a recording file;
storing the sound record file into a cache corresponding to the household appliance;
when a record playing request based on the household electrical appliance is detected, responding to the playing request, extracting the corresponding record file from a cache corresponding to the household electrical appliance, and performing voice broadcasting.
6. A recording device for an electrical home appliance, the device comprising:
the voice application program starting module is used for starting a voice application program on the household appliance, calling a media recorder corresponding to the voice application program, creating an audio recorder corresponding to the voice application program, and initializing all audio parameters of the audio recorder corresponding to the voice application program;
The recording request acquisition module is used for acquiring a recording request triggered by the household appliance equipment which starts the voice application program, wherein the recording request carries a recording application identification mark;
the audio data acquisition module is used for responding to the recording request, calling the media recorder to newly establish an audio recorder corresponding to the recording application identification mark, and circularly and continuously reading audio data from an audio source corresponding to the voice application program based on the audio recorder corresponding to the recording application identification mark; the voice application program processes audio data based on audio parameters of the audio recorder; the audio source corresponding to the voice application program is audio data obtained from hardware resources of an audio coder-decoder by an audio recorder corresponding to the voice application program, and the audio data are stored in a preset cache of the household appliance;
the sampling rate initialization module is used for acquiring all audio parameters of the audio recorder corresponding to the voice application program, initializing the sampling rate in all audio parameters, and determining the initialized sampling rate and other audio parameters in all audio parameters of the audio recorder corresponding to the voice application program as the audio parameters of the audio recorder corresponding to the recording application identification mark;
The resampling processing module is used for resampling the acquired audio data according to the initialized sampling rate to obtain processed audio data;
and the audio data feedback module is used for feeding the processed audio data back to a recording application program of the household appliance corresponding to the recording application identification mark.
7. The audio recording device of claim 6, wherein the audio data acquisition module is further configured to:
calling an audio recorder corresponding to the recording application identification mark, and creating an acquisition thread corresponding to the recording application identification mark; and calling the acquisition thread, and circularly and continuously reading the audio data from the audio source corresponding to the voice application program.
8. The home device recording apparatus of claim 6, wherein the resampling processing module is further configured to:
calling an audio manager, and creating a tracking thread corresponding to the recording application identification mark; and calling the tracking thread, and resampling the acquired audio data according to the initialized sampling rate to obtain the processed audio data.
9. The home device recording apparatus of claim 8, wherein the resampling processing module is further to:
Calling an audio manager, and creating a recording object corresponding to the recording application identification mark; and calling the recorded object, and creating a tracking thread corresponding to the record application identification mark.
10. The household electrical appliance comprises a household electrical appliance main body, a sound acquisition/output device, a memory and a processor, wherein the sound acquisition/output device, the memory and the processor are arranged on the household electrical appliance main body; the memory stores a computer program, characterized in that the processor implements the steps of the method of any one of claims 1 to 5 when executing the computer program.
11. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 5.
CN202010378219.0A 2020-05-07 2020-05-07 Household appliance recording method and device, storage medium and household appliance Active CN111583941B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010378219.0A CN111583941B (en) 2020-05-07 2020-05-07 Household appliance recording method and device, storage medium and household appliance

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010378219.0A CN111583941B (en) 2020-05-07 2020-05-07 Household appliance recording method and device, storage medium and household appliance

Publications (2)

Publication Number Publication Date
CN111583941A CN111583941A (en) 2020-08-25
CN111583941B true CN111583941B (en) 2024-01-16

Family

ID=72126327

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010378219.0A Active CN111583941B (en) 2020-05-07 2020-05-07 Household appliance recording method and device, storage medium and household appliance

Country Status (1)

Country Link
CN (1) CN111583941B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113360208B (en) * 2021-06-15 2022-11-25 读书郎教育科技有限公司 Method for solving problem of voice awakening application occupying recording
CN113971969B (en) * 2021-08-12 2023-03-24 荣耀终端有限公司 Recording method, device, terminal, medium and product
CN117389507B (en) * 2023-12-12 2024-05-10 荣耀终端有限公司 Audio data processing method, electronic device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103269374A (en) * 2013-05-29 2013-08-28 北京小米科技有限责任公司 Method, device and equipment for recording synchronization
CN107040496A (en) * 2016-02-03 2017-08-11 中兴通讯股份有限公司 A kind of audio data processing method and device
CN110097897A (en) * 2019-04-02 2019-08-06 烽火通信科技股份有限公司 A kind of Android device recording multiplexing method and system
CN110113494A (en) * 2019-05-05 2019-08-09 Oppo广东移动通信有限公司 The way of recording and relevant apparatus
CN110351445A (en) * 2019-06-19 2019-10-18 成都康胜思科技有限公司 A kind of high concurrent VOIP recording service system based on intelligent sound identification

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103269374A (en) * 2013-05-29 2013-08-28 北京小米科技有限责任公司 Method, device and equipment for recording synchronization
CN107040496A (en) * 2016-02-03 2017-08-11 中兴通讯股份有限公司 A kind of audio data processing method and device
CN110097897A (en) * 2019-04-02 2019-08-06 烽火通信科技股份有限公司 A kind of Android device recording multiplexing method and system
CN110113494A (en) * 2019-05-05 2019-08-09 Oppo广东移动通信有限公司 The way of recording and relevant apparatus
CN110351445A (en) * 2019-06-19 2019-10-18 成都康胜思科技有限公司 A kind of high concurrent VOIP recording service system based on intelligent sound identification

Also Published As

Publication number Publication date
CN111583941A (en) 2020-08-25

Similar Documents

Publication Publication Date Title
CN111583941B (en) Household appliance recording method and device, storage medium and household appliance
CN110335615B (en) Audio data processing method and device, electronic equipment and storage medium
JP6783339B2 (en) Methods and devices for processing audio
CN103905834A (en) Voice data coded format conversion method and device
CN112333596B (en) Earphone equalizer adjustment method, device, server and medium
CN104200824B (en) Audio recording method and apparatus
CN112689197B (en) File format conversion method and device and computer storage medium
CN111143310B (en) Log recording method and device and readable storage medium
CN116723353A (en) Video monitoring area configuration method, system, device and readable storage medium
CN103369383A (en) Control method and device of spatial remote controller, spatial remote controller and multimedia terminal
CN107797898B (en) Data acquisition method and device thereof
CN115170700A (en) Method for realizing CSS animation based on Flutter framework, computer equipment and storage medium
CN112433697B (en) Resource display method and device, electronic equipment and storage medium
CN114566173A (en) Audio mixing method, device, equipment and storage medium
CN114339308A (en) Video stream loading method, electronic equipment and storage medium
CN116126658A (en) Screen operation log process mining method, system, equipment and storage medium
CN115080843A (en) Monitoring scene video recommendation method, system, device and storage medium
CN111147655B (en) Model generation method and device
CN112393799A (en) Far-field voice equipment detection method and device and television terminal
CN112131423A (en) Picture acquisition method, device and system
CN113132773B (en) Method for entering television application and related equipment
CN113316041B (en) Remote health detection system, method, device and equipment
CN118132076B (en) Audio binary file generation method, electronic device and readable storage medium
CN104936092B (en) A kind of processing method of data, relevant apparatus and system
CN114360542A (en) Voice recognition method, device, 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