Voice broadcasting method and device, electronic equipment and storage medium
The voice broadcasting method, which uses a microcontroller audio interface and decoder, solves the problems of complex processes and low efficiency in traditional voice output solutions. It reduces hardware costs and improves broadcasting efficiency, while supporting flexible voice file management and rapid response.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-31
- Publication Date
- 2026-03-27
AI Technical Summary
Traditional voice output solutions are complex and inefficient in the manufacturing process, have high maintenance and upgrade costs, and are slow to respond, making them difficult to adapt to the rapid iteration and flexible production needs of modern electronic products.
It adopts an architecture of microcontroller audio interface, memory, amplifier chip and speaker. The microcontroller obtains voice files from external storage devices, decodes and adjusts the volume using a decoder, generates PCM data and converts it into PWM signal through the audio interface, and directly outputs voice, omitting the communication link of dedicated voice chip.
It simplifies the production process, reduces hardware costs and circuit board space usage, improves the efficiency of voice file playback and microcontroller resource utilization, and supports flexible voice file updates and multilingual management.
Smart Images

Figure CN121747586A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of voice broadcast, in particular to a voice broadcast method and device, electronic equipment and storage medium. BACKGROUND
[0002] In the traditional voice output scheme, the architecture of "microcontroller serial port + memory + dedicated voice chip + voice storage chip + amplification chip + speaker" is usually adopted. Specifically, the program in the memory is run by the microcontroller, and the communication with a voice chip is performed through the serial port. The dedicated voice chip is responsible for driving an external voice storage chip, decoding audio data, and finally driving the speaker to complete the output of sound through the audio amplification chip.
[0003] In the production and manufacturing link, the traditional scheme has significant process complexity and efficiency bottleneck. First, the compiled voice file needs to be burned into the voice storage chip separately. In the product development and small batch trial production stage, this process usually relies on an offline burner to burn the chip one by one, which is tedious and time-consuming. Even if it enters the mass production stage, the FLASH (Flash Memory) chip manufacturer can burn the voice file before shipment, but this still lacks flexibility. Once the product is on the market and needs to update the voice content, the product must be returned or the technician re-burns the storage chip using the offline burner, which has high maintenance and upgrade costs. At the application level, the scheme sends simple control instructions to the voice chip through the serial port of the MCU (Microcontroller Unit), and the voice chip reads data from the storage chip and decodes and plays it, which is slow in response and difficult to debug.
[0004] Therefore, how to simplify the production process and improve the broadcast efficiency of voice files is a technical problem that needs to be solved by those skilled in the art. SUMMARY
[0005] The present application provides a voice broadcast method, device, electronic equipment and storage medium to simplify the production process and improve the broadcast efficiency of voice files.
[0006] In a first aspect, the present application provides a voice broadcast method applied to a microcontroller in an electronic device, the voice broadcast method comprising:
[0007] If a voice broadcast request is detected in the message queue, a target voice file corresponding to the voice broadcast request is read from the memory; wherein the voice file in the memory is obtained from an external storage device connected to the electronic device.
[0008] decoding the target voice file through a decoder, and adjusting the decoded data according to the target volume value to obtain target PCM data;
[0009] transmitting the target PCM data to an audio interface, converting the target PCM data into a target PWM signal through the audio interface, outputting the target PWM signal through an RC circuit, an amplification chip and a loudspeaker of the electronic device to realize the playing of the target voice file.
[0010] Optionally, decoding the target voice file through a decoder comprises:
[0011] taking the total number of characters of the target voice file as the value of the remaining character number variable;
[0012] finding a legal frame header from the audio data of the target voice file, and taking the position of the legal frame header as the valid starting position;
[0013] based on the valid starting position, calling a decoder to parse the audio data frame by frame, and updating the value of the remaining character number variable according to the parsed character number;
[0014] if a decoding error is detected and the value of the remaining character number variable is less than 128, determining that the decoding of the target voice file is completed to obtain the decoded data.
[0015] Optionally, finding a legal frame header from the audio data of the target voice file comprises:
[0016] finding an audio data frame header from the current frame of audio data of the target voice file;
[0017] if not found, exiting the decoding and reporting an error; if found, obtaining a target sampling rate from the found audio data frame header;
[0018] determining whether the target sampling rate is a legal sampling rate;
[0019] if yes, determining that the found audio data frame header is a legal frame header; if no, determining that the found audio data frame header is not a legal frame header, and continuing to find an audio data frame header from the next frame of audio data until a legal frame header is found or all audio data is searched.
[0020] Optionally, converting the target PCM data into a target PWM signal through the audio interface comprises:
[0021] The target PCM data is converted into a target PWM signal through an MQS audio interface, and the target PWM signal is smoothed by an RC circuit to output an analog audio signal, so that the analog audio signal is amplified by an amplification chip of the electronic device to obtain a corresponding electrical signal, and the electrical signal is output through a loudspeaker to realize the playing of the target voice file.
[0022] Optionally, if the operating system of the electronic device is an Azure RTOS system, the method further comprises:
[0023] detecting whether there is an unprocessed request in a ThreadX message queue, wherein the unprocessed request is at least one of a volume adjustment request, a voice file import request, a voice file export request, a system language switching request, and an audio playing request;
[0024] if the unprocessed request is the audio playing request, the step of reading the target voice file corresponding to the voice playing request from the memory is performed;
[0025] if the unprocessed request is the volume adjustment request, a volume value carried by the volume adjustment request is taken as the target volume value;
[0026] if the unprocessed request is the voice file import request, a voice file in an external storage device connected to the electronic device is imported into the memory;
[0027] if the unprocessed request is the voice file export request, a voice file in the memory is exported to an external storage device; and if the unprocessed request is the system language switching request, a reading path of a target voice file is changed.
[0028] Optionally, the voice file in the memory is obtained in the following manner:
[0029] based on the Azure RTOS system of the electronic device, a file system and a USBX thread are established, and the USBX thread is used to perform an initialization operation and a thread main action;
[0030] when the USBX thread performs the thread main action, if a U disk connected to the electronic device is detected, a multi-language folder structure is created in the memory of the electronic device according to a target binary file in the U disk; wherein each language folder in the folder structure contains each voice file created by the target binary file.
[0031] Optionally, the voice playing method further comprises:
[0032] An upgrade voice package is acquired through an OTA technology, and a voice file stored in the memory is updated according to the upgrade voice package.
[0033] In a second aspect, the present application provides a voice broadcast device, which is applied to a microcontroller in an electronic device, and comprises:
[0034] A reading module is configured to detect a voice broadcast request in a message queue, and read a target voice file corresponding to the voice broadcast request from a memory, wherein the voice file in the memory is acquired from an external storage device connected to the electronic device.
[0035] A decoding module is configured to decode the target voice file through a decoder, and adjust decoded data according to a target volume value to obtain target PCM data.
[0036] A transmission module is configured to transmit the target PCM data to an audio interface.
[0037] A conversion module is configured to convert the target PCM data into a target PWM signal through the audio interface, so as to output the target PWM signal through an RC circuit, an amplification chip and a loudspeaker of the electronic device, and realize broadcast of the target voice file.
[0038] In a third aspect, the present application provides an electronic device, which comprises a microcontroller, a memory, an RC circuit, an amplification chip and a loudspeaker.
[0039] The memory is configured to store a computer program and a voice file.
[0040] The microcontroller is configured to implement steps of the voice broadcast method when the computer program is executed.
[0041] In a fourth aspect, the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is configured to implement steps of the voice broadcast method when executed by a processor.
[0042] Compared with the prior art, the technical solution provided by the embodiments of the present application has the following advantages: the embodiments of the present application provide a voice broadcast method, device, electronic equipment and storage medium. In the present application, the electronic equipment includes a microcontroller, a memory, an amplification chip and a loudspeaker. Compared with the prior art, the dedicated voice chip and the external voice storage chip are saved, the hardware cost and the circuit board space occupation are significantly reduced, the voice file stored in the memory is obtained from the external storage device, the reprogramming method is not required, the generation process is greatly simplified, and after the microcontroller reads the target voice file from the memory and calls the decoder for decoding, the target PWM signal is output through the audio interface, and the voice is played through the RC circuit, the amplification chip and the loudspeaker of the electronic equipment. The communication link between the microcontroller and the dedicated voice chip is omitted in the whole process, the voice file broadcast efficiency is improved, and the resource use efficiency of the microcontroller is improved. BRIEF DESCRIPTION OF DRAWINGS
[0043] The accompanying drawings, which are incorporated into and form a part of the specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the application.
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced below. Obviously, for those skilled in the art, other drawings can also be obtained from these drawings without any creative labor.
[0045] One or more embodiments are exemplarily illustrated by pictures in the drawings corresponding thereto, and these exemplary illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, unless otherwise specified. The drawings in the drawings do not constitute a proportional limitation.
[0046] Figure 1 A voice broadcast method flowchart is provided for the embodiments of the present application;
[0047] Figure 2 A request management flowchart is provided for the embodiments of the present application;
[0048] Figure 3 A multi-language voice broadcast scheme flowchart based on Azure RTOS is provided for the embodiments of the present application;
[0049] Figure 4 A voice broadcast device structure diagram is provided for the embodiments of the present application;
[0050] Figure 5 An electronic equipment structure diagram is provided for the embodiments of the present application. Detailed Implementation
[0051] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are merely some embodiments of the present application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0052] The following disclosure provides numerous different embodiments or examples for implementing various structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of the invention. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.
[0053] In existing technologies, traditional voice solutions require dedicated voice and storage chips, resulting in high material costs, complex production processes, and difficulties in upgrading and maintenance, making them unsuitable for the rapid iteration and flexible production demands of modern electronic products. With the continuous improvement of microcontroller performance, combined with the thread scheduling and message queuing mechanisms of Azure RTOS (Azure Real-Time Operating System) and the maturity of software decoding technologies such as audio decoders, traditional voice broadcasting solutions now have a more economical and efficient implementation path. Therefore, this application provides a voice broadcasting method, apparatus, electronic device, and storage medium to simplify the production process and improve the broadcasting efficiency of voice files.
[0054] See Figure 1 This is a schematic flowchart of a voice broadcasting method provided in an embodiment of this application. The voice broadcasting method is applied to a microcontroller in an electronic device and includes:
[0055] S101. If a voice broadcast request is detected in the message queue, the target voice file corresponding to the voice broadcast request is read from the memory; wherein the voice file in the memory is obtained from an external storage device connected to the electronic device.
[0056] In the present application, in order to overcome the defects in the traditional voice scheme, the traditional architecture of "microcontroller serial port + memory + dedicated voice chip + voice storage chip + amplification chip + loudspeaker" is changed to the architecture of "microcontroller audio interface + memory + amplification chip + loudspeaker". Specifically, the present application refers to the device for voice broadcast as an electronic device, so that only the microcontroller, memory, amplification chip and loudspeaker in the traditional architecture are contained in the electronic device, and the microcontroller has an audio interface, such as an MQS (Medium Quality Sound, medium quality audio) audio interface.
[0057] In the present application, when the electronic device performs voice broadcast, a voice broadcast request is generated and sent to the message queue; wherein the voice broadcast request can be a voice broadcast request generated after being triggered by a user, or a voice broadcast request automatically generated after meeting a specific requirement, which is not specifically limited here.
[0058] If it is detected that the message queue has a voice broadcast request, the target voice file corresponding to the voice broadcast request needs to be read from the memory of the electronic device. Specifically, the voice broadcast request has identification information of the voice to be played, which is used to determine the target voice file from the storage. The identification information can be a name, a specific identifier, etc., which is not specifically limited here, as long as the corresponding target voice file can be found in the memory.
[0059] And the voice file in the memory in the present application is pre-acquired from an external storage device connected to the electronic device, which can be a U disk, a hard disk, etc.
[0060] S102, decoding the target voice file by a decoder, and adjusting the decoded data according to the target volume value to obtain target PCM data;
[0061] In the present application, the decoder can be a decoding software inside the microcontroller. After determining the target voice file corresponding to the voice broadcast request, the decoder can be called to decode the target voice file, and the decoded data can be adjusted based on the pre-determined target volume value to obtain target PCM (Pulse Code Modulation, pulse code modulation) data.
[0062] The target volume value can be a system default volume value, or a volume value modified by the user through a volume adjustment request, which is not specifically limited here. After the target voice file is decoded by the decoder in the present application, initial PCM data is generated, and then the initial PCM data is adjusted in amplitude according to the target volume value to obtain target PCM data.
[0063] Specifically, the target volume value can be converted into a corresponding decibel amplitude ratio coefficient, and then the initial PCM data is multiplied sample by sample with the ratio coefficient. Through this digital gain control mode, the final target PCM data after volume adjustment can be generated, so as to realize accurate control of the playing volume.
[0064] S103, transmit the target PCM data to the audio interface, and convert the target PCM data into a target PWM signal through the audio interface, so as to output the target PWM signal through the RC circuit, the amplification chip and the loudspeaker of the electronic device, and realize the playing of the target voice file.
[0065] In the present application, after obtaining the target PCM data, the target PCM data needs to be sent to the audio interface, and the target PCM data is converted into a target PWM (Pulse Width Modulation) signal through the audio interface.
[0066] For example, if the audio interface is an MQS audio interface, the hardware circuit of the MQS audio interface will linearly map the value of each PCM sample into a corresponding duty cycle PWM waveform to generate a target PWM signal, thereby realizing the conversion of a digital signal into a pulse width modulation signal.
[0067] Moreover, in the process of transmitting the target PCM data to the audio interface, the system always monitors the voice message queue. If a new voice playing instruction is received at this time, the current transmission process will be immediately interrupted, and the voice playing request with higher priority will be responded to.
[0068] After obtaining the target PWM signal through the audio interface, the corresponding audio can be played by the loudspeaker through the RC (Resistor Capacitor circuit) circuit processing and power amplification in the electronic device.
[0069] As can be seen from the above, in the present application, the electronic device includes a microcontroller, a memory, an amplification chip and a loudspeaker, which saves the dedicated voice chip and the external voice storage chip compared with the prior art, significantly reduces the hardware cost and the circuit board space occupation; and the voice file stored in the memory is obtained from the external storage device without the need for reprogramming, which greatly simplifies the generation process; and when playing the voice, the microcontroller reads the target voice file from the memory and calls the decoder to decode, and then outputs the target PWM signal through the audio interface, and plays the voice through the RC circuit, the amplification chip and the loudspeaker of the electronic device. The whole process omits the communication link between the microcontroller and the dedicated voice chip, improves the playing efficiency of the voice file, and improves the resource utilization efficiency of the microcontroller.
[0070] In another embodiment of the present application, the storage of the voice file is obtained in the following way:
[0071] Based on the Azure RTOS system of the electronic device, a file system and a USBX thread are established, the USBX thread is used to perform an initialization operation and a thread body action; when the USBX thread performs the thread body action, if a U disk connected to the electronic device is detected, a multi-language folder structure is created in the storage of the electronic device according to a target binary file in the U disk; wherein each language folder in the folder structure contains each voice file created by the target binary file.
[0072] In the present application, the operating system of the electronic device can be an Azure RTOS system, which is a real-time operating system and a supporting software development kit specially designed for resource-limited Internet of Things and embedded devices. It is centered on the ThreadX (Thread eXecutive) real-time kernel, and integrates FileX file system (File eXpress), network, USBX (Universal Serial Bus eXpress), graphical interface and other rich middleware components.
[0073] In the present application, the voice file can be a voice file in different national languages, and the number of voice files in each language can be one or more. When the voice files in different languages are imported into the storage, the multi-language voice files need to be packaged into voice binary files in a structured format first, and then the voice binary files are imported into the storage by using USBX and FileX. The two processes are described separately.
[0074] First, when the multi-language voice files are packaged into voice binary files in a structured format, the following steps can be included:
[0075] Step 1.1) Organize the voice files in different national languages according to the specified format.
[0076] According to the different language types, the voice files of different language types can be placed in corresponding independent folders. Each folder is clearly identified by a file name, and each folder has multiple voice files, thereby establishing a clear file directory structure and laying a foundation for subsequent packaging work.
[0077] Step 1.2) Write a packaging script according to the predefined binary file structure.
[0078] In the present application, a binary file structure needs to be predefined, and then a packaging script is written based on the file structure.
[0079] The file structure starts with file check information, which is used to ensure the integrity and correctness of the final generated file. The file check information can be calculated before and after the binary file of the voice is imported into the electronic device, and then compared. If they are the same, the file is correct. Then the total number of languages, i.e. the number of supported language types, is recorded. Then the language information group is recorded, which details the identifier of each language and its related attributes. The related attributes can be the total number of voice files for each language. Then the file information group is recorded, which contains the specific information of each voice file, such as the file name, file size and storage location offset in the packaged file. The last part is a data block composed of the original data of all MP3 voice files arranged in order.
[0080] Step 1.3) Run the packaging script to obtain a multi-lingual voice binary file.
[0081] Specifically, when running the packaging script, the packaging script automatically reads the classified voice files, processes and integrates the data according to the above file structure, and finally outputs a binary file containing all multi-lingual voice. The generation of this file marks the successful completion of the voice resource packaging work, and prepares for the subsequent voice calling and playing.
[0082] The above steps 1.1)-1.3) can realize the packaging of multi-lingual voice files in a structured format. It should be noted that in the voice resource packaging link, a volume index structure can be used instead of a single BIN (Binary, binary file) file. The voice modules of different languages are stored in a modularized manner, and the hash table is used to realize the fast mapping of voice ID (Identifier, identifier) to file offset. In the multi-lingual voice binary file, the storage location offset of each language voice file does not need to be stored, and the file storage offset corresponding to a certain voice ID can be directly located through the hash table. This method can greatly improve the voice retrieval efficiency.
[0083] Further, when the USBX and FileX are used to import the voice binary file into the memory, the following steps are included:
[0084] Step 2.1) Call the application program interface of FileX to establish a file system on the target device, which provides necessary underlying support for subsequent file storage and management.
[0085] Step 2.2) Create a USBX thread, which is used to perform two stages of initialization operation and thread body action, wherein the initialization operation contains a series of key setting steps, first, complete the hardware initialization of the USB host controller, ensure that the hardware layer is ready; then initialize the USBX framework for all host operations; correctly register the required USB device class into the USB stack; at the same time, register the USB host controller itself into the USB stack; finally, initialize the USB media device related structure and create the necessary byte pool memory resource. After completing the initialization, the thread enters the main running state, continuously monitors and updates the connection state of the U disk, and prepares for data transmission.
[0086] Step 2.3) Put the packaged binary file into the specified directory of the U disk to import the voice file through the U disk.
[0087] In the present application, if the U disk connected to the electronic device is detected through the USBX thread, the total number of languages in the binary file under the specified directory of the U disk needs to be read, and a complete language list is generated accordingly, which records different languages; then the corresponding language folder structure is created on the target storage device, including the folders corresponding to different languages; finally, according to the number of voice files contained in each language recorded in the binary file, voice files are created one by one under the corresponding language folder, thereby completely reproducing the multi-language voice file directory structure consistent with the original binary file content. The process of creating voice files one by one under the corresponding language folder includes processing processes such as decompressing the compressed voice files and then storing them into the corresponding folder.
[0088] Through the above steps 2.1) to 2.3), each voice file in the voice binary file can be imported into the memory of the electronic device through USB communication.
[0089] As can be seen from the above, the present application does not need to separately set a voice storage chip, only needs to store multi-language voice files into the memory of the electronic device, and the burning and updating of voice files in the memory can be completed through the U disk. Compared with the traditional voice solution which needs to use an offline burner to re-burn the voice storage chip, the production process is greatly simplified.
[0090] In another embodiment of the present application, if the operating system of the electronic device is an Azure RTOS system, the voice broadcast request process in the message queue includes:
[0091] detecting whether there is an unprocessed request in the ThreadX message queue; wherein the unprocessed request is at least one of a volume adjustment request, a voice file import request, a voice file export request, a system language switching request, and an audio broadcast request;
[0092] if the unprocessed request is the audio broadcast request, performing the step of reading the target voice file corresponding to the voice broadcast request from the memory;
[0093] if the unprocessed request is the volume adjustment request, taking the volume value carried by the volume adjustment request as the target volume value;
[0094] if the unprocessed request is the voice file import request, importing the voice file in the external storage device connected to the electronic device into the memory;
[0095] if the unprocessed request is the voice file export request, exporting the voice file in the memory to the external storage device; and if the unprocessed request is the system language switching request, changing the reading path of the target voice file.
[0096] In the present application, if the operating system of the electronic device is the Azure RTOS system, the ThreadX message queue can be used to receive the voice broadcast request and manage the playing process. ThreadX is the core of the Azure RTOS, which manages and schedules all threads in the system. If it is detected that the ThreadX message queue has an unprocessed request, the request needs to be obtained from the ThreadX message queue and processed, which can be at least one of a volume adjustment request, a voice file import request, a voice file export request, a system language switching request, and an audio broadcast request.
[0097] Here, the process of implementing request management based on the ThreadX message queue is described, which includes the following steps:
[0098] Step 3.1) initialization configuration of the audio function of the host controller.
[0099] In the present application, the host controller is a microcontroller in the electronic device, and the initialization configuration includes clock and pin configuration to meet the timing requirements of audio transmission, SAI (Synchronous Audio Interface) initialization configuration to ensure that its working mode matches the audio data transmission specification, and MQS (Medium Quality Audio) initialization configuration to establish a hardware foundation for subsequent audio output.
[0100] The clock configuration includes configuring an audio PLL (Phase-Locked Loop), and configuring SAI clock division; the pin configuration includes configuring an amplification chip enable pin and an MQS pin; the SAI (synchronous audio interface) initialization configuration includes enabling a corresponding SAI clock, disabling an interrupt and a DMA (Direct Memory Access), creating a transmission handle, configuring an I2S (Inter-IC Sound) format standard, a frame synchronization signal configuration, an application transmission configuration, and setting a bit clock division; and the MQS initialization configuration includes enabling an MQS clock, software resetting the MQS, enabling an MQS module, and configuring MQS parameters.
[0101] Step 3.2) decoder initialization is performed, and a sufficient memory is allocated for a decoder state structure.
[0102] In this step, a special state structure is allocated for an audio decoder, and a sufficient memory space is ensured to support the storage requirements of various temporary data and state information in the decoding process, so as to ensure the smooth execution of the decoding operation.
[0103] Step 3.3) a message queue is created for voice control, and each message in the queue adopts a unified format, including a request type and associated data.
[0104] The instruction type covers volume adjustment, voice file import, voice file export, system language switching, and audio playback control, and the data part stores parameters and related information required when executing these specific instructions.
[0105] Step 3.4) the voice thread main body part implements a message processing mechanism, the thread continuously runs, obtains messages to be processed from the message queue in order, and executes corresponding operation processes by analyzing the instruction type in the message, and the specific operation is as follows:
[0106] Step 3.4.1) for the volume adjustment request, the current data is saved as the volume value, and the PCM data is adjusted after the audio data is decoded.
[0107] Step 3.4.2) for the voice file import request, the operation of step 2.3) is performed again.
[0108] Step 3.4.3) for the voice file export request, a folder needs to be created in the U disk according to the language type, the voice file in the memory is read and written into the folder corresponding to the language in the U disk.
[0109] Step 3.4.4) for the system language switching request, it is realized by changing the reading path of the voice file.
[0110] Step 3.4.5) For the audio broadcast request, the corresponding voice data is read in the memory through the voice file name in the data to the specified input buffer, the data in the input buffer is decoded by the decoder to obtain PCM data, the PCM data is output through PWM modulation inside the MQS to obtain PWM wave, the PWM wave is filtered through RC low pass filter to obtain analog audio data, and the analog audio data is amplified through the amplifier and played through the speaker.
[0111] Through the above steps 3.1) to step 3.4), the effective management of the request can be realized. Referring to Figure 2 The request management flowchart provided by the embodiment of the application is shown. If shown, the process of the application for implementing the request management based on the ThreadX message queue includes the following steps:
[0112] First, the audio function of the host controller is initialized, the decoder is initialized, and the voice message queue is created, and then the voice thread body is entered. It is judged through the voice thread body whether the voice message queue is empty; if not, it means that there is no unprocessed request, and the step of "judging whether the voice message queue is empty" is continued.
[0113] If yes, the message is taken out from the voice message queue, and the command type of the message is judged, the command type being any one of volume adjustment, voice import, voice export, language switching, and voice playing, and after the corresponding action is executed, the step of "judging whether the voice message queue is empty" is continued.
[0114] As can be seen from the above, the way of the application for processing the request based on the ThreadX message queue can accurately call the corresponding function module according to the instruction, whether it is to adjust the volume, import the voice, export the voice, switch the language, or trigger the specific voice playing action, so as to form a complete voice broadcast management closed loop and improve the request execution speed.
[0115] In another embodiment of the application, the process of decoding the target voice file through the decoder specifically includes:
[0116] The total number of characters of the target voice file is taken as the value of the remaining character number variable; a legal frame header is found from the audio data of the target voice file, and the position of the legal frame header is taken as the valid starting position; based on the valid starting position, the decoder is called to analyze the audio data frame by frame, and the value of the remaining character number variable is updated according to the number of characters parsed;
[0117] If the decoding error is detected and the value of the remaining character number variable is less than 128, it is determined that the decoding of the target voice file is completed, and the decoded data is obtained.
[0118] In the present application, after reading the target voice file corresponding to the voice broadcast request from the memory, a decoder needs to be called to decode the target voice file. In the decoding, the total number of characters of the target voice file needs to be first taken as the value of the remaining character number variable, i.e., the initial value of the remaining character number variable is the total number of characters of the target voice file, and in the decoding process, after each character is decoded, the value of the remaining character number variable is decreased by one, so that the number of characters that have not been generated can be known through the value of the remaining character number variable.
[0119] Also, in the decoding, the present application needs to find a legal frame header from the audio data of the target voice file, and take the position of the legal frame header as the valid starting position, and then based on the valid starting position, call the decoder to analyze the audio data frame by frame, and update the value of the remaining character number variable according to the number of characters parsed. If in the decoding process, a decoding error is detected, and the value of the remaining character number variable is less than 128, it indicates that the current data frame position is in the ID3V1 data area, and the audio data decoding is completed. It needs to be noted that ID3V1 is the most common metadata tag format in MP3 files, which is used to store song information at the absolute end of the file, and the ID3V1 tag is a pure text metadata with a length of 128 bytes, which is not a valid MP3 audio frame, and when the decoder tries to decode it as an audio frame, it will inevitably fail. Therefore, in the decoding failure and the value of the remaining character number variable is less than 128, it indicates that the audio data decoding has been completed.
[0120] In another embodiment of the present application, the process of finding a legal frame header from the audio data of the target voice file includes the following contents:
[0121] Finding an audio data frame header from the current frame of audio data of the target voice file; if not found, exiting the decoding and reporting an error; if found, obtaining a target sampling rate from the found audio data frame header; judging whether the target sampling rate is a legal sampling rate;
[0122] If yes, it is determined that the found audio data frame header is a legal frame header; if no, it is determined that the found audio data frame header is not a legal frame header, and the audio data frame header is continuously searched from the next frame of audio data until a legal frame header is found or all audio data is searched.
[0123] In the present application, if the audio file in the present application is an MP3 format audio file, the present application needs to find an audio data frame header from the current frame audio data of the target voice file. If the target sampling rate recorded in the found audio data frame header is a legal sampling rate, it is determined that the found audio data frame header is a legal audio data frame header. The legal sampling rate refers to a standard sampling rate widely accepted and used in the audio, broadcast, video and other industries in long-term practice. Using these standard sampling rates can ensure compatibility between audio devices and normal playback of audio files on different players, such as 8000 Hz, 11025 Hz, etc., which are not specifically limited here.
[0124] Here, the process of internally decoding the target voice file to obtain PCM data is specifically described, which can include the following steps:
[0125] Step 4.1) reads the target voice file data from the memory and loads it into a pre-allocated input buffer. At the same time, record the total number of characters of the file as a backup reference, and assign this value to the file remaining character number variable for subsequent tracking of decoding progress.
[0126] Step 4.2) locate the legal frame header of the audio data as the valid starting position of the audio data, the specific operation steps are as follows:
[0127] Step 4.2.1) find the location of the MP3 audio data frame header in the input buffer. If not found, it means that the input buffer does not contain the starting position of the MP3 audio data frame, exit the decoding and report an error.
[0128] Step 4.2.2) If the data frame header is found, further judge whether the sampling rate meets the expectation, so as to judge whether it is a legal data frame header.
[0129] Step 4.2.3) If it is not a legal data frame header, start from the next frame to re-execute the operation of step 4.2.1) until a legal data frame header is found or the entire audio data is searched.
[0130] Step 4.3) decode the entire audio data to obtain PCM data using the decoder, the specific operation steps are as follows:
[0131] Step 4.3.1) call the application program interface of the decoder to process the loaded complete audio data frame by frame and update the file remaining character number variable. The decoded PCM data is stored in the output buffer; decoding error but the file remaining character number variable is less than 128 indicates that the current data frame position is in the ID3V1 data area, and the audio data decoding is completed.
[0132] Step 4.3.2) Update the output buffer length according to the decoded data length of the previous frame, and update the data frame header to the start position of the next frame. Repeat the operation started in step 4.3.1) to obtain the decoded complete PCM data.
[0133] Step 4.4) Adjust the amplitude of the PCM data according to the target volume value set by the system.
[0134] Specifically, the set volume value is converted into a corresponding decibel amplitude ratio coefficient, and then the PCM data in the output buffer is multiplied by the ratio coefficient sample by sample. Through this digital gain control method, the final PCM data after volume adjustment is generated, thereby realizing accurate control of the playback volume.
[0135] Through the above steps, the target PCM data after speech decoding is obtained. The target PCM data is modulated by PWM, processed by an RC circuit, and power amplified, and the corresponding audio is played by a loudspeaker.
[0136] As can be seen from the above, when decoding the target speech file, the present application does not need to be sent to a dedicated speech chip for audio decoding, but only needs to call the decoder by the microcontroller to realize internal decoding of the audio data. Compared with the traditional scheme using a dedicated speech chip for decoding, the present application has higher decoding efficiency, faster response, and simpler debugging.
[0137] In another embodiment of the present application, the process of converting the target PCM data into the target PWM signal through the audio interface includes:
[0138] The target PCM data is converted into the target PWM signal through the MQS audio interface, and the target PWM signal is smoothed by the RC circuit to output an analog audio signal. The analog audio signal is amplified by the amplification chip of the electronic device to obtain a corresponding electrical signal, and the electrical signal is output by the loudspeaker to realize the playback of the target speech file.
[0139] In the present application, after the target PCM data is generated by decoding, it needs to be transmitted to the MQS audio interface of the microcontroller, so that the MQS audio interface converts it into the target PWM signal, and then outputs it through the RC circuit, the amplification chip and the loudspeaker.
[0140] Here, the process of converting the PWM modulated PCM data into an analog signal played by the loudspeaker by using the RC circuit in the present application is specifically described, which includes the following steps:
[0141] Step 5.1) Start the power amplifier module, provide necessary working voltage and enable signal for it, and ensure that the amplification circuit enters the normal working state.
[0142] Step 5.2) The system transmits the target PCM data to the MQS audio interface through an interrupt mechanism.
[0143] In the process of data transmission, the system always monitors the voice message queue, and if a new voice playing instruction is received at this time, the current transmission process will be interrupted immediately, and a higher priority broadcast request will be responded to.
[0144] Step 5.3) The target PWM signal is smoothed by an RC circuit to output an analog audio signal.
[0145] Specifically, the modulated target PWM signal then enters the RC filter circuit, which smoothes the PWM waveform by combining resistance and capacitance, filters out high-frequency carrier components, and restores the original analog audio signal. The converted analog signal is still relatively weak and needs to be sent to a power amplifier for signal enhancement.
[0146] Step 5.4) The power amplifier amplifies the analog audio signal and plays it through the speaker.
[0147] Specifically, the power amplifier amplifies the analog audio signal in voltage and current, drives a speaker unit with certain power, and the amplified electrical signal passes through the electromagnetic conversion device in the speaker to drive the diaphragm to vibrate the air to produce sound waves, finally completing the complete conversion process from digital data to audible sound.
[0148] The target PWM signal output by the microcontroller's audio interface is amplified by the RC circuit amplifier and played by the speaker, which reduces the communication link between the microcontroller and the dedicated voice chip compared to traditional voice solutions, and improves the resource utilization efficiency of the microcontroller.
[0149] In another embodiment of the present application, the voice broadcast method further comprises:
[0150] The upgrade voice package is obtained through OTA technology, and the voice file stored in the memory is updated according to the upgrade voice package.
[0151] In the present application, the OTA technology (Over-The-Air Technology) is a technology for remotely upgrading a device through a wireless network. Therefore, in order to improve the update efficiency of voice files, the present application can adopt a hybrid preloading and dynamic updating strategy. The electronic device can be pre-installed with a basic voice package when it is shipped, and when it is necessary to update the voice files of the electronic device, the OTA technology can be used to realize remote incremental update of voice resources. This design perfectly balances the initial cost and later flexibility, making the same hardware easily adapt to the different market demands around the world.
[0152] Therefore, after obtaining the upgrade voice package through the OTA technology, the electronic device can update the voice files stored in the memory according to the upgrade voice package. When transmitting the upgrade voice package through the OTA technology, a file transfer protocol can be used to transmit the upgrade voice package, and an FTP / HTTP (File Transfer Protocol / Hypertext Transfer Protocol) client can be introduced to replace a single USB mass storage solution. This remote wireless update of voice resources through Ethernet or Wi-Fi (Wireless Fidelity) greatly improves the convenience of system maintenance.
[0153] In order to improve the flexibility of voice broadcasting, the present application can also be combined with cloud-based voice synthesis technology. The electronic device can access a TTS (Text-To-Speech) service through a network, convert text in the electronic device into multi-lingual voice streams in real time through the TTS service, and play the voice streams through the electronic device. This scheme breaks through the limitation of pre-stored voice files, enabling the system to broadcast any dynamic content and truly realizing the unlimited expansion of voice content. Furthermore, based on the above scheme, the present application can also use the combination of edge computing devices and local AI (Artificial Intelligence) models to realize end-side real-time synthesis of text to voice. This scheme ensures response speed while avoiding network dependence, retaining the flexibility of cloud-based solutions and ensuring the privacy and security of local processing.
[0154] Further, the electronic device in the present application also has a Bluetooth A2DP (Advanced Audio Distribution Profile) audio receiving function. The electronic device acts as a slave to receive music streams from devices such as mobile phones, and realizes intelligent switching and mixing output of external audio sources and local voice broadcasting through protocol stack analysis.
[0155] In order to specifically describe the present scheme, refer to Figure 3The embodiment of the application provides a scheme flow diagram of multi-national voice broadcasting based on an Azure RTOS, and comprises the following steps:
[0156] S1, packaging multi-national voice files into binary files in a structured format;
[0157] S2, importing the voice package into a memory by using USBX and FileX;
[0158] S3, receiving a broadcasting request by using a ThreadX message queue, and managing a playing process;
[0159] S4, selecting a corresponding voice file according to the broadcasting request to obtain PCM data by internal decoding;
[0160] S5, converting the PWM modulated PCM data into an analog signal by using an RC circuit, and playing the analog signal by a loudspeaker.
[0161] In summary, the application provides a multi-national voice broadcasting scheme based on an Azure RTOS. The application first packages multi-national voice files into binary files in a structured format, then imports the voice binary files into a memory by using USBX and FileX, receives a broadcasting request by using a ThreadX message queue, manages a playing process, selects a corresponding voice file according to the broadcasting request to obtain PCM data by internal decoding, finally converts the PCM data into analog data by using an RC circuit, and transmits the analog data to a power amplifier, and finally plays the analog data by a loudspeaker.
[0162] It can be seen that the application adopts an architecture of "microcontroller audio interface + memory + amplification chip + loudspeaker". After the application packages multi-national voice MP3 files into binary files, the application imports the packaged files into a memory by using a USB interface provided by an Azure RTOS, implements efficient management and scheduling of voice related tasks based on ThreadX, fully utilizes internal decoding of modern high-performance MCUs to output audio data through an audio interface, saves a dedicated voice chip and an external voice storage chip, and only needs to reserve an audio power amplification chip and a loudspeaker, thereby significantly reducing hardware cost and circuit board space occupation. Meanwhile, voice file burning and updating can be completed by using a U disk, and a production process is greatly simplified.
[0163] Compared with the prior art, the scheme has at least the following key points:
[0164] 1. The application uses an MQS function mode of a synchronous audio interface of a high-performance MCU to output a PWM modulated signal, converts the PWM modulated signal into an analog audio signal through an RC circuit, saves a DAC (Digital-to-Analog Converter) chip, and provides a possibility for saving a dedicated voice chip.
[0165] 2、The application uses an audio decoder to decode audio data inside a chip, realizes conversion of audio data into analog audio signals in combination with key protection point 1, saves a special voice chip, and has higher decoding efficiency and faster response and simpler debugging because of saving the step of communication with the voice chip. The special voice chip contains two functions of audio decoding and DAC.
[0166] 3、The application saves a voice storage chip by adopting the mode of packing MP3 files into binary files, importing the memory through USB communication, and creating a file system to manage the unpacked audio files. Through the mode, the burning and updating of voice files can be completed through a U disk, greatly simplifying the production process.
[0167] The voice broadcast device provided by the embodiment of the application is introduced below, and the voice broadcast device described below can be correspondingly referred to the voice broadcast method described above.
[0168] Referring to Figure 4 , Figure 4 A structure schematic diagram of a voice broadcast device provided by the embodiment of the application, the voice broadcast device is applied to a microcontroller in an electronic device, and the device specifically includes:
[0169] A reading module 11 is configured to detect a voice broadcast request in a message queue, read a target voice file corresponding to the voice broadcast request from a memory, and obtain the voice file in the memory from an external storage device connected to the electronic device.
[0170] A decoding module 12 is configured to decode the target voice file through a decoder, adjust decoded data according to a target volume value, and obtain target PCM data.
[0171] A transmission module 13 is configured to transmit the target PCM data to an audio interface.
[0172] A conversion module 14 is configured to convert the target PCM data into a target PWM signal through the audio interface, so as to output the target PWM signal through an RC circuit, an amplification chip and a loudspeaker of the electronic device, and realize broadcast of the target voice file.
[0173] As an optional embodiment, the decoding module includes:
[0174] A determination unit is configured to take a total number of characters of the target voice file as a value of a remaining character number variable.
[0175] The searching unit is configured to search for a legal frame header from the audio data of the target voice file, and take the position of the legal frame header as a valid starting position.
[0176] The parsing unit is configured to call a decoder to parse the audio data frame by frame based on the valid starting position, and update the value of the remaining character number variable according to the number of parsed characters.
[0177] The determining unit is configured to determine that the target voice file is decoded and completed to obtain decoded data when a decoding error is detected and the value of the remaining character number variable is less than 128.
[0178] As an optional embodiment, the searching unit is specifically configured to:
[0179] search for an audio data frame header from the current frame of audio data of the target voice file;
[0180] If the audio data frame header is not found, the decoding is exited and an error is reported; if the audio data frame header is found, a target sampling rate is obtained from the found audio data frame header.
[0181] It is determined whether the target sampling rate is a legal sampling rate.
[0182] If yes, it is determined that the found audio data frame header is a legal frame header; if no, it is determined that the found audio data frame header is not a legal frame header, and the searching for the audio data frame header is continued from the next frame of audio data until a legal frame header is found or all audio data is searched.
[0183] As an optional embodiment, the conversion module is specifically configured to: convert the target PCM data into a target PWM signal through an MQS audio interface, and perform smoothing processing on the target PWM signal through an RC circuit to output an analog audio signal, so that the analog audio signal is amplified through an amplification chip of the electronic device to obtain a corresponding electrical signal, and the electrical signal is output through a loudspeaker to realize the playing of the target voice file.
[0184] As an optional embodiment, the reading module is specifically configured to:
[0185] It is determined whether there is an unprocessed request in the ThreadX message queue; wherein the type of the unprocessed request is at least one of a volume adjustment request, a voice file import request, a voice file export request, a system language switching request, and an audio playing request.
[0186] If the unprocessed request is the audio playing request, the step of reading the target voice file corresponding to the voice playing request from the memory is performed.
[0187] If the unprocessed request is a volume adjustment request, a volume value carried by the volume adjustment request is taken as the target volume value.
[0188] If the unprocessed request is a voice file import request, a voice file in an external storage device connected to the electronic device is imported into the memory.
[0189] If the unprocessed request is a voice file export request, a voice file in the memory is exported to an external storage device; and if the unprocessed request is a system language switching request, a reading path of a target voice file is changed.
[0190] As an optional embodiment, the device further comprises:
[0191] The establishing module is configured to establish a file system and a USBX thread based on an Azure RTOS system of the electronic device, the USBX thread being configured to perform an initialization operation and a thread body action.
[0192] The creating module is configured to, when the USBX thread performs the thread body action, if a U disk connected to the electronic device is detected, create a multi-language folder structure in a memory of the electronic device according to a target binary file in the U disk, wherein each language folder in the folder structure contains each voice file created by the target binary file.
[0193] As an optional embodiment, the device further comprises:
[0194] The updating module is configured to acquire an upgrade voice package through an OTA technology, and update a voice file stored in the memory according to the upgrade voice package.
[0195] Referring to Figure 5 , Figure 5 An electronic device structure schematic diagram provided by an embodiment of the present application comprises a microcontroller 21, a memory 22, an RC circuit 23, an amplification chip 24, a loudspeaker 25, and a communication interface 26; wherein the memory 22 is configured to store a computer program and a voice file.
[0196] The microcontroller 21 is configured to, when executing the computer program, implement steps of a voice broadcast method described in any method embodiment, which will not be described herein again.
[0197] In the present application, the electronic device can be a voice broadcast device, and the microcontroller can be an MCU. The communication interface is used to realize the communication between the above-mentioned electronic device and other devices. The memory can include a random access memory (RAM) and can also include a non-volatile memory, such as at least one disk memory.
[0198] In another exemplary embodiment, a computer storage medium is also provided, and the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the voice broadcast method described in any of the above method embodiments. The storage medium can include a FLASH (Flash Memory), an SD / TF Card (Secure Digital Card / T-Flash Card), an eMMC (embedded MultiMediaCard), etc., or a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0199] Optionally, the specific examples in the present embodiment can refer to the examples described in the above embodiments, and the present embodiment will not be described here.
[0200] The various embodiments in the present specification are described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The same or similar parts between various embodiments can refer to each other. It should be understood that the terms used herein are for the purpose of describing specific example embodiments only and are not intended to be limiting. As used herein, the singular forms "a," "an," and "the" can also represent the plural forms unless the context clearly indicates otherwise. The terms "comprise," "include," "contain," and "have" are inclusive, and thus indicate the presence of the stated features, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the order of execution is explicitly indicated. It should also be understood that additional or alternative steps can be used.
[0201] The foregoing is considered as illustrative only of the principles of the application. Numerous modifications and changes will readily occur to those skilled in the art, and it is intended to embrace all such modifications and changes that fall within the scope of the application. Accordingly, the application is not to be restricted in scope to the specific embodiments disclosed herein but is to be accorded the full scope that the principles and novel features request appropriately granted.
Claims
1. A voice broadcasting method, characterized in that, The voice broadcasting method is applied to a microcontroller within an electronic device, and the voice broadcasting method includes: If a voice broadcast request is detected in the message queue, the target voice file corresponding to the voice broadcast request is read from the memory; wherein the voice file in the memory is obtained from an external storage device connected to the electronic device. The target audio file is decoded using a decoder, and the decoded data is adjusted according to the target volume value to obtain target PCM data. The target PCM data is transmitted to the audio interface, and the target PCM data is converted into a target PWM signal through the audio interface. The target PWM signal is then output through the RC circuit, amplifier chip, and speaker of the electronic device to enable the playback of the target voice file.
2. The voice broadcasting method according to claim 1, characterized in that, Decoding the target audio file using a decoder includes: The total number of characters in the target audio file is used as the value of the remaining character count variable; Find a valid frame header from the audio data of the target speech file and use the position of the valid frame header as the valid starting position; Based on the valid starting position, the decoder is invoked to parse the audio data frame by frame, and the value of the remaining character count variable is updated according to the number of parsed characters; If a decoding error is detected and the value of the remaining character count variable is less than 128, then the target audio file is determined to be decoded successfully, and the decoded data is obtained.
3. The voice broadcasting method according to claim 2, characterized in that, Finding legitimate frame headers from the audio data of the target speech file includes: Locate the audio data frame header from the current frame audio data of the target audio file; If not found, the decoding process exits and an error is reported; if found, the target sampling rate is obtained from the header of the found audio data frame. Determine whether the target sampling rate is a valid sampling rate; If yes, the found audio data frame header is determined to be a valid frame header; otherwise, the found audio data frame header is determined to be invalid, and the search for audio data frame header continues in the next frame of audio data until a valid frame header is found or all audio data has been retrieved.
4. The voice broadcasting method according to claim 1, characterized in that, Converting the target PCM data into a target PWM signal via the audio interface includes: The target PCM data is converted into a target PWM signal through the MQS audio interface, and the target PWM signal is smoothed by the RC circuit to output an analog audio signal. The analog audio signal is then amplified by the amplifier chip of the electronic device to obtain the corresponding electrical signal, which is then output through the speaker to realize the playback of the target voice file.
5. The voice broadcasting method according to claim 1, characterized in that, If the operating system of the electronic device is Azure RTOS, then the step of detecting a voice broadcast request in the message queue includes: Detect whether there are any unprocessed requests in the ThreadX message queue; wherein, the type of the unprocessed request is at least one of the following: volume adjustment request, voice file import request, voice file export request, system language switching request, and audio playback request; If the unprocessed request is an audio playback request, then the step of reading the target audio file corresponding to the audio playback request from the memory is executed; If the unprocessed request is a volume adjustment request, then the volume value carried by the volume adjustment request shall be used as the target volume value; If the unprocessed request is a voice file import request, then the voice file in the external storage device connected to the electronic device will be imported into the memory; If the unprocessed request is a voice file export request, then the voice file in the memory is exported to an external storage device; if the unprocessed request is a system language switching request, then the reading path of the target voice file is changed.
6. The voice broadcasting method according to claim 5, characterized in that, The method for obtaining the audio files in the memory is as follows: Based on the Azure RTOS system of the electronic device, a file system and a USBX thread are established, wherein the USBX thread is used to perform initialization operations and the main thread actions; When the USBX thread executes its main thread action, if a USB flash drive connected to the electronic device is detected, a multilingual folder structure is created in the memory of the electronic device based on the target binary file in the USB flash drive; wherein, each language folder in the folder structure contains various audio files created from the target binary file.
7. The voice broadcasting method according to any one of claims 1 to 6, characterized in that, The voice broadcasting method also includes: The system obtains an upgrade voice pack using OTA technology and updates the voice files stored in the memory according to the upgrade voice pack.
8. A voice broadcasting device, characterized in that, The voice broadcasting device is used in a microcontroller within an electronic device, and the voice broadcasting device includes: A reading module is used to detect a voice broadcast request in the message queue and read the target voice file corresponding to the voice broadcast request from the memory; wherein the voice file in the memory is obtained from an external storage device connected to the electronic device; The decoding module is used to decode the target speech file through a decoder and adjust the decoded data according to the target volume value to obtain target PCM data; The transmission module is used to transmit the target PCM data to the audio interface; The conversion module is used to convert the target PCM data into a target PWM signal through the audio interface, so that the target PWM signal can be output through the RC circuit, amplification chip and speaker of the electronic device to realize the playback of the target voice file.
9. An electronic device, characterized in that, include: Microcontroller, memory, RC circuit, amplifier chip and speaker; The memory is used to store computer programs and audio files; The microcontroller is used to implement the steps of the voice broadcasting method as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the voice broadcasting method as described in any one of claims 1 to 7.