CN111583941A - 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 PDFInfo
- Publication number
- CN111583941A CN111583941A CN202010378219.0A CN202010378219A CN111583941A CN 111583941 A CN111583941 A CN 111583941A CN 202010378219 A CN202010378219 A CN 202010378219A CN 111583941 A CN111583941 A CN 111583941A
- Authority
- CN
- China
- Prior art keywords
- recording
- audio
- audio data
- application program
- household appliance
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 43
- 238000005070 sampling Methods 0.000 claims abstract description 70
- 238000012952 Resampling Methods 0.000 claims abstract description 36
- 230000001960 triggered effect Effects 0.000 claims abstract description 17
- 238000012545 processing Methods 0.000 claims description 36
- 238000004590 computer program Methods 0.000 claims description 21
- 230000004044 response Effects 0.000 claims description 5
- 230000006870 function Effects 0.000 description 7
- 238000010586 diagram Methods 0.000 description 6
- 238000004891 communication Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 5
- 238000013139 quantization Methods 0.000 description 5
- 238000010025 steaming Methods 0.000 description 5
- 238000006243 chemical reaction Methods 0.000 description 4
- 238000010411 cooking Methods 0.000 description 4
- 238000001914 filtration Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 230000003993 interaction Effects 0.000 description 2
- 230000005236 sound signal Effects 0.000 description 2
- 206010063385 Intellectualisation Diseases 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 125000004122 cyclic group Chemical group 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000006855 networking Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G11—INFORMATION STORAGE
- G11C—STATIC STORES
- G11C7/00—Arrangements for writing information into, or reading information out from, a digital store
- G11C7/16—Storage of analogue signals in digital stores using an arrangement comprising analogue/digital [A/D] converters, digital memories and digital/analogue [D/A] converters
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10L—SPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
- G10L17/00—Speaker identification or verification techniques
- G10L17/22—Interactive procedures; Man-machine interfaces
- G10L17/24—Interactive 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 recording method and device for household appliances, a storage medium and household appliances. The method comprises the following steps: acquiring a recording request triggered by the household appliance with the voice application program started, wherein the recording request carries a recording application identification mark; responding to the recording request, and acquiring 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 processed audio data; and feeding back the processed audio data to the recording application program corresponding to the recording application identification mark. By adopting the method, the multiplexing of the audio source of the voice application program can be realized, the required audio data is extracted from the multiplexed audio source, the function of simultaneously operating 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 of the household appliance is improved.
Description
Technical Field
The present application relates to the field of electrical appliance technologies, and in particular, to a recording method and apparatus for a home appliance, a storage medium, and a home appliance.
Background
With the rapid development of electrical appliance technologies and the internet of things, the household electrical appliance gradually realizes intellectualization and networking, and the intelligent household electrical appliance carries a voice function applied to human-computer interaction. In the existing system design, only one hardware resource of an audio codec is set on a household appliance, that is, only one audio source exists. Under the online working scene of the voice application program of the household appliance, the voice application program needs to occupy the hardware resource of the audio codec in real time.
Because the voice application program on the existing household appliance with the voice function is always on line, the hardware resource of the audio codec is always occupied by the voice application program, so that other recording application programs and the like cannot normally run. For example, the recording application program cannot record audio, or the existing household appliance cannot meet the requirement that the voice application program and other recording application programs need to run simultaneously due to the fact that hardware resources of the audio codec cannot be called to cause the recorded audio to have no sound, and the use convenience is low.
Disclosure of Invention
In view of the above, it is desirable to provide a recording method, an apparatus, a storage medium and a home appliance capable of improving the convenience of using the home appliance.
A recording method for an electric home appliance, the method comprising:
acquiring a recording request triggered by household appliances with started voice application programs, wherein the recording request carries a recording application identification mark;
responding to the recording request, and acquiring audio data based on an audio source corresponding to the voice application program; the voice application program carries out audio data processing based on the audio parameters of the audio recorder;
initializing a sampling rate in audio parameters of the audio recorder;
resampling the collected audio data according to the initialized sampling rate to obtain processed audio data;
and feeding back the processed audio data to a recording application program of the household appliance corresponding to the recording application identification mark.
In one embodiment, the collecting audio data based on the audio source corresponding to the voice application in response to the recording request includes:
responding to the recording request, and establishing an acquisition thread corresponding to the recording application identification mark;
and calling the acquisition thread, and acquiring audio data based on an 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 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 creating, in response to the recording request, 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 establishing a new acquisition thread corresponding to the recording application identification mark.
In one embodiment, the invoking an audio manager to create a trace thread corresponding to the recording application identifier includes:
calling an audio manager, and creating a recording object corresponding to the recording application identification mark;
and calling the recording object, and establishing a tracking thread corresponding to the recording application identification mark.
In one embodiment, after feeding back the processed audio data to the recording application program of the home appliance corresponding to the recording application identification identifier, the method further includes:
based on the audio recorder, the processed audio data are coded to generate a recording file;
storing the sound recording file into a cache corresponding to the household appliance;
and when a recording playing request based on the household appliance is detected, responding to the playing request, extracting the corresponding recording file from the cache corresponding to the household appliance, and carrying out voice broadcasting.
An appliance recording device, the device comprising:
the recording request acquisition module is used for 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;
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 carries out audio data processing based on the audio parameters of the audio recorder;
the sampling rate initialization 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 the 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 establishing an acquisition thread corresponding to the recording application identification mark; and calling the acquisition thread, and acquiring audio data based on an audio source corresponding to the voice application program.
A household appliance comprises a household 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 appliance main body; the memory stores a computer program which when executed by the processor performs the steps of:
acquiring a recording request triggered by household appliances with started voice application programs, wherein the recording request carries a recording application identification mark;
responding to the recording request, and acquiring audio data based on an audio source corresponding to the voice application program; the voice application program carries out audio data processing based on the audio parameters of the audio recorder;
initializing a sampling rate in audio parameters of the audio recorder;
resampling the collected audio data according to the initialized sampling rate to obtain processed audio data;
and feeding back the processed audio data to a recording application program of the household appliance corresponding to the recording application identification mark.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
acquiring a recording request triggered by household appliances with started voice application programs, wherein the recording request carries a recording application identification mark;
responding to the recording request, and acquiring audio data based on an audio source corresponding to the voice application program; the voice application program carries out audio data processing based on the audio parameters of the audio recorder;
initializing a sampling rate in audio parameters of the audio recorder;
resampling the collected audio data according to the initialized sampling rate to obtain processed audio data;
and feeding back the processed audio data to a recording application program of the household appliance corresponding to the recording application identification mark.
In the household appliance recording method, the household appliance recording device, the storage medium and the household appliance, the audio source multiplexing of the voice application program is realized by acquiring the recording request triggered by the household appliance which starts the voice application program, responding to the recording request and acquiring the audio data based on the audio source corresponding to the voice application program. The voice application program carries out audio data processing 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 requirement that different application programs have different audio sampling rates, and then the acquired audio data is resampled by utilizing the initialized sampling rate to obtain the audio data meeting the requirement of the recording application program and feed back the audio data to the recording application program of the household appliance corresponding to the recording application identification carried by the recording request. Because the audio source of the voice application program of the household appliance is multiplexed, even under the condition that the voice application program is always on line and occupies the audio source, the required audio data can be extracted from the multiplexed audio source, and the audio data meeting the requirement of the recording application program is obtained through resampling treatment, so that the function of simultaneously operating 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 flowchart illustrating a recording method of a home appliance according to an embodiment;
fig. 2 is a schematic flow chart illustrating a recording method of the home appliance according to another embodiment;
fig. 3 is a schematic diagram illustrating an implementation architecture of a recording method of a home appliance according to an embodiment;
fig. 4 is a block diagram of a recording apparatus of a home appliance according to an embodiment;
fig. 5 is an internal structural diagram of a home device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In an embodiment, as shown in fig. 1, a recording method for a home appliance is provided, and this embodiment is exemplified by applying the method to a home appliance terminal, it is to be understood that the method may also be applied to a server, and may also be applied to a system including the home appliance terminal and the server, and is implemented by 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 with the voice application program started is obtained, and the recording request carries a recording application identification mark.
Specifically, the user triggers a recording request to the household appliance which has started the voice application, so that the household appliance can start the recording application corresponding to the recording application identification identifier according to the recording request under the condition that the voice application is always on line.
In one embodiment, before triggering the recording request to the home device, the method further includes:
and acquiring and responding to the awakening words aiming at the household appliance, awakening the household appliance, and automatically starting the voice application program on the household appliance. And after the voice application program is started, calling the media recorder, newly building an audio recorder corresponding to the voice application program, and initializing all audio parameters corresponding to the audio recorder by calling the audio manager. And calling an audio driver based on the audio hardware abstraction layer interface, acquiring audio data from the 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 woken up. After the household appliance is awakened, the voice application program installed on the household appliance is self-started, wherein the voice application program installed on the household appliance can be a voice assistant loaded on the household appliance, and the self-starting 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) provided on the home appliance.
Wherein different applications create respective corresponding media recorders (mediarecorders) and respective opposite audio recorders (audiorecorders) at a framework (frame) layer. The audio manager (i.e., AudioFlinger) is the core of the audio system of the home appliance, mainly takes charge of 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 manager loads the audio device library file, the audio manager searches a library beginning with audio from/system/lib/hw/lower, meanwhile, the name of the audio device defined in audio _ policy.conf is used as the name of the second part of the library, the name of the loaded audio device library is determined, and the implementation interfaces of each audio library are consistent, so that the audio manager can call different audio devices by using the same interface.
Based on the Audio hardware abstraction layer interface, an Audio driver can be called to obtain Audio data from the hardware resources of an Audio Codec (i.e., Audio Codec), and the obtained Audio data can also be stored in a preset cache of the home appliance. The HAL layer is divided into two parts, one part is various audio devices, each audio device is realized by an independent library file, and the other part is an audio strategy. Above the HAL layer is a core audio manager of the audio system, which implements management of various input and output audio streams, manages real-time available audio channels, selects audio channels for various audio streams, implements mixing of multiple audio streams, and the like.
Further, after all audio parameters of the audio recorder corresponding to the voice application program are initialized, the voice application program performs voice recognition processing on the acquired audio data by using the initialized audio parameters to obtain an audio file meeting the requirements.
Wherein, the audio frequency parameter of the audio frequency recorder mainly includes: (1) audio source: may be understood as the source of the audio data. (2) Sampling frequency: also referred to as sampling speed or sampling rate, defines the number of samples per second taken from a continuous signal and constituting a discrete signal, which can be understood as the number of samples of the signal taken per second. (3) Sampling bit number: the parameter for measuring the fluctuation change of the sound, i.e. the resolution of the sound card processing the sound, is the binary digit number of the digital sound signal used by the sound card when collecting and playing the sound file, the larger the value is, the higher the resolution is, and the truer the sound recorded and played back is. (4) The number of channels: the digital stereo sound source has the advantages that the digital stereo sound source has a single sound channel and two sound channels, the two sound channels are also called stereo sound, two lines are occupied in hardware, the sound quality and the tone color are good, and the space occupied by the digitized stereo sound source is twice more than that of the single sound channel. (5) Quantization bit number: the representation digitizes the amplitude axis of the analog audio signal and determines the dynamic range of the analog signal after digitization.
And step S104, responding to the recording request, and acquiring audio data based on an audio source corresponding to the voice application program.
Specifically, in response to the recording request, an acquisition thread (i.e., RecordThread) corresponding to the recording application identification representation is newly created, the acquisition thread is called, and audio data acquisition is performed based on an audio source corresponding to the voice application.
And further, responding to the recording request, calling the media recorder corresponding to the recording application identification mark, newly building an audio recorder corresponding to the recording application identification mark, and building an acquisition thread corresponding to the recording application identification mark by calling the audio recorder. And circularly and continuously reading the audio pulse code modulation data from the audio source corresponding to the voice application program based on the acquisition thread.
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 the audio source, the number of channels, the number of sampling bits, the number of quantization bits and other parameters are determined as the audio parameters of the audio recorder corresponding to the recording application program.
And S108, resampling the acquired audio data according to the initialized sampling rate to obtain processed audio data.
Specifically, a tracking thread (TrackThread) corresponding to the recording application is newly created by calling an audio manager of an audio system of the household appliance, the tracking thread is called, and the acquired audio data is resampled according to the initialized sampling rate to obtain the processed audio data. In the speech recognition process, in order to meet the requirements for different sampling rates, it is often necessary to resample the speech, i.e. to convert the original sampling frequency into a new sampling frequency to adapt to the requirements for different sampling rates.
The main audio resampling step is interpolation or decimation, aliasing may be generated due to decimation, image may be generated due to interpolation, anti-aliasing filtering needs to be performed before decimation, anti-image filtering needs to be performed after interpolation, and both the anti-aliasing filtering and the anti-image filtering can be realized by using a low-pass filter. The method for realizing resampling comprises the following steps: firstly, if the original analog signal x (t) can be reproduced or recorded, re-sampling can be performed; secondly, converting x (n) into an analog signal x (t) through digital-to-analog conversion D/A, and resampling the analog-to-digital conversion A/D of the x (t); and thirdly, performing sampling rate conversion on the sampled digital signal x (n) in a digital domain by using an L/M sampling rate conversion algorithm to obtain a new sampling rate, wherein the application of the third method is relatively wide.
Further, a recording object (i.e. a recordtack object) corresponding to the recording application identifier is created by calling an audio manager of the audio system of the home appliance, and a tracking thread corresponding to the recording application identification representation is created by calling the recording object.
And step S110, feeding back the processed audio data to the 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 an 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 working, the system memory is applied, the acquired audio data is stored in the system memory for caching, and the upper application can acquire the acquired audio data by reading the system memory.
Further, after the audio record file is generated, the method further comprises: and 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 carrying out voice broadcasting.
In the household appliance recording method, the multiplexing of the audio source of the voice application program is realized by acquiring the recording request triggered by the household appliance which starts the voice application program, responding to the recording request and acquiring the audio data based on the audio source corresponding to the voice application program. The voice application program carries out audio data processing 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 requirement that different application programs have different audio sampling rates, and then the acquired audio data is resampled by utilizing the initialized sampling rate to obtain the audio data meeting the requirement of the recording application program and feed back the audio data to the recording application program of the household appliance corresponding to the recording application identification carried by the recording request. Because the audio source of the voice application program of the household appliance is multiplexed, even under the condition that the voice application program is always on line and occupies the audio source, the required audio data can be extracted from the multiplexed audio source, and the audio data meeting the requirement of the recording application program is obtained through resampling treatment, so that the function of simultaneously operating 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 an embodiment, as shown in fig. 2, another recording method for a home appliance is provided, which specifically includes the following steps:
1) and acquiring and responding to the awakening words aiming at the household appliance to awaken the household appliance.
The household appliances can be cooking appliances, including intelligent cooking appliances such as ovens, electric cookers, microwave ovens, steaming and baking integrated machines and automatic cooking machines, and can also be other household appliances such as refrigerators, air conditioners and the like. For different household appliances, the corresponding awakening words are not consistent, for example, for a steaming and baking all-in-one machine in the cooking device, the corresponding awakening words can be 'turn on the steaming and baking all-in-one machine', and when the awakening words of 'turn on the steaming and baking all-in-one machine' are obtained, the steaming and baking all-in-one machine responds to the awakening words and successfully awakens.
2) And automatically starting the 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 loaded on the home appliance starts itself and performs voice recognition processing on the acquired audio data.
3) And calling the media recorder, and newly building an audio recorder corresponding to the voice application program.
Specifically, the audio recorders of different applications are different, and after the voice application is started, the corresponding media recorder is called, and the audio recorder corresponding to the voice application is newly built.
4) And calling an audio manager to initialize all audio parameters of the audio recorder corresponding to the voice application program.
Specifically, the audio parameters of the voice application include 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) And calling an audio driver based on an audio hardware abstraction layer interface, and newly building a collection 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, one part comprises various audio equipment, each audio equipment is realized by an independent library file, and the other part is an audio strategy. The Audio driver is called to control the Audio driver by calling the Audio hardware abstraction layer interface, a new acquisition thread corresponding to the voice application program is 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 an Audio Codec (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 audio data is acquired by calling an acquisition thread corresponding to the voice application program, the acquired audio data is determined as an audio source of the voice application program, and the audio source of the voice application program is multiplexed by the subsequent recording application program through data acquisition from the audio source of the voice application program.
7) And acquiring a recording request triggered by the household appliance with the voice application program started, wherein the recording request carries a recording application identification mark.
Specifically, under the condition that a voice application program of the household appliance is started and on-line, a recording request triggered by the household appliance is obtained, a recording application identification carried by the recording request is obtained, and the recording application program which needs to be started specifically can be determined based on the recording application identification.
8) Responding to the recording application request, and establishing a media recorder corresponding to the recording application identification mark.
9) And calling the media recorder corresponding to the recording application identification mark, and creating an audio recorder corresponding to the recording application identification mark.
10) And calling the audio recorder corresponding to the recording application identification mark, and establishing an acquisition thread corresponding to the recording application identification mark.
11) And 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 source multiplexing of the voice application program by the recording application program is realized by calling the acquisition thread corresponding to the recording application identification identifier and acquiring audio data based on the audio source corresponding to the voice application program.
12) Initializing the sampling rate in the audio parameters of the audio recorder of the voice application program to obtain the initialized sampling rate.
Specifically, all audio parameters of the audio recorder of the voice application program are obtained, and the sampling rate in the audio parameters is initialized, so that the obtained initialized sampling rate meets the requirements of the recording application program.
13) And the sound and frequency mixing manager is used for creating a recording object corresponding to the recording application identification mark.
14) And calling the recording object, and establishing a tracking thread corresponding to the recording application identification mark.
15) And calling a tracking thread, and performing resampling processing on the acquired audio data according to the initialized sampling rate to obtain processed audio data.
Specifically, the audio data collected from the audio source corresponding to the voice application program is resampled by calling the tracking thread based on the initialized sampling rate, and the audio data obtained after resampling processing meets the requirement of the recording application program on coding processing.
16) And feeding back the processed audio data to a recording application program of the household appliance corresponding to the recording application identification representation.
17) And 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 encoding processing of 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, and further obtains a recording file, and stores the recording file in a preset cache of the home appliance device. In the audio system of the household electrical equipment, after the audio driver starts working, a system memory is applied, the acquired audio data is stored in the system memory for caching, and the upper application can acquire the acquired audio data by reading the system memory.
18) And 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 carrying out 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 playing request is responded, a recording file corresponding to the recording file identifier is extracted from a cache of the household appliance, and the recording file is subjected to voice broadcast.
In this embodiment, the audio source of the voice application program is multiplexed by acquiring a recording request triggered by the home appliance device that has started the voice application program, and responding to the recording request, and performing audio data acquisition based on the audio source corresponding to the voice application program. The voice application program carries out audio data processing 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 requirement that different application programs have different audio sampling rates, the acquired audio data are subjected to resampling processing by utilizing the initialized sampling rate, the audio data meeting the requirement of the recording application program are obtained and 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 acquired audio data are subjected to coding processing by utilizing other audio parameters of the audio recorder by the recording application program to generate a recording file. Because the audio source of the voice application program of the household appliance is multiplexed, even under the condition that the voice application program is always on line and occupies the audio source, the required audio data can be extracted from the multiplexed audio source, and the audio data meeting the requirement of the recording application program is obtained through resampling treatment, so that the function of simultaneously operating 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 an embodiment, the recording method of the home appliance shown in fig. 1 or fig. 2 is implemented based on an implementation architecture diagram of the recording method of the home appliance shown in fig. 3, and referring to fig. 3, the implementation architecture of the recording method of the home appliance includes a hardware layer, a kernel layer, a hardware abstraction layer, a framework 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 driver, the hardware abstraction layer includes an Audio hardware abstraction layer interface (i.e., audioHAL interface), the framework layer includes an Audio manager, and a media recorder, an Audio recorder, an acquisition thread, a recording object and a trace layer corresponding to a voice application and a recording application, respectively, and the application layer includes a voice application and a recording application.
As shown in fig. 3, a media recorder (MediaRecorder) and an audio recorder (AudioRecorder) corresponding to the voice application and the recording application, respectively, are provided in the framework layer (framework layer), and the corresponding audio recorder can be newly created by calling the media recorder. The Audio manager (audioFlinger) can use the same interface to realize the new creation of the acquisition thread and the recording object of different application programs, wherein the acquisition thread (Recordthread) of the voice application program can realize the cyclic acquisition of Audio data from the hardware resource of the Audio Codec (Audio Codec) to generate the Audio source corresponding to the voice application program. Through the acquisition thread of the recording application program, audio pulse code modulation data can be read from an audio source corresponding to the voice application program.
Further, by using a recording object (Recordtrack object) of the voice application, it is possible to initialize all audio parameters of the audio recorder corresponding to the voice application, and by calling the recording object, it is also possible to create a trace thread (TrackThread) corresponding to the voice application, thereby realizing resampling processing of the audio data stored in the buffer of the audio data. And feeding back the processed audio data to the voice application program, so that the voice application program performs 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 comprise an audio source, the number of channels, the number of sampling bits, the number of quantization bits and the like, so that the initialization processing is not needed. And establishing a tracking thread corresponding to the recording application identification mark by calling a 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 are 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 an 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 various steps in the flow charts of fig. 1-2 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 1-2 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least some of the other steps.
In one embodiment, as shown in fig. 4, there is provided a recording apparatus for a home appliance, 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:
a recording request obtaining module 402, configured to obtain a recording request triggered by the home appliance device that has started the voice application, where the recording request carries a recording application identification.
An audio data acquisition module 404, configured to respond to the recording request and perform audio data acquisition based on an audio source corresponding to the voice application; the voice application performs audio data processing based on the audio parameters of the audio recorder.
A sample rate initialization module 406 for initializing a sample rate in audio parameters of the audio recorder.
And a resampling processing module 408, configured to perform resampling processing on the acquired audio data according to the initialized sampling rate, so as to obtain processed audio data.
And an audio data feedback module 410, configured to feed back the processed audio data to the recording application program of the home appliance corresponding to the recording application identification.
In the household appliance recording device, the recording request triggered by the household appliance which starts the voice application program is obtained, the recording request is responded, and the audio source corresponding to the voice application program is used for carrying out audio data acquisition, so that the multiplexing of the audio source of the voice application program is realized. The voice application program carries out audio data processing 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 requirement that different application programs have different audio sampling rates, and then the acquired audio data is resampled by utilizing the initialized sampling rate to obtain the audio data meeting the requirement of the recording application program and feed back the audio data to the recording application program of the household appliance corresponding to the recording application identification carried by the recording request. Because the audio source of the voice application program of the household appliance is multiplexed, even under the condition that the voice application program is always on line and occupies the audio source, the required audio data can be extracted from the multiplexed audio source, and the audio data meeting the requirement of the recording application program is obtained through resampling treatment, so that the function of simultaneously operating 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 establishing 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:
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 establishing a new acquisition thread corresponding to the recording application identification mark.
In one embodiment, the resampling processing module is further configured to:
calling an audio manager, and establishing a tracking thread corresponding to the recording application identification mark;
and calling a tracking thread, and performing resampling processing on the acquired audio data according to the initialized sampling rate to obtain processed audio data.
In one embodiment, the resampling processing module is further configured to:
calling an audio manager, and creating a recording object corresponding to the recording application identification mark;
and calling the recording object, and establishing a tracking thread corresponding to the recording application identification mark.
In one embodiment, the recording apparatus of the home appliance 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 equipment, extracting the corresponding recording file from the cache corresponding to the household appliance equipment, and carrying out voice broadcasting.
For specific limitations of the recording apparatus of the home appliance, reference may be made to the above limitations of the recording method of the home appliance, and details are not described herein again. All modules in the recording device of the household appliance can be completely or partially realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a home device, and its internal structure diagram may be as shown in fig. 5. The household 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 comprises a nonvolatile 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 an operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication 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 recording method for a home appliance. 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, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 5 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a home appliance includes a home appliance main 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 home appliance main body; the memory has stored therein a computer program which when executed by the processor performs the steps of:
acquiring a recording request triggered by household appliances with started voice application programs, wherein the recording request carries a recording application identification mark;
responding to the recording request, and acquiring audio data based on an audio source corresponding to the voice application program; the voice application program carries out audio data processing based on the audio parameters of the audio recorder;
initializing a sampling rate in audio parameters of the audio recorder;
resampling the collected audio data according to the initialized sampling rate to obtain processed audio data;
and feeding back the processed audio data to a recording application program of the household appliance corresponding to the recording application identification mark.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
responding to the recording request, and establishing an acquisition thread corresponding to the recording application identification mark;
and calling the acquisition thread, and acquiring audio data based on an 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 establishing a new 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 recording object, and establishing a tracking thread corresponding to the recording application identification mark.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
based on the audio recorder, the processed audio data are coded to generate a recording file;
storing the sound recording file into a cache corresponding to the household appliance;
and when a recording playing request based on the household appliance is detected, responding to the playing request, extracting the corresponding recording file from the cache corresponding to the household appliance, and carrying out 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 household appliances with started voice application programs, wherein the recording request carries a recording application identification mark;
responding to the recording request, and acquiring audio data based on an audio source corresponding to the voice application program; the voice application program carries out audio data processing based on the audio parameters of the audio recorder;
initializing a sampling rate in audio parameters of the audio recorder;
resampling the collected audio data according to the initialized sampling rate to obtain processed audio data;
and feeding back the processed audio data to a recording application program of the household appliance corresponding to the recording application identification mark.
In one embodiment, the computer program when executed by the processor further performs the steps of:
responding to the recording request, and establishing an acquisition thread corresponding to the recording application identification mark;
and calling the acquisition thread, and acquiring audio data based on an 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 establishing a new 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 recording object, and establishing a tracking thread corresponding to the recording application identification mark.
In one embodiment, the computer program when executed by the processor further performs the steps of:
based on the audio recorder, the processed audio data are coded to generate a recording file;
storing the sound recording file into a cache corresponding to the household appliance;
and when a recording playing request based on the household appliance is detected, responding to the playing request, extracting the corresponding recording file from the cache corresponding to the household appliance, and carrying out voice broadcasting.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.
Claims (10)
1. A recording method for household appliances is characterized by comprising the following steps:
acquiring a recording request triggered by household appliances with started voice application programs, wherein the recording request carries a recording application identification mark;
responding to the recording request, and acquiring audio data based on an audio source corresponding to the voice application program; the voice application program carries out audio data processing based on the audio parameters of the audio recorder;
initializing a sampling rate in audio parameters of the audio recorder;
resampling the collected audio data according to the initialized sampling rate to obtain processed audio data;
and feeding back the processed audio data to a recording application program of the household appliance corresponding to the recording application identification mark.
2. The method of claim 1, wherein the performing audio data acquisition based on an audio source corresponding to the voice application in response to the recording request comprises:
responding to the recording request, and establishing an acquisition thread corresponding to the recording application identification mark;
and calling the acquisition thread, and acquiring audio data based on an audio source corresponding to the voice application program.
3. The method of claim 1, wherein the 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 2, wherein said creating an acquisition thread corresponding to said recording application identification in response to said recording request comprises:
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 establishing a new acquisition thread corresponding to the recording application identification mark.
5. The method of claim 3, wherein said invoking an audio manager to create a trace thread corresponding to said recording application identifier comprises:
calling an audio manager, and creating a recording object corresponding to the recording application identification mark;
and calling the recording object, and establishing a tracking thread corresponding to the recording application identification mark.
6. The method of claim 1, further comprising, after feeding back the processed audio data to a recording application program of the home device corresponding to the recording application identification identifier:
based on the audio recorder, the processed audio data are coded to generate a recording file;
storing the sound recording file into a cache corresponding to the household appliance;
and when a recording playing request based on the household appliance is detected, responding to the playing request, extracting the corresponding recording file from the cache corresponding to the household appliance, and carrying out voice broadcasting.
7. A recording apparatus for home appliances, the apparatus comprising:
the recording request acquisition module is used for 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;
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 carries out audio data processing based on the audio parameters of the audio recorder;
the sampling rate initialization 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 the recording application program of the household appliance corresponding to the recording application identification mark.
8. The recording apparatus of claim 7, wherein the audio data acquisition module is further configured to:
responding to the recording request, and establishing an acquisition thread corresponding to the recording application identification mark; and calling the acquisition thread, and acquiring audio data based on an audio source corresponding to the voice application program.
9. A household appliance comprises a household 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 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 6 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
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 true CN111583941A (en) | 2020-08-25 |
CN111583941B 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) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113360208A (en) * | 2021-06-15 | 2021-09-07 | 读书郎教育科技有限公司 | Method for solving voice awakening application occupation recording |
CN113971969A (en) * | 2021-08-12 | 2022-01-25 | 荣耀终端有限公司 | Recording method, device, terminal, medium and product |
CN117389507A (en) * | 2023-12-12 | 2024-01-12 | 荣耀终端有限公司 | Audio data processing method, electronic device and storage medium |
Citations (5)
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 |
-
2020
- 2020-05-07 CN CN202010378219.0A patent/CN111583941B/en active Active
Patent Citations (5)
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 |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113360208A (en) * | 2021-06-15 | 2021-09-07 | 读书郎教育科技有限公司 | Method for solving voice awakening application occupation recording |
CN113360208B (en) * | 2021-06-15 | 2022-11-25 | 读书郎教育科技有限公司 | Method for solving problem of voice awakening application occupying recording |
CN113971969A (en) * | 2021-08-12 | 2022-01-25 | 荣耀终端有限公司 | Recording method, device, terminal, medium and product |
CN117389507A (en) * | 2023-12-12 | 2024-01-12 | 荣耀终端有限公司 | Audio data processing method, electronic device and storage medium |
CN117389507B (en) * | 2023-12-12 | 2024-05-10 | 荣耀终端有限公司 | Audio data processing method, electronic device and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN111583941B (en) | 2024-01-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111583941B (en) | Household appliance recording method and device, storage medium and household appliance | |
CN105049917B (en) | The method and apparatus of recording audio/video synchronized timestamp | |
CN105094808B (en) | A kind of control device and method | |
WO2020024945A1 (en) | Method and apparatus for determining timestamp | |
CN110335615B (en) | Audio data processing method and device, electronic equipment and storage medium | |
CN108334202B (en) | Wallpaper updating method and related product | |
CN108282673A (en) | A kind of update method, server and client playing record | |
US20220244845A1 (en) | Method, device, electronic device, and storage medium for sending and receiving message | |
CN109542385B (en) | Multi-data-stream on-screen display method, system 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 | |
WO2019134685A1 (en) | Oscilloscope data processing method and device, and oscilloscope | |
CN115170700A (en) | Method for realizing CSS animation based on Flutter framework, computer equipment and storage medium | |
JP2020017125A (en) | Information processor, information processing system, information processing method, and program | |
CN115328496A (en) | File generation method and device | |
CN113507529A (en) | Method for realizing file downloading based on Web application | |
CN112393799A (en) | Far-field voice equipment detection method and device and television terminal | |
CN111459756A (en) | Log processing method and related equipment | |
CN111857551A (en) | Video data aging method and device | |
CN110311754A (en) | A kind of method of reseptance of data, device, storage medium and electronic equipment | |
CN113316041B (en) | Remote health detection system, method, device and equipment | |
CN113535299B (en) | Server, display device and health management method | |
CN115499339B (en) | Pressure testing method, system and device for VNC function and storage medium | |
CN113132773B (en) | Method for entering television application and related equipment |
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 |