Voice concatenation method implemented on operating system and non-instantaneous storage medium

By executing the voice subsystem on the operating system and connecting the relevant sound card ports on the operating system, the problem that the existing operating system does not support the connection between different sound cards is solved, and the effect of function expansion and quick sound card replacement is achieved.

CN119576264APending Publication Date: 2025-03-07ICP ELECTRONICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311137885.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-05
Publication Date
2025-03-07

Smart Images

  • Figure CN119576264A_ABST
    Figure CN119576264A_ABST
Patent Text Reader

Abstract

A voice concatenation method implemented on an operating system is mainly applied to an electronic device with the operating system and comprises the following steps: executing a voice subsystem on the operating system, the voice subsystem having a service resource checker; continuously checking, by a service resource checker, the state of the voice service of the operating system; and when it is judged that the state of the voice service is an Incall request, the voice subsystem establishes a channel to connect two sound card ports, specified by the Incall request, on the operating system in series, so that a call program corresponding to the Incall request is executed through the two sound card ports which are connected in series.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a voice concatenation method, in particular to a voice concatenation method implemented on an operating system. Background Art

[0002] Some operating systems (OS) are developed for personal mobile devices (e.g. Android is developed for smartphones or tablets). These personal mobile devices usually only have a single voice unit and do not require a sound card to be connected or switched. Therefore, these operating systems do not support the sound card connection or switching function by default.

[0003] With the development of technology, many electronic devices have become more intelligent and have adopted the operating system for convenience (such as open source program code). However, the use environment of some electronic devices is more complex, which is different from that of personal mobile devices. For example, a multimedia machine on a public transportation vehicle or a kiosk placed in a square may have three or even more than three voice units (such as a codec sound card plus multiple HDMI sound cards). At this time, how to simply modify the operating system to meet the needs of sound card serial connection or switching is a topic for people in this field.

[0004] Taking Android's open source program code AOSP (Android Open Source Project) as an example, it did not initially support the call function of 4G / 5G network modules. The main reason is that there are many manufacturers producing and providing 4G / 5G network modules, but each manufacturer has different practices for the Hardware Abstract Layer (HAL) and they are incompatible with each other.

[0005] Generally speaking, if the electronic device developed by the user adopts AOSP and hopes to support the call function of the 4G / 5G network module, the manufacturer providing the 4G / 5G network module must be requested to help modify the hardware abstraction layer of AOSP to implement the sound card of the 4G / 5G network module in the hardware abstraction layer. However, the above approach is more complicated and takes a lot of time. Furthermore, when the 4G / 5G network module is replaced with a different brand, the user must readjust the hardware abstraction layer, which is quite troublesome. Summary of the invention

[0006] The main purpose of the present invention is to provide a voice cascading method and a non-transient storage medium implemented on an OS, which can cascade different sound cards / sound card ports of an electronic device through a voice subsystem to expand the functions of the electronic device.

[0007] In order to achieve the above-mentioned object, the voice concatenation method of the present invention is applied to an electronic device having an operating system and comprises the following steps:

[0008] a) executing a speech subsystem on the operating system;

[0009] b) continuously checking the status of a voice service in a system framework of the operating system by a service resource checker of the voice subsystem; and

[0010] c) When the state of the voice service is determined to be an Incalling, the voice subsystem establishes a channel to serially connect two sound card ports related to the Incalling on the operating system to execute a call program corresponding to the Incalling.

[0011] As mentioned above, this also includes:

[0012] a1) after step a), the voice subsystem detects a plurality of sound card drivers running on the operating system, wherein each of the sound card drivers corresponds to a sound card of the electronic device; and

[0013] a2) establishing a sound card list based on the detection result of step a1), wherein the sound card list records a plurality of sound card drivers or a plurality of sound cards that have been running on the operating system.

[0014] As described above, the step c) includes searching the sound card list for a sound card input port and a sound card output port specified by the call request, and establishing the channel to connect the sound card input port and the sound card output port in series.

[0015] As described above, the channel is a pulse-code modulation (PCM) channel, the sound card input port of the operating system transmits a PCM data corresponding to the sound card to the PCM channel, and the PCM channel transmits the PCM data to the sound card output port.

[0016] As described above, the sound card input port and the sound card output port belong to the same sound card, and the PCM channel includes a plug-in for AI voice processing function, wherein the call procedure of step c includes transmitting the PCM data from the sound card input port to the PCM channel, performing the AI ​​voice processing on the PCM data by the PCM channel and generating an AI voice response, and transmitting the AI ​​voice response to the sound card output port by the PCM channel.

[0017] As mentioned above, the sound card input port and the sound card output port belong to two different sound cards respectively.

[0018] As described above, step c) includes establishing a first PCM channel and a second PCM channel by the voice subsystem, wherein the first PCM channel is connected to a sound card input port of a first sound card and a sound card output port of a second sound card, and the second PCM channel is connected to the sound card input port of the second sound card and the sound card output port of the first sound card.

[0019] As described above, the electronic device includes at least a codec sound card, an HDMI sound card, and a 4G / 5G network module sound card, and the step c) includes establishing the channel to serially connect the sound card port of the 4G / 5G network module with the sound card port of the codec, or to serially connect the sound card port of the 4G / 5G network module with the sound card port of the HDMI.

[0020] As mentioned above, the operating system is AOSP or NUTTX OS.

[0021] As described above, the voice subsystem implements the channel based on the bionic c library, and implements the on / off control of the two sound card ports based on tinyALSA.

[0022] As mentioned above, wherein the step c) comprises:

[0023] c1) when it is determined that the state of the voice service is the call request, determining whether the two sound card ports specified by the call request are occupied;

[0024] c2) waiting when at least one of the two sound card ports is occupied; and

[0025] c3) when the two sound card ports are not occupied, establishing the channel to connect the two sound card ports in series to execute the call program corresponding to the call request.

[0026] As mentioned above, this also includes:

[0027] d) the service resource checker continuously checks the status of the voice service to determine whether the call process is terminated;

[0028] e) Maintain the channel until the call process ends; and

[0029] f) cancel the channel at the end of the call process and release the two sound card ports.

[0030] In order to achieve the above-mentioned object, the non-transitory storage medium of the present invention records a computer executable program code. When the computer executable program code is executed by an electronic device, the above-mentioned steps can be executed.

[0031] Compared to the related art, the present invention uses a voice subsystem independent of the system framework of the operating system to connect different sound cards / sound card ports running on the operating system, which can quickly expand the functions of the electronic device without changing the hardware abstraction layer of the system framework and support the rapid replacement of the sound card. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1A A schematic diagram of an electronic device according to a first embodiment of the present invention;

[0033] Figure 1B is a schematic diagram of an electronic device according to a second embodiment of the present invention;

[0034] Figure 2 is a specific embodiment of a block diagram of an electronic device of the present invention;

[0035] Figure 3 A specific embodiment of a schematic diagram of a communication architecture of the present invention;

[0036] Figure 4 A specific embodiment of the flow chart of the serial connection method of the present invention;

[0037] Figure 5 A schematic diagram of a serial connection structure of the present invention is a specific embodiment;

[0038] Figure 6 is a specific embodiment of the detection flow chart of the present invention;

[0039] Figure 7 It is a specific embodiment of the state confirmation flow chart of the present invention;

[0040] Figure 8 It is a specific embodiment of the release flow chart of the present invention.

[0041] Wherein, the reference numerals are:

[0042] 1, 2, 3…electronic devices;

[0043] 31…Processor;

[0044] 32… storage media;

[0045] 33…sound card;

[0046] 331…First sound card;

[0047] 332…Second sound card;

[0048] 33n…nth sound card;

[0049] 41…operating system;

[0050] 411…System Framework;

[0051] 4111…Voice service;

[0052] 4112… Voice Hardware Abstraction Layer;

[0053] 412…JAVA API architecture;

[0054] 413…Native library layer;

[0055] 414…ART;

[0056] 42…Applications;

[0057] 43…Speech subsystem;

[0058] 431…Service Resource Inspector;

[0059] 432…first pulse code modulation channel;

[0060] 433…second pulse code modulation channel;

[0061] 44…Core layer;

[0062] 441…First sound card driver;

[0063] 4411…input port;

[0064] 4412...output port;

[0065] 442…Second sound card driver;

[0066] 44n…nth sound card driver;

[0067] 44n1...input port;

[0068] 44n2...output port;

[0069] S41~S46…series connection steps;

[0070] S61-S62…detection step;

[0071] S71-S74...status confirmation step;

[0072] S81~S85...release step. DETAILED DESCRIPTION

[0073] A preferred embodiment of the present invention is described in detail below with reference to the drawings.

[0074] The present invention discloses a voice cascading method implemented on an OS (hereinafter referred to as the cascading method in the specification), which is mainly applied to an electronic device running an operating system (OS) to cascade multiple sound cards of the electronic device or multiple sound card ports of the same sound card. Thus, the present invention can facilitate the expansion of the functions of the electronic device (such as a call function or a voice answering function, etc.).

[0075] First Read Figure 1A and Figure 1B , respectively, are schematic diagrams of the electronic device of the first embodiment and the second embodiment of the present invention.

[0076] At Figure 1A In the embodiment of the present invention, the electronic device 1 is a kiosk, which is set up in a public place to play advertisements. Generally speaking, the kiosk has a high definition multimedia interface (HDMI), and the preset output sound card is an HDMI sound card, so as to play advertisement information (including images and sounds) through HDMI.

[0077] At Figure 1B In the embodiment of the present invention, the electronic device 1 is a multimedia device mounted on a public transportation vehicle (e.g., a bus) for playing traffic information on the bus. The multimedia device is usually equipped with HDMI, and the preset output sound card is an HDMI sound card, so that the traffic information (including images and sounds) is played through HDMI.

[0078] It is worth mentioning that the above-mentioned electronic devices 1 and 2 generally also have a codec sound card (corresponding to the built-in speaker), or are equipped with a 4G / 5G network module (also with a sound card). As mentioned above, since the default sound card of the electronic devices 1 and 2 is an HDMI sound card, and the operating system used by the electronic devices 1 and 2 (taking Android as an example) does not initially support the serial connection between different sound cards, nor does it support the use of a sound card with a 4G / 5G network module. Therefore, how to allow the electronic devices 1 and 2 to perform the serial connection of these sound cards, and then realize extended functions such as calls or voice answering, is the main technical problem solved by the present invention.

[0079] See also Figure 2 , which is a specific embodiment of a block diagram of an electronic device of the present invention. Figure 2 An electronic device 3 for executing the serial connection method of the present invention is disclosed. The electronic device 3 may be, for example, Figure 1A The advertising machine shown, Figure 1B The in-vehicle multimedia device shown, or other electronic devices running an operating system, is not limited thereto.

[0080] like Figure 2 As shown, the electronic device 3 comprises a processor 31 , a storage medium 32 , a plurality of sound cards 33 and an input unit 34 , wherein the processor 31 is electrically connected to the storage medium 32 , the plurality of sound cards 33 and the input unit 34 .

[0081] In one embodiment, the processor 31 may be, for example, a programmable logic controller (PLC), a central processing unit (CPU), a microcontroller unit (MCU), a field programmable gate array (FPGA), or a system on chip (SoC), etc., without limitation. The storage medium 32 may be, for example, a non-transitory storage medium such as a flash memory, a read-only memory (ROM), a hard disk drive (HDD), a solid state drive (SSD), or an optical storage device, but is not limited thereto.

[0082] In one embodiment, the plurality of sound cards 33 include a first sound card 331 , a second sound card 332 to an nth sound card 33n , which may be, for example, an HDMI sound card, a codec sound card, a 4G / 5G network module sound card, etc., without limitation.

[0083] In one embodiment, the input unit 34 may be, for example, a key, a touch pad, a touch screen, or a voice input interface, etc., for accepting external operations to trigger the electronic device 3 to execute the serial connection method of the present invention. For example, the user may activate a call-related application on the electronic device 3 through the input unit 34, thereby triggering the serial connection method of the present invention to serially connect two sound cards / sound card ports required by the application (to be described in detail later).

[0084] In the present invention, the storage medium 32 stores an operating system 41, an application (Application, APP) 42 and a voice subsystem 43. The voice subsystem 43 is a background process that is independent of the system framework (Framework) 411 of the operating system and is resident and executed in the background. In one embodiment, the voice subsystem 43 is a program implemented by tinyASLA, and the operating system 41 is any operating system that supports tinyALSA, such as Android or NUTTX OS, but is not limited thereto.

[0085] After the electronic device 3 is turned on, the processor 31 can execute the operating system 41, and the operating system 41 runs the drivers of the multiple sound cards 33. When the user has a call demand, the application 42 related to the call function on the electronic device 3 can be triggered. Since the application 42 is executed on the basis of the operating system 41, the operating system 41 can obtain all the states of the application 42 (for example, through Figure 3 The voice service 4111 shown records the status of the application 42). In the present invention, the electronic device 3 executes the voice subsystem 43 through the processor 31, and the voice subsystem 43 continuously requests the status of the application 42 (or other services that use the sound card) from the operating system 41, and executes the connection method of the present invention when it is known that the application 42 starts a call. In this way, the voice subsystem 43 can assist the electronic device 3 to connect multiple sound cards 33 (or multiple sound card ports of a single sound card) in series to implement the call function.

[0086] In one embodiment, the storage medium 32 is a non-transient storage medium, and the speech subsystem 43 is recorded in the storage medium 32 in the form of a computer executable program code. When the electronic device 3 executes the computer executable program code, the speech subsystem 43 can be executed, and the concatenation method of the present invention (to be described in detail later) can be implemented through the speech subsystem 43.

[0087] See also Figure 3 , is a specific embodiment of the schematic diagram of the communication architecture of the present invention. Figure 3 As shown, the operating system 43 includes a system framework 411, a JAVA API framework 412, a native function library layer 413, a voice subsystem 43 and a core layer 44. The concatenation method of the present invention is implemented by the voice subsystem 43, wherein the voice subsystem 43 runs in the operating system 43, but is independent of the system framework 411.

[0088] In one embodiment, the operating system 41 is Android, the voice subsystem 43 is a program implemented by tinyALSA, the core layer 44 is a Linux core layer, and the operating system 41 further includes an Android runtime (ART) 414 .

[0089] like Figure 3 As shown, the core layer 44 runs multiple sound card drivers of the electronic device 3, including a first sound card driver 441, a second sound card driver 442 to an nth sound card driver 44n, and these sound card drivers correspond to multiple sound cards 33 (hardware) connected to the electronic device 3, for example Figure 2 The first sound card 331, the second sound card 332 to the nth sound card 33n are shown.

[0090] like Figure 3 As shown, the system framework 411 includes at least an audio service 4111 and an audio hardware abstraction layer (Audio Hardware Abstract Layer, Audio HAL) 4112 responsible for monitoring and processing the call status of the electronic device 3. In the related art, when using a sound card, the operating system 41 generally connects the sound card driver in the core layer 44 through the audio hardware abstraction layer 4112 in the system framework 411; in the present invention, the audio subsystem 43 continuously checks the audio service 4111 of the system framework 411 in the background, and when it is known that there is a call request through the audio service 4111, it directly connects multiple sound card drivers in the core layer 44 (or connects different sound card ports of the same sound card) in series, thereby realizing the required function.

[0091] See also Figure 4 , is a specific embodiment of the flowchart of the serial connection method of the present invention. Figure 4 As shown, the electronic device 3 starts the operating system 41 after booting up (step S41), and then the operating system 41 executes the voice subsystem 43 (step S42). In the present invention, the voice subsystem 43 at least includes a service resource checker for detecting the status of the voice service of the operating system 41 and dynamically establishing a channel for serially connecting multiple sound cards or multiple sound card ports (to be described in detail later).

[0092] In the present invention, the voice subsystem 43 runs in the background after being executed, and continuously checks the status of the voice service 4111 of the operating system 41 through the service resource checker (step S43) to determine whether the status of the voice service 4111 is an incall request (step S44). If it is determined in step S43 that the voice service 4111 is currently in an idle state, the voice subsystem 43 returns to step S42 to continuously check the status of the voice service 4111 through the service resource checker.

[0093] If the status of the voice service 4111 is determined to be an Incalling in step S43, the voice subsystem 43 dynamically establishes one or more channels to serially connect the two sound card ports related to the Incalling on the operating system 41 (step S45), thereby executing the call program corresponding to the Incalling through the two serially connected sound card ports (step S46).

[0094] In the embodiment where the operating system 41 is Android, the voice subsystem 43 implements the channel through Bionic C, but is not limited thereto. In the present invention, the channel established by the voice subsystem 43 is used to connect a sound card input port (input) and a sound card output port (output) in series. In one embodiment, the channel connects the input port of a sound card in series with the output port of another sound card. In another embodiment, the channel connects the sound card input port and the sound card output port of the same sound card in series (to be described in detail later).

[0095] Please also see Figure 5 , is a schematic diagram of a cascade architecture of the present invention. Figure 5 As shown, the voice subsystem 43 of the present invention continuously checks the status of the voice service 4111 in the system framework 411 of the operating system 41 through the service resource checker 431, wherein the status of the voice service 4111 is associated with the use of the call-related application 42 on the operating system 41, and at least includes the states of no call (No call), dialing request (Calling in) and call request (Incalling).

[0096] When the service resource checker 431 detects that the status of the voice service 4111 is a call request, the voice subsystem 43 opens the two sound card ports (including one input port and one output port) specified by the call request through instructions (for example, implemented with tinyALSA), and dynamically establishes a channel to connect the opened input port and output port in series.

[0097] In one embodiment, the channel is a pulse-code modulation (PCM) channel. After the voice subsystem 43 issues a serial connection request, the core layer 44 of the operating system 41 transmits the PCM data of the sound card to the voice subsystem 43 through the sound card port through the corresponding sound card driver, and the voice subsystem 43 then transmits the PCM data through the established PCM channel. Specifically, the operating system 41 can transmit the PCM data of the corresponding sound card to the PCM channel established by the voice subsystem 43 through the input port specified by the call program, and the voice subsystem 43 then transmits the received PCM data to the output port specified by the call program through the PCM channel.

[0098] In one embodiment, when a call process is established, it must include voice input and output, and the voice input and output are implemented through different sound cards. In this embodiment, the input port and the output port belong to two different sound cards respectively. In addition, the voice subsystem 43 establishes at least two PCM channels to connect the two sound cards in series.

[0099] At Figure 5 In the embodiment of the present invention, the service resource checker 431 detects that the state of the voice service 4111 is changed to a call request, and the sound cards specified by the call request are the first sound card and the nth sound card. In this embodiment, the voice subsystem 43 creates a first PCM channel 433 and a second PCM channel 433 in real time, wherein the input port 4411 of the first sound card (corresponding to the first sound card driver 441) and the output port 44n2 of the nth sound card (corresponding to the nth sound card driver 44n) are connected in series through the first PCM channel 432, and the input port 44n1 of the nth sound card and the output port 4412 of the first sound card are connected in series through the second PCM channel 433.

[0100] In one embodiment, the voice subsystem 43 implements the first PCM channel 432 and the second PCM channel 433 through the Bionic C function library in the native function library layer 413 of Android, and implements the opening and closing control of the sound card port based on tinyALSA in the native function library layer 413.

[0101] Specifically, when the two sound card ports are to be connected in series, the voice subsystem 43 opens the two sound card ports through instructions established by tinyALSA. After the two sound card ports are opened, the PCM data of the corresponding sound card can be transmitted to the voice subsystem 43. Moreover, after the call procedure is finished, the voice subsystem 43 closes the two sound card ports through instructions established by tinyALSA to release resources.

[0102] Through the serial connection of the first PCM channel 432, the electronic device 3 can receive the voice signal of one party through the input port of the first sound card and play it through the output port of the second sound card in the call process; through the serial connection of the second PCM channel 433, the electronic device 3 can receive the voice signal of the other party through the input port of the second sound card and play it through the output port of the first sound card in the call process. In this way, the call function can be realized on the electronic device 3.

[0103] In one embodiment, the electronic device 3 at least includes a codec sound card, an HDMI sound card, and a 4G / 5G network module sound card.

[0104] Taking AOSP as an example, the voice hardware abstraction layer 4112 in the system framework 411 does not support the sound card of the 4G / 5G network module. If the electronic device 3 uses AOSP as the operating system 41, even if it has a 4G / 5G network module, the sound card of the 4G / 5G network module still cannot be connected and used. However, the call request is usually made through the network and other communication devices. Therefore, in one embodiment, the voice subsystem 43 mainly establishes the channel to connect the sound card port of the 4G / 5G network module and the sound card port of the codec, or to connect the sound card port of the 4G / 5G network module and the sound card port of the HDMI. In this way, the technical problem that the traditional AOSP voice hardware abstraction layer 4112 does not support the sound card of the 4G / 5G network module can be solved.

[0105] However, the above is only one specific implementation example of the present invention. In other embodiments, according to the specified content of the call program, the channel established by the voice subsystem 43 can also be used to connect the sound card port of the codec and the sound card port of HDMI, or to connect different sound card ports of HDMI, etc., without limitation.

[0106] In another embodiment, the input port and output port specified by the call process established by the application 42 belong to the same sound card. In this embodiment, the voice subsystem 43 only needs to establish a single channel to connect the two sound card ports required by the call process (such as Figure 5 By connecting a sound card input port to the same sound card output port through a single channel, a voice loopback mode can be achieved.

[0107] More specifically, in an embodiment where the designated input port and output port belong to the same sound card, the voice subsystem 43 can also carry the required plug-in in the channel to expand the function of the electronic device 3. For example, the user can write an artificial intelligence (AI) voice processing function as a plug-in in the channel. Through the AI ​​voice processing function, the voice subsystem 43 of the present invention can automatically analyze the content of the PCM data after receiving the PCM data from the input port, generate an appropriate response, and then send it through the output port.

[0108] For example, after receiving the serial connection request issued by the voice subsystem 43, the input port of the sound card specified by the call program (such as the input port 4411 of the first sound card) will pass the PCM data of the sound card to the PCM channel of the voice subsystem 43 (such as the first PCM channel 432), and the PCM channel will perform AI voice processing on the received PCM data to generate a corresponding AI voice response. Then, the voice subsystem 43 passes the AI ​​voice response to the output port of the sound card specified by the call program (such as the output port 4412 of the first sound card) through the PCM channel (such as the first PCM channel 432). In this way, the AI ​​voice automatic reply function can be implemented through the electronic device 3.

[0109] To successfully implement the call program, the voice subsystem 43 must confirm that the sound card specified by the call program can be used (ie, the corresponding driver has been run). Therefore, the voice subsystem 43 must first confirm which sound cards are available on the electronic device 3 .

[0110] See also Figure 6 , which is a specific embodiment of the detection flow chart of the present invention. Figure 6 To use for Figure 4 The flowchart is further explained in detail. Figure 6 As shown, after the operating system 41 executes the voice subsystem 43, the voice subsystem 43 will first detect multiple sound card drivers that have been running on the operating system (step S61). If a sound card driver has been running, it means that the physical sound card corresponding to this sound card driver can be used. In addition, the voice subsystem 43 creates a sound card list based on the detection result (step S62).

[0111] The sound card list records multiple sound card drivers / sound cards that have been running on the operating system 41. When establishing a channel, the voice subsystem 43 will refer to the sound card list to determine whether the sound card / sound card port specified by the call program can be used. If the sound card / sound card port specified by the call program cannot be used (for example, it does not exist in the sound card list), the voice subsystem 43 will not establish a channel.

[0112] See also Figure 7, which is a specific embodiment of the status confirmation flow chart of the present invention. As described above, after being executed, the voice subsystem 43 will detect the sound card drivers that have been running on the operating system 41 and establish a sound card list. For example, if the voice subsystem 43 detects that the sound card of the codec, the sound card of the 4G / 5G network module, and the sound card of the HDMI on the operating system 41 are all running, a sound card list such as [card 0:codec; card 1:modem; card 2:HDMI] can be established. In this embodiment, the sound card of the codec is numbered 0, the sound card of the 4G / 5G network module is numbered 1, and the sound card of the HDMI is numbered 2. When a call request is detected, the voice subsystem 43 determines which sound card / sound card port to connect in series to which sound card / sound card port based on the call request and the contents of the sound card list.

[0113] However, the above is only one embodiment of the present invention, and the content of the sound card list is not limited to the above format.

[0114] exist Figure 4 When the service resource checker 431 detects in step S44 that the status of the voice service 411 has changed to a call request, the voice subsystem 43 searches the sound card list for the input port and output port specified by the call request (S71), wherein the input port and output port may belong to the same sound card or different sound cards, depending on the specified content of the call request.

[0115] Next, the voice subsystem 43 checks the voice service 4111 again through the service resource checker 431 to confirm the current status of the two sound card ports specified by the call request (step S72). More specifically, the service resource checker 431 checks the voice service 4111 to confirm whether any of the two sound card ports specified by the call request is occupied by other programs of the operating system 41 (step S73).

[0116] If it is determined in step S73 that any of the designated sound card ports is occupied, the voice subsystem 43 waits and does not establish a channel (step S74). Furthermore, the voice subsystem 43 returns to step S72 to continuously check the voice service 4111 through the service resource checker 431 to confirm the status of the designated sound card port. If it is determined in step S73 that both of the designated sound card ports are not occupied, the voice subsystem 43 may execute Figure 4 The step S45 shown is to establish one or more channels to connect the two designated sound card ports in series, thereby implementing the call procedure corresponding to the call request. As described above, the voice subsystem 43 establishes a channel to connect two sound card ports on the same sound card in series, or establishes two channels to connect two different sound cards in series.

[0117] As described above, the voice subsystem 43 needs to check whether the designated sound card port is occupied before establishing the channel, that is, there may be other programs in the electronic device 3 that need to use the sound card / sound card port (for example, need to play advertisement information through the HDMI sound card or play music through the codec sound card, etc.). Therefore, the voice subsystem 43 can selectively release the designated sound card / sound card port after the call program ends to avoid wasting resources.

[0118] See also Figure 8 , is a specific embodiment of the release flow chart of the present invention. Figure 8 As shown, after the designated sound card port is connected in series through one or more channels and the call process is implemented, the voice subsystem 43 continuously checks the status of the voice service 4111 through the service resource checker 431 (step S81) to confirm whether the call process is ended (step S82). If the content of the voice service 4111 shows that the call process has not ended (for example, the status is still Incalling), the voice subsystem 43 maintains the established channel to continue the call process (step S83), and continuously checks through the service resource checker 431.

[0119] When the service resource checker 431 finds that the status of the voice service 4111 has changed and is displayed as the end of the call process (for example, the status changes from Incalling to No call), the voice subsystem 43 dynamically cancels the established channel (step S84) and releases the two sound card ports connected in series with the channel (step S85). In one embodiment, the voice subsystem 43 closes the two designated sound card ports through instructions established by tinyALSA, thereby releasing the resources of the two sound card ports. In this way, other programs of the operating system 41 can use the two sound card ports.

[0120] Through the technical solution of the present invention, the voice subsystem can freely replace the sound card / sound card port to be connected in series, and even if the electronic device replaces the 4G / 5G network module of a different manufacturer, the user no longer needs to adjust the content of the voice subsystem when connecting the sound card of the 4G / 5G network module in series. In addition, because the sound card transfers data to the voice subsystem itself during the connection, the user can freely add the required plug-ins (plug-in) to the voice subsystem, such as AI voice processing function, automatic speaking function, voice answering service, etc. Moreover, the voice subsystem of the present invention will continue to run in the background of the operating system after startup, and there is no need to use the voice hardware abstraction layer of the system framework of the operating system to connect layer by layer during a call, so a shorter delay time can be achieved.

[0121] The above description is only a preferred specific example of the present invention, and does not limit the patent scope of the present invention. Therefore, all equivalent changes made using the content of the present invention are also included in the scope of the present invention and are hereby stated.

Claims

1. A voice concatenation method implemented on an OS, applied to an electronic device having an operating system, characterized in that: include: a) executing a speech subsystem on the operating system; b) continuously checking the status of a voice service in the system framework of the operating system by a service resource checker of the voice subsystem; and c) When the state of the voice service is determined to be a call request, the voice subsystem establishes a channel to serially connect two sound card ports related to the call request on the operating system to execute a call program corresponding to the call request.

2. The voice concatenation method according to claim 1, characterized in that: Also includes: a1) after step a), the voice subsystem detects a plurality of sound card drivers running on the operating system, wherein each of the sound card drivers corresponds to a sound card of the electronic device; and a2) establishing a sound card list based on the detection result of step a1), wherein the sound card list records a plurality of sound card drivers or a plurality of sound cards that have been running on the operating system.

3. The voice concatenation method according to claim 2, characterized in that: The step c) includes searching the sound card list for a sound card input port and a sound card output port specified by the call request, and establishing the channel to connect the sound card input port and the sound card output port in series.

4. The voice concatenation method according to claim 3, characterized in that: The channel is a PWM channel. The sound card input port of the operating system transmits a PWM data of the corresponding sound card to the PWM channel, and the PWM channel transmits the PWM data to the sound card output port.

5. The voice concatenation method according to claim 4, characterized in that: The sound card input port and the sound card output port belong to the same sound card, and the PWM channel includes a plug-in for AI voice processing function, wherein the call procedure of step c) includes transmitting the PWM data from the sound card input port to the PWM channel, performing the AI ​​voice processing on the PWM data by the PWM channel and generating an AI voice response, and transmitting the AI ​​voice response to the sound card output port by the PWM channel.

6. The voice concatenation method according to claim 3, characterized in that: The sound card input port and the sound card output port belong to two different sound cards respectively.

7. The voice concatenation method according to claim 6, characterized in that: The step c) includes establishing a first pulse code modulation channel and a second pulse code modulation channel by the voice subsystem, wherein the first pulse code modulation channel is connected to a sound card input port of a first sound card and a sound card output port of a second sound card, and the second pulse code modulation channel is connected to the sound card input port of the second sound card and the sound card output port of the first sound card.

8. The voice concatenation method according to claim 3, characterized in that: The electronic device includes at least a codec sound card, an HDMI sound card, and a 4G / 5G network module sound card. The step c) includes establishing the channel to serially connect the sound card port of the 4G / 5G network module with the sound card port of the codec, or to serially connect the sound card port of the 4G / 5G network module with the sound card port of the HDMI.

9. The voice concatenation method according to claim 1, characterized in that: The operating system is AOSP or NUTTX OS.

10. The voice concatenation method according to claim 1, characterized in that: The voice subsystem implements the channel based on the bionic c library, and implements the on / off control of the two sound card ports based on tinyALSA.

11. The voice concatenation method according to claim 1, characterized in that: This step c) comprises: c1) when it is determined that the state of the voice service is the call request, determining whether the two sound card ports specified by the call request are occupied; c2) waiting when at least one of the two sound card ports is occupied; and c3) when the two sound card ports are not occupied, establishing the channel to connect the two sound card ports in series to execute the call program corresponding to the call request.

12. The voice concatenation method according to claim 1, characterized in that: Also includes: d) the service resource checker continuously checks the status of the voice service to determine whether the call process is terminated; e) Maintain the channel until the call process ends; and f) cancel the channel at the end of the call process and release the two sound card ports.

13. A non-transitory storage medium having a computer executable program code recorded thereon, wherein when the computer executable program code is executed by an electronic device, the steps as claimed in claim 1 are executed.