Voice playing method and device
By using pre-recorded PCM format audio data files in the ADAS system and directly transmitting them to the voice module for playback, the problem of CPU audio decoding consuming resources is solved, and the real-time performance and security of the system are improved.
Patent Information
- Application Number
- CN201910854865.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-09-10
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2039-09-10
AI Technical Summary
When existing advanced driver assistance systems (ADAS) provide voice prompts, the CPU needs to perform audio decoding processing, which consumes resources and affects the system's real-time performance and safety.
Pre-recorded PCM format audio data files are used and directly transmitted to the voice module for playback via the DMA module, avoiding audio decoding processing by the CPU.
Saves CPU resources and improves the real-time performance and security of ADAS systems.
Smart Images

Figure CN112562755B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of driving assistance, in particular to a voice playing method and device. BACKGROUND
[0002] Advanced Driving Assistant System (ADAS) is to use various sensors (such as millimeter wave radar, laser radar, single\double camera and satellite navigation) installed on the car to sense the environment around the car at any time during driving, collect data, identify, detect and track static and dynamic objects, combine with navigation map data, and perform system operation and analysis to give voice prompts to the driver, so as to make the driver aware of possible situations in advance, effectively increase the comfort and safety of car driving. SUMMARY
[0003] The embodiment of the present application provides a voice playing method and device to give voice prompts.
[0004] The embodiment of the present application provides a voice playing method, comprising:
[0005] The DMA module receives a prompt tone broadcast instruction;
[0006] The DMA module selects a PCM format data file corresponding to the prompt tone broadcast instruction from the audio data file stored in the storage module, and transmits the selected PCM format data file to the voice module, so that the voice module plays the corresponding prompt tone; wherein the audio data file stored in the storage module is pre-recorded, and the audio data file includes: a plurality of PCM format data files corresponding to different prompt tones; one prompt tone corresponds to one prompt tone broadcast instruction.
[0007] Optionally, in the embodiment of the present application, the transmission of the selected PCM format data file to the voice module comprises:
[0008] The selected PCM format data file is transmitted to the I2S bus and cached through the I2S bus, and then transmitted to the voice module through the power amplification module.
[0009] Optionally, in the embodiment of the present application, before the DMA module selects the PCM format data file corresponding to the prompt tone broadcast instruction from the audio data file stored in the storage module, the method further comprises:
[0010] The storage module, the I2S bus and the power amplification module are initialized.
[0011] Optionally, in the embodiment of the present application, the method for storing the pre-recorded audio data file comprises:
[0012] recording a plurality of PCM format data files corresponding to different prompt tones; wherein each of the PCM format data files comprises a left channel and a right channel;
[0013] compressing all the recorded PCM format data files and storing the compressed PCM format data files;
[0014] decompressing the stored compressed PCM format data files into the storage module and storing the decompressed PCM format data files when the storage module is initialized.
[0015] The embodiment of the present application also provides a voice playing device, comprising:
[0016] a storage module for storing pre-recorded audio data files; wherein the audio data files comprise a plurality of PCM format data files corresponding to different prompt tones;
[0017] a DMA module for receiving a prompt tone broadcasting instruction, selecting a PCM format data file corresponding to the prompt tone broadcasting instruction from the audio data files, and transmitting the selected PCM format data file to a voice module; wherein one prompt tone corresponds to one prompt tone broadcasting instruction;
[0018] the voice module for receiving the PCM format data file output by the DMA module and playing a corresponding prompt tone according to the received PCM format data file.
[0019] Optionally, in the embodiment of the present application, the voice playing system further comprises an I2S bus and a power amplification module.
[0020] the DMA module for transmitting the selected PCM format data file to the I2S bus;
[0021] the I2S bus for receiving and buffering the PCM format data file transmitted by the DMA module, and transmitting the buffered PCM format data file to the voice module through the power amplification module.
[0022] Optionally, in the embodiment of the present application, the storage module is further used for initialization before the DMA module receives the prompt tone broadcasting instruction.
[0023] the I2S bus is further used for initialization before the DMA module receives the prompt tone broadcasting instruction.
[0024] The power amplification module is also configured to initialize before the DMA module receives the prompt tone broadcasting instruction.
[0025] The embodiment of the present application also provides a driving assistance system, which comprises the voice playing device.
[0026] The embodiment of the present application also provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor to realize the steps of the voice playing method.
[0027] The embodiment of the present application also provides a computer device, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor executes the program to realize the steps of the voice playing method.
[0028] The embodiment of the present application has the following advantages:
[0029] The voice playing method and device provided by the embodiment of the present application, since the storage module stores the pre-recorded audio data file, the audio data file can comprise the PCM format data file corresponding to a plurality of different prompt tones. Thus, after the DMA module receives the prompt tone broadcasting instruction, the PCM format data file corresponding to the prompt tone broadcasting instruction can be directly selected from the audio data file according to the prompt tone broadcasting instruction, and the selected PCM format data file is transmitted to the voice module, so that the voice module plays the corresponding prompt tone. Thus, the steps of selecting the MP3 or WAV format audio file and decoding the MP3 or WAV format audio file into the PCM format data file can be omitted. When the voice playing method or system is applied to the ADAS system, the CPU in the ADAS system no longer needs to perform the audio decoding processing, so that the CPU resource is saved, and the real-time performance and safety of the ADAS system are improved. BRIEF DESCRIPTION OF DRAWINGS
[0030] Figure 1 The flow chart of the voice playing method provided by the embodiment of the present application is shown in the figure.
[0031] Figure 2 The specific flow chart of the voice playing method provided by the embodiment of the present application is shown in the figure.
[0032] Figure 3 The structure schematic diagram of the voice playing device provided by the embodiment of the present application is shown in the figure. DETAILED DESCRIPTION
[0033] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions of the embodiments of the present application will be described clearly and completely below with reference to the drawings of the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments of the present application. And the embodiments in the present application and the features in the embodiments can be combined with each other without conflict, if possible. Based on the described embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort belong to the scope of protection of the present application.
[0034] Unless otherwise defined, technical terms or scientific terms used in the present application shall have the ordinary meaning understood by a person of ordinary skill in the art to which the present application pertains. The terms "first", "second" and similar terms used in the present application do not denote any order, quantity or importance, but are used to distinguish different components. The terms "include" or "contain" and similar terms mean that the elements or objects before the terms encompass the elements or objects listed after the terms and their equivalents, and do not exclude other elements or objects. The terms "connect" or "connected" and similar terms are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect.
[0035] It should be noted that the sizes and shapes of the figures in the drawings do not reflect the true proportions, but only serve to illustrate the content of the present application. And the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions throughout the drawings.
[0036] The general voice playing device includes a CPU (Central Processing Unit), an I2C (Inter-Integrated Circuit) bus, an I2S (Inter-IC Sound) bus (i.e. an integrated circuit built-in audio bus), an audio decoding module, a DDR (Double Data Rate Synchronous Dynamic Random-Access Memory) module, a DMA (Direct Memory Access) module, a power amplification module, and a speaker and other hardware units.
[0037] The voice playing device performs voice prompting in the following process: the power amplification module and the I2S bus are configured through the I2C bus, then the CPU reads an audio file in MP3 or WAV format from a file system, then the audio decoding module is controlled by the CPU to decode the audio file in MP3 or WAV format into a data file in PCM format and store the data file in the DDR module, then the data file in PCM format is transmitted to the cache of the I2S bus through the DMA module, then the power amplification module transmits the data file to the loudspeaker, and finally the sound is emitted from the loudspeaker. However, when the audio decoding module decodes the audio file in MP3 or WAV format, part of the resources of the CPU is occupied. Since the ADAS system itself has high real-time requirements, more CPU resources need to be left for video processing and analysis algorithms, otherwise the real-time performance of the ADAS system may be reduced, and the safety may be reduced.
[0038] Therefore, the embodiment of the present application provides a voice playing method, as shown in the figure, which can include the following steps: Figure 1
[0039] S101, the DMA module receives a prompt sound broadcasting instruction.
[0040] S102, the DMA module selects a data file in PCM format corresponding to the prompt sound broadcasting instruction from the audio data file stored in the storage module, and transmits the selected data file in PCM format to the voice module, so that the voice module plays the corresponding prompt sound; wherein the audio data file stored in the storage module is pre-recorded, and the audio data file includes a plurality of data files in PCM format corresponding to different prompt sounds; one prompt sound corresponds to one prompt sound broadcasting instruction.
[0041] The voice playing method provided by the embodiment of the present application, since the storage module stores pre-recorded audio data files, the audio data files can include a plurality of data files in PCM format corresponding to different prompt sounds. Thus, after the DMA module receives the prompt sound broadcasting instruction, the data file in PCM format corresponding to the prompt sound broadcasting instruction can be directly selected from the audio data file according to the prompt sound broadcasting instruction, and the selected data file in PCM format is transmitted to the voice module, so that the voice module plays the corresponding prompt sound. Thus, the steps of selecting the audio file in MP3 or WAV format and decoding the audio file in MP3 or WAV format into a data file in PCM format can be omitted. When the voice playing method is applied to the ADAS system, the CPU in the ADAS system no longer needs to perform audio decoding processing, thereby saving the resources of the CPU and improving the real-time performance and safety of the ADAS system.
[0042] In a specific implementation, in the embodiment of the present application, the data file in the selected PCM format is transmitted to the voice module, which can include:
[0043] The data file in the selected PCM format is transmitted to the I2S bus and cached through the I2S bus, and then transmitted to the voice module through the power amplification module.
[0044] In a specific implementation, in the embodiment of the present application, the voice module can include a loudspeaker.
[0045] In a specific implementation, in the embodiment of the present application, before the DMA module selects the data file in the PCM format corresponding to the prompt tone broadcast instruction from the audio data file stored in the storage module, the storage module, the I2S bus and the power amplification module can also be initialized. Further, the ADAS system can initialize the storage module, the I2S bus and the power amplification module through the I2C bus respectively. Further, before initializing the storage module, the I2S bus and the power amplification module, the I2C bus is also initialized.
[0046] In a specific implementation, in the embodiment of the present application, each of the above modules can be in the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. For example, the power amplification module can include a power amplifier. In actual application, the structure and working principle of the power amplifier can be basically the same as that in the prior art, which is not limited here.
[0047] In a specific implementation, in the embodiment of the present application, before the DMA module receives the prompt tone broadcast instruction, the processing threads corresponding to different prompt tones set in advance can also be initialized. Different prompt tones set different processing threads. For example, a processing thread is set for the prompt tone corresponding to the early warning message, and another processing thread is set for the prompt tone corresponding to the volume adjustment (increasing or decreasing the volume), so as to avoid mutual interference between the two threads.
[0048] In a specific implementation, in the embodiment of the present application, the method for storing the pre-recorded audio data file in the storage module can include:
[0049] Record a plurality of data files in the PCM format corresponding to different prompt tones; wherein each data file in the PCM format contains a left channel and a right channel;
[0050] Compress all the recorded data files in the PCM format, and store them after compression; wherein a compression algorithm such as quick-lz can be used to compress the data files in the PCM format, and the compressed files can be copied to the root file system of the ADAS system;
[0051] When the storage module is initialized, the compressed PCM format data file is decompressed and stored in the storage module.
[0052] The voice playing method provided by the embodiment of the application will be described below through specific examples. However, the specific process is not limited to this.
[0053] In combination with Figure 2 The voice playing method provided by the embodiment of the application can include the following steps.
[0054] S201, initializing the I2C bus. Specifically, the register of the I2C bus is accessed through the MMAP function to initialize the I2C bus.
[0055] S202, initializing the storage module, the I2S bus and the power amplifier module through the I2C bus.
[0056] Specifically, the register of the I2S bus is driven to read and write through the I2C bus to initialize the I2S bus. The data bit width, transmission frequency and other parameters of the I2S bus are mainly configured.
[0057] Specifically, the register of the power amplifier module is driven to read and write through the I2C bus to initialize the power amplifier module. The volume output, sound channel and other parameters of the power amplifier module are mainly configured.
[0058] Specifically, the compressed PCM format data file is decompressed to the storage module (i.e. the specified location of the memory), and the PCM format data file is mapped to the broadcast message corresponding to the prompt tone. The storage module can be a continuous memory space that has been initialized when the ADAS system is started.
[0059] S203, the DMA module receives the prompt tone broadcast instruction.
[0060] S204, the DMA module selects the PCM format data file corresponding to the prompt tone broadcast instruction from the pre-recorded audio data file stored in the storage module according to the prompt tone broadcast instruction, and transmits the selected PCM format data file to the I2S bus and to the power amplifier through the I2S bus buffer to the loudspeaker, so that the loudspeaker plays the corresponding prompt tone.
[0061] Specifically, the DMA module enables the power amplifier and the loudspeaker according to the prompt tone broadcast instruction. Then, the DMA module is enabled and the related parameters (such as the source address and the target address) of the DMA module are configured. Then, the selected PCM format data file is transmitted to the I2S bus and to the power amplifier through the I2S bus buffer to the loudspeaker, so that the loudspeaker plays the corresponding prompt tone.
[0062] Based on the same inventive concept, the embodiment of the present application also provides a voice playing device, as shown in the accompanying drawings, comprising: Figure 3
[0063] a storage module 301, configured to store a pre-recorded audio data file; wherein the audio data file comprises a plurality of PCM format data files corresponding to different prompt tones;
[0064] a DMA module 302, configured to receive a prompt tone broadcasting instruction, and select a PCM format data file corresponding to the prompt tone broadcasting instruction from the audio data file, and transmit the selected PCM format data file to a voice module 303; wherein one prompt tone corresponds to one prompt tone broadcasting instruction;
[0065] the voice module 303, configured to receive the PCM format data file output by the DMA module 302, and play a corresponding prompt tone according to the received PCM format data file.
[0066] The voice playing device provided by the embodiment of the present application has the pre-recorded audio data file stored in the storage module, and the audio data file can comprise a plurality of PCM format data files corresponding to different prompt tones. Thus, after the DMA module receives the prompt tone broadcasting instruction, the PCM format data file corresponding to the prompt tone broadcasting instruction can be directly selected from the audio data file according to the prompt tone broadcasting instruction, and the selected PCM format data file is transmitted to the voice module, so that the voice module can play the corresponding prompt tone. Thus, the steps of selecting the MP3 or WAV format audio file and decoding the MP3 or WAV format audio file into the PCM format data file can be omitted. When the voice playing device is applied to the ADAS system, the CPU in the ADAS system no longer needs to perform the audio decoding processing, thereby saving the CPU resources and improving the real-time performance and safety of the ADAS system.
[0067] In the embodiment of the present application, the voice playing system further comprises an I2S bus and a power amplification module; wherein the DMA module is configured to transmit the selected PCM format data file to the I2S bus. The I2S bus is configured to receive and buffer the PCM format data file transmitted by the DMA module, and then transmit the buffered PCM format data file to the voice module through the power amplification module.
[0068] In the embodiment of the present application, the storage module is further configured to initialize before the DMA module receives the prompt tone broadcasting instruction.
[0069] In a specific implementation, in the embodiment of the present application, the I2S bus is also used to initialize before the DMA module receives the prompt tone broadcasting instruction.
[0070] In a specific implementation, in the embodiment of the present application, the power amplification module is also used to initialize before the DMA module receives the prompt tone broadcasting instruction.
[0071] Based on the same inventive concept, the embodiment of the present application also provides a driving assistance system comprising the voice playing device. The driving assistance system solves the problem in the same principle as the voice playing device, and therefore the implementation of the driving assistance system can be referred to the implementation of the voice playing device, and the repeated parts will not be described here.
[0072] In a specific implementation, in the embodiment of the present application, the driving assistance system can be an ADAS system.
[0073] Based on the same inventive concept, the embodiment of the present application also provides a computer readable storage medium having a computer program stored thereon, and the program is executed by a processor to implement the steps of the voice playing method provided by the embodiment of the present application. Specifically, the present application can adopt the form of a computer program product implemented on one or more computer usable storage media (including but not limited to magnetic disk storage and optical storage, etc.) containing computer usable program codes.
[0074] Based on the same inventive concept, the embodiment of the present application also provides a computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor executes the program to implement the steps of the voice playing method provided by the embodiment of the present application.
[0075] The voice playing method and device provided by the embodiment of the present application, since the storage module stores the pre-recorded audio data file, the audio data file can include a plurality of PCM format data files corresponding to different prompt tones. Thus, after the DMA module receives the prompt tone broadcasting instruction, the PCM format data file corresponding to the prompt tone broadcasting instruction can be directly selected from the audio data file according to the prompt tone broadcasting instruction, and the selected PCM format data file is transmitted to the voice module, so that the voice module plays the corresponding prompt tone. In this way, the steps of selecting the MP3 or WAV format audio file and decoding the MP3 or WAV format audio file into the PCM format data file can be omitted. When the voice playing method or system is applied to the ADAS system, the CPU in the ADAS system no longer needs to perform the audio decoding processing, thereby saving the CPU resources and improving the real-time performance and safety of the ADAS system.
[0076] Obviously, many modifications and variations of the present application are possible in light of the above teachings. It is, therefore, to be understood that within the scope of the appended claims and their equivalents, the application can be practiced otherwise than as specifically described.
Claims
1. A voice playback method, characterized in that, include: Initialize the processing threads corresponding to the different preset prompt sounds, and set different processing threads for different prompt sounds; The DMA module receives the prompt tone broadcast command; The DMA module selects a PCM format data file corresponding to the prompt tone broadcast command from the audio data files stored in the storage module, and transmits the selected PCM format data file to the voice module, causing the voice module to play the corresponding prompt tone; wherein, the audio data files stored in the storage module are pre-recorded, and the audio data files include: multiple PCM format data files corresponding to different prompt tones; one prompt tone corresponds to one prompt tone broadcast command; The storage module stores pre-recorded audio data files in the following manner: Record multiple PCM format data files corresponding to different prompt sounds; wherein each PCM format data file includes a left channel and a right channel; All recorded PCM format data files are compressed and then stored. During the initialization of the storage module, the compressed PCM format data file is decompressed and stored in the storage module.
2. The voice playback method as described in claim 1, characterized in that, The step of transmitting the selected PCM format data file to the voice module includes: The selected PCM format data file is transmitted to the I2S bus and then, after being buffered by the I2S bus, is transmitted to the voice module through the power amplifier module.
3. The voice playback method as described in claim 2, characterized in that, Before the DMA module selects the PCM format data file corresponding to the prompt tone broadcast command from the audio data file stored in the storage module, the method further includes: The storage module, the I2S bus, and the power amplifier module are initialized.
4. A voice playback device, characterized in that, include: A storage module is used to store pre-recorded audio data files; wherein, the audio data files include: PCM format data files corresponding to multiple different prompt tones; The DMA module is used to initialize the processing threads corresponding to different preset prompt tones, with different processing threads set for different prompt tones; it receives prompt tone broadcast instructions, selects a PCM format data file corresponding to the prompt tone broadcast instruction from the audio data file, and transmits the selected PCM format data file to the voice module; wherein, one prompt tone corresponds to one prompt tone broadcast instruction; The voice module is used to receive the PCM format data file output by the DMA module and play the corresponding prompt tone according to the received PCM format data file; The storage module is also used to store pre-recorded audio data files in the following ways: Record multiple PCM format data files corresponding to different prompt sounds; wherein each PCM format data file includes a left channel and a right channel; All recorded PCM format data files are compressed and then stored. During the initialization of the storage module, the compressed PCM format data file is decompressed and stored in the storage module.
5. The voice playback device as described in claim 4, characterized in that, The voice playback device also includes: an I2S bus and a power amplifier module; The DMA module is used to transfer the selected PCM format data file to the I2S bus; The I2S bus is used to receive and cache the PCM format data file transmitted by the DMA module, and then transmit the cached PCM format data file to the voice module through the power amplifier module.
6. The voice playback device as described in claim 5, characterized in that, The storage module is also used to initialize the DMA module before it receives the prompt tone broadcast instruction; The I2S bus is also used to initialize the DMA module before it receives the prompt tone broadcast command. The power amplifier module is also used to initialize the DMA module before it receives the prompt tone broadcast command.
7. A driving assistance system, characterized in that, Includes the voice playback device as described in any one of claims 4-6.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the voice playback method according to any one of claims 1-3.
9. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the voice playback method according to any one of claims 1-3.
Citation Information
Patent Citations
Master chip based on ZYNQ, ADAS and method for utilizing ADAS to conduct voice prompt
CN107391080A
Method and system for storing audio file
WO2018103420A1