CN103531224B - Be applied to the simple and easy speech playing method of embedded system platform - Google Patents
Be applied to the simple and easy speech playing method of embedded system platform Download PDFInfo
- Publication number
- CN103531224B CN103531224B CN201310460892.9A CN201310460892A CN103531224B CN 103531224 B CN103531224 B CN 103531224B CN 201310460892 A CN201310460892 A CN 201310460892A CN 103531224 B CN103531224 B CN 103531224B
- Authority
- CN
- China
- Prior art keywords
- file
- processor
- sampled data
- formatted file
- wav formatted
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 32
- 238000006243 chemical reaction Methods 0.000 claims abstract description 4
- 230000005540 biological transmission Effects 0.000 claims description 17
- 238000005070 sampling Methods 0.000 claims description 6
- 230000015572 biosynthetic process Effects 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000005457 optimization Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 1
- 238000003786 synthesis reaction Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Landscapes
- Compression, Expansion, Code Conversion, And Decoders (AREA)
- Stereophonic System (AREA)
Abstract
The present invention relates to the simple and easy speech playing method being applied to embedded system platform, comprising: target text is converted to WAV formatted file; The sampled data of WAV formatted file is sent to D/A converter by processor; D/A converter is sent to note amplifier after sampled data is carried out digital-to-analog conversion and is processed, and is play by loudspeaker.After adopting the inventive method, can effectively reduce processor occupancy, reduce the requirement to processor, save the hardware cost of embedded system platform language play back system.
Description
Technical field
The present invention relates to a kind of speech playing method, especially a kind of simple and easy speech playing method being applied to embedded system platform.
Background technology
In recent years, along with electronic technology fast development, embedded system platform is applied in field more and more widely, and also from strength to strength, complexity is also more and more higher for function, and embedded system platform speech play technology also experienced by the development in multiple stage.
According to the knowledge of the applicant, common at present embedded system platform speech playing method has three kinds usually:
(1) by voice recording and playback ic (as ISD4003 series), convert required speech data to numerical information in advance, and deposit to chip internal; During broadcasting, digital signal is restored into voice.The advantage of this method is: use high sampling rate can obtain high-quality, natural voice during recording; But its shortcoming is: the sound pick-up outfit and the playback environ-ment that need specialty during a. recording, otherwise intolerable neighbourhood noise can be introduced; B. high sampling rate needs more storage spaces, and chip price corresponding is with it expensive.
(2) adopt the chipspeech (as the XFS5051CE flown is interrogated in University of Science and Technology) of specialty, based on the speech synthesis technique of advanced person, receive text (comprising Chinese) to be synthesized by UART interface, then text is directly synthesized voice output file.The advantage of this method is: be simple and easy to use, optional multiple pronunciation style (comprising dialect), can, based on special linguistic context optimization, make voice warmer, natural; But its shortcoming is: chip kind is few, expensive.
(3) software decode and play-back technology (as common GPS Voice Navigation, Mp 3 player etc.), deposit to device interior memory block by the audio file recorded in advance, by software decode when needing, and coordinates hardware to export voice.The advantage of this method is: low price, and can play the audio file of any form in theory; But its shortcoming is: software decode needs to take a large amount of processor (CPU or MCU) resources, very high to the requirement of processor.
With regard to current actual service condition, most of occasion is not high to the requirement of voice quality, and this just needs a kind of, process easier, versatility high and with low cost embedded system platform speech playing method lower to hardware requirement badly.
Summary of the invention
Technical matters to be solved by this invention is: for prior art Problems existing, proposes a kind of simple and easy speech playing method being applied to embedded system platform, can reduce processor occupancy, reduce the requirement to processor.
The technical scheme that the present invention solves its technical matters is as follows:
A kind of simple and easy speech playing method being applied to embedded system platform, it is characterized in that, be applied to the embedded system platform language play back system containing processor, FLASH memory, RAM storer, D/A converter, note amplifier and loudspeaker, described processor is connected with FLASH memory, RAM memory data respectively, described processor and D/A converter data cube computation, described D/A converter is connected with speaker data through note amplifier;
Described speech playing method comprises the following steps:
The first step, target text is converted to 8KHz sampling rate, 16Bit, the uncompressed pcm encoder formatted file of monaural standard, the WAV formatted file namely containing file header and sampled data, the reference position containing sampled data in described file header and length; Then this WAV formatted file is put into FLASH memory, pending device calls;
Second step, described processor find corresponding WAV formatted file according to instruction in FLASH memory, and call in RAM storer by the file header of this WAV formatted file; Described processor knows sampled data reference position and length by the file header reading this WAV formatted file, and the sampled data of this WAV formatted file is directly sent to D/A converter by DMA transmission mode by processor from FLASH memory;
3rd step, described D/A converter are sent to note amplifier after sampled data described in second step is carried out digital-to-analog conversion and are processed, and are play by loudspeaker.
The major technique design of technique scheme is as follows:
Applicant thinks, to reduce processor occupancy, adopting special voice recording and playback ic or chipspeech then can cause undoubtedly with high costs, can only look for another way in software.Applicant finds after in depth practical studies, without the need to the feature of decoding when utilizing WAV formatted file to play, should be able to effectively reduce processor occupancy, simultaneously 8KHz sampling rate, 16Bit, monaural WAV formatted file not only can meet the needs of most of occasion completely in voice quality, and its file size is also in tolerance interval; In addition DMA transmission technology is adopted can to reduce the occupancy of processor further.Based on this important discovery, applicant has finally drawn the technical scheme of above-mentioned optimization organic assembling after further practical studies, can effectively reduce processor occupancy, reduces the hardware cost of embedded system platform.
Preferably, also comprise voice and merge broadcast multiple segments voice separately process:
In a first step, if there is the WAV formatted file that multiple playout length is less than predetermined value, then with one of them WAV formatted file for reference file, the end that sampled data in all the other WAV formatted files is added on this reference file is successively formed new file, the title of each sampled data of adding, starting location offset are formed data block together with lengths sets simultaneously, then this data block is added into the end of new file, is formed and merge WAV formatted file; Containing merged file identifier in the file header of described merging WAV formatted file; This merging WAV formatted file is put into FLASH memory, and pending device calls;
In second step, by reading the merged file identifier merging WAV formatted file file header, processor knows that this file is for merging WAV formatted file, then the data block of this merging WAV formatted file end to be read in RAM storer and is found starting location offset and the length of destination sample data by title by processor, and then destination sample data are sent to D/A converter with DMA transmission mode by processor.
Audio file volume can be reduced further like this, save storage space.
Preferably, in the first step, first target text is converted to MP3 format audio file, then this MP3 format audio file is converted to WAV formatted file.Completely so existing switching software can be utilized can to obtain the WAV formatted file corresponding with target text, not need to develop new switching software again.
Preferably, in second step, processor is before sending to D/A converter by sampled data, first judge whether sampled data length is greater than DMA and transmits maximum single transmission length, if then sampled data is sent to D/A converter with interrupt mode by processor in batches, then sampled data is directly sent to D/A converter by processor if not.
More preferably, in second step, processor has the I2S module containing register, and processor first by sampled data reference position and length write I2S module register, and then starts DMA transmission; If sampled data length is greater than DMA and transmits maximum single and send length, then processor transmits in batches with interrupt mode, and during each transmission, processor is first by this reference position of sampled data and length write I2S module register, then starts this DMA and transmit.
Can farthest make good use of DMA transmission technology like this, reduce the workload of processor as far as possible.
Preferably, described processor is MCU.
After adopting the inventive method, can effectively reduce processor occupancy, reduce the requirement to processor, save the hardware cost of embedded system platform language play back system.
Accompanying drawing explanation
Fig. 1 is the hardware composition schematic diagram of the embodiment of the present invention.
Fig. 2 is the main process schematic diagram of Fig. 1 embodiment.
Embodiment
With reference to the accompanying drawings and the present invention is described in further detail in conjunction with the embodiments.But the invention is not restricted to given example.
Embodiment
The present embodiment is applied to the simple and easy speech playing method of embedded system platform, be applied to the embedded system platform language play back system (as shown in Figure 1) containing processor (as MCU), FLASH memory, RAM storer, D/A converter, note amplifier and loudspeaker, processor is connected with FLASH memory, RAM memory data respectively, processor and D/A converter data cube computation, D/A converter is connected with speaker data through note amplifier.
As shown in Figure 2, speech playing method comprises the following steps:
The first step, first target text is converted to MP3 format audio file, this MP3 format audio file is converted to 8KHz sampling rate, 16Bit, the uncompressed pcm encoder formatted file of monaural standard again, namely the WAV formatted file of file header and sampled data is contained, the reference position containing sampled data in file header and length; Then this WAV formatted file is put into FLASH memory, pending device calls;
Second step, processor find corresponding WAV formatted file according to instruction in FLASH memory, and call in RAM storer by the file header of this WAV formatted file; Processor knows sampled data reference position and length by the file header reading this WAV formatted file, and the sampled data of this WAV formatted file is directly sent to D/A converter by DMA transmission mode by processor from FLASH memory;
Specifically, processor is before sending to D/A converter by sampled data, first judge whether sampled data length is greater than DMA and transmits maximum single transmission length, if then sampled data is sent to D/A converter with interrupt mode by processor in batches, then sampled data is directly sent to D/A converter by processor if not.
Situation is more specifically: processor has the I2S module containing register, and processor first by sampled data reference position and length write I2S module register, and then starts DMA transmission; If sampled data length is greater than DMA and transmits maximum single and send length, then processor transmits in batches with interrupt mode, and during each transmission, processor is first by this reference position of sampled data and length write I2S module register, then starts this DMA and transmit.
3rd step, described D/A converter are sent to note amplifier after sampled data described in second step is carried out digital-to-analog conversion and are processed, and are play by loudspeaker.
Said method also comprises voice and merges broadcast multiple segments voice separately process:
In a first step, if there is the WAV formatted file that multiple playout length is less than predetermined value, then with one of them WAV formatted file for reference file, the end that sampled data in all the other WAV formatted files is added on this reference file is successively formed new file, the title of each sampled data of adding, starting location offset are formed data block together with lengths sets simultaneously, then this data block is added into the end of new file, is formed and merge WAV formatted file; Containing merged file identifier in the file header of described merging WAV formatted file; This merging WAV formatted file is put into FLASH memory, and pending device calls;
In second step, by reading the merged file identifier merging WAV formatted file file header, processor knows that this file is for merging WAV formatted file, then the data block of this merging WAV formatted file end to be read in RAM storer and is found starting location offset and the length of destination sample data by title by processor, and then destination sample data are sent to D/A converter with DMA transmission mode by processor.
In addition to the implementation, the present invention can also have other embodiments.All employings are equal to the technical scheme of replacement or equivalent transformation formation, all drop on the protection domain of application claims.
Claims (5)
1. one kind is applied to the simple and easy speech playing method of embedded system platform, it is characterized in that, be applied to the embedded system platform language play back system containing processor, FLASH memory, RAM storer, D/A converter, note amplifier and loudspeaker, described processor is connected with FLASH memory, RAM memory data respectively, described processor and D/A converter data cube computation, described D/A converter is connected with speaker data through note amplifier;
Described speech playing method comprises the following steps:
The first step, target text is converted to 8KHz sampling rate, 16Bit, the uncompressed pcm encoder formatted file of monaural standard, the WAV formatted file namely containing file header and sampled data, the reference position containing sampled data in described file header and length; Then this WAV formatted file is put into FLASH memory, pending device calls;
Second step, described processor find corresponding WAV formatted file according to instruction in FLASH memory, and call in RAM storer by the file header of this WAV formatted file; Described processor knows sampled data reference position and length by the file header reading this WAV formatted file, and the sampled data of this WAV formatted file is directly sent to D/A converter by DMA transmission mode by processor from FLASH memory;
3rd step, described D/A converter are sent to note amplifier after sampled data described in second step is carried out digital-to-analog conversion and are processed, and play eventually through loudspeaker;
Also comprise voice and merge broadcast multiple segments voice separately process:
In a first step, if there is the WAV formatted file that multiple playout length is less than predetermined value, then with one of them WAV formatted file for reference file, the end that sampled data in all the other WAV formatted files is added on this reference file is successively formed new file, the title of each sampled data of adding, starting location offset are formed data block together with lengths sets simultaneously, then this data block is added into the end of new file, is formed and merge WAV formatted file; Containing merged file identifier in the file header of described merging WAV formatted file; This merging WAV formatted file is put into FLASH memory, and pending device calls;
In second step, by reading the merged file identifier merging WAV formatted file file header, processor knows that this file is for merging WAV formatted file, then the data block of this merging WAV formatted file end to be read in RAM storer and is found starting location offset and the length of destination sample data by title by processor, and then destination sample data are sent to D/A converter with DMA transmission mode by processor.
2. be applied to the simple and easy speech playing method of embedded system platform according to claim 1, it is characterized in that, in the first step, first target text is converted to MP3 format audio file, then this MP3 format audio file is converted to WAV formatted file.
3. be applied to the simple and easy speech playing method of embedded system platform according to claim 2, it is characterized in that, in second step, processor is before sending to D/A converter by sampled data, first judge whether sampled data length is greater than DMA and transmits maximum single transmission length, if then sampled data is sent to D/A converter with interrupt mode by processor in batches, then sampled data is directly sent to D/A converter by processor if not.
4. be applied to the simple and easy speech playing method of embedded system platform according to claim 3, it is characterized in that, in second step, processor has the I2S module containing register, processor first by sampled data reference position and length write I2S module register, and then starts DMA transmission; If sampled data length is greater than DMA and transmits maximum single and send length, then processor transmits in batches with interrupt mode, and during each transmission, processor is first by this reference position of sampled data and length write I2S module register, then starts this DMA and transmit.
5. be applied to the simple and easy speech playing method of embedded system platform according to claim 4, it is characterized in that, described processor is MCU.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310460892.9A CN103531224B (en) | 2013-09-30 | 2013-09-30 | Be applied to the simple and easy speech playing method of embedded system platform |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310460892.9A CN103531224B (en) | 2013-09-30 | 2013-09-30 | Be applied to the simple and easy speech playing method of embedded system platform |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103531224A CN103531224A (en) | 2014-01-22 |
CN103531224B true CN103531224B (en) | 2016-03-09 |
Family
ID=49933171
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310460892.9A Active CN103531224B (en) | 2013-09-30 | 2013-09-30 | Be applied to the simple and easy speech playing method of embedded system platform |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103531224B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107391080A (en) * | 2017-07-25 | 2017-11-24 | 青岛海信电器股份有限公司 | Master chip, ADAS based on ZYNQ and the method using its progress voice message |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110853676B (en) * | 2019-11-18 | 2023-06-09 | 广州国音智能科技有限公司 | Audio comparison method, device and equipment |
CN112597332A (en) * | 2020-12-29 | 2021-04-02 | 深圳贝特莱电子科技股份有限公司 | Voice playing method and device embedded in MCU |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1397458A (en) * | 2001-07-23 | 2003-02-19 | 蔡宁 | Multi-language MP3 device for reporting bus stop |
CN101958139A (en) * | 2010-08-10 | 2011-01-26 | 闫天时 | High definition lossless audio playing (HDAP) system |
CN202145381U (en) * | 2011-06-16 | 2012-02-15 | 无锡硅动力微电子股份有限公司 | Record and playback device used in vehicle-mounted sound and miniature player |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100664961B1 (en) * | 2005-09-29 | 2007-01-04 | 삼성전자주식회사 | Mobile device for supporting multi-audio output |
-
2013
- 2013-09-30 CN CN201310460892.9A patent/CN103531224B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1397458A (en) * | 2001-07-23 | 2003-02-19 | 蔡宁 | Multi-language MP3 device for reporting bus stop |
CN101958139A (en) * | 2010-08-10 | 2011-01-26 | 闫天时 | High definition lossless audio playing (HDAP) system |
CN202145381U (en) * | 2011-06-16 | 2012-02-15 | 无锡硅动力微电子股份有限公司 | Record and playback device used in vehicle-mounted sound and miniature player |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107391080A (en) * | 2017-07-25 | 2017-11-24 | 青岛海信电器股份有限公司 | Master chip, ADAS based on ZYNQ and the method using its progress voice message |
Also Published As
Publication number | Publication date |
---|---|
CN103531224A (en) | 2014-01-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101094445B (en) | System and method for implementing playing back voice of text, and short message | |
CN104078044A (en) | Mobile terminal and sound recording search method and device of mobile terminal | |
US11587560B2 (en) | Voice interaction method, device, apparatus and server | |
CN202189551U (en) | Speech rapid translation equipment | |
CN103531224B (en) | Be applied to the simple and easy speech playing method of embedded system platform | |
CN103117825A (en) | Method and device of dialect broadcasting of mobile terminal | |
CN103049192A (en) | Method and device for opening application programs | |
CN104330810A (en) | Beidou multimode navigation car networking terminal and design method based on SOC | |
CN201532764U (en) | Vehicle-mounted sound-control wireless broadband network audio player | |
US20120165043A1 (en) | Mobile communication based tagging | |
CN102857833A (en) | Audio decoding system and method adapted to android stagefright multimedia framework | |
CN202145381U (en) | Record and playback device used in vehicle-mounted sound and miniature player | |
CN104835491A (en) | Multiple-transmission-mode text-to-speech (TTS) system and method | |
CN201134257Y (en) | On-vehicle DVD system | |
CN106803426A (en) | Audio files storage method and system | |
WO2022135105A1 (en) | Video dubbing method and apparatus for functional machine, terminal device and storage medium | |
CN101924755A (en) | A kind of method and system of updating broadcast voice of voice broadcasting terminal | |
CN200997288Y (en) | Phonetic reporting musical playing system | |
CN102664028A (en) | Method for converting input analog signal to sound card into output digital signal | |
CN2922042Y (en) | DVD player with audio processing system | |
CN207977110U (en) | Electronic equipment mainboard and electronic equipment | |
CN202008840U (en) | Voice recording system | |
CN101902527A (en) | Recording method and device with mobile terminal | |
CN100483332C (en) | Character and language synchronizing method and synchronizer | |
CN201532773U (en) | Player used for vehicle-mounted acoustics or mini acoustics |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
PP01 | Preservation of patent right |
Effective date of registration: 20240204 Granted publication date: 20160309 |
|
PP01 | Preservation of patent right |