Singing page starting method, computer device and storage medium
By detecting the channel type of the external microphone and starting the corresponding driver, or by using the local channel, the problem of high failure rate when launching the singing page was solved, and the compatibility and success rate of the driver were improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-16
- Publication Date
- 2026-04-07
AI Technical Summary
In traditional methods of launching a karaoke page, the microphone's input and output drivers are prone to mismatch, leading to a high failure rate during startup.
By detecting the audio channel type of the external microphone, the corresponding external audio output and input drivers are activated, or the local audio channel is used when no external channel is detected, ensuring driver compatibility.
This reduces the failure rate of the singing page startup, improves the success rate of the driver, and enhances the reliability of the singing page.
Smart Images

Figure CN116758880B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to an audio playing method, a computer device and a storage medium. BACKGROUND
[0002] With the development of computer technology, a technology for evaluating the singing ability of a user has appeared, for example, a microphone can be externally connected to a device that can play audio, such as a television or a jukebox, and a related assistant software is installed in the device, so that the external sound channel can be used to drive the audio input device and the output device, and the input and output of audio through the microphone can be realized.
[0003] In the traditional technology, the device for playing audio is usually provided with a local sound channel, and the audio input device and the output device are initialized separately in the device initialization process. In this case, whether the local sound channel or the external sound channel is used, the sound input drive and the output drive are opened at the same time, and the singing playing page is entered.
[0004] However, this singing page starting method may cause the sound input drive to be the local sound input drive and the sound output drive to be the external sound output drive after the singing page is started, so that the microphone has sound but cannot be evaluated. The sound input drive may be the external sound input drive and the sound output drive may be the local sound output drive, so that the microphone does not emit sound, but can receive the voice and score. Therefore, the existing singing page starting failure rate is high. SUMMARY
[0005] Therefore, it is necessary to provide a singing page starting method, a computer device and a computer readable storage medium capable of reducing the singing page starting failure rate.
[0006] In a first aspect, the present application provides a singing page starting method applied to a music client, and the method comprises:
[0007] receiving a singing starting request for a target audio, and detecting whether an external sound channel type corresponding to an external microphone is pre-recorded;
[0008] In the case where it is detected that the external sound channel type is pre-recorded, starting an external sound output drive corresponding to an external sound channel represented by the external sound channel type, and an external sound input drive corresponding to the external sound channel;
[0009] start a local sound output driver corresponding to a local sound channel of a terminal device where the music client is located and a local sound input driver corresponding to the local sound channel, in a case where it is detected that the external sound channel type is not pre-recorded;
[0010] play a singing page for the target audio, in a case where the start state of at least one of the external sound output driver and the external sound input driver is start success or the start state of at least one of the local sound output driver and the local sound input driver is start success.
[0011] In one of the embodiments, after the external sound output driver and the external sound input driver corresponding to the external sound channel represented by the external sound channel type are started, the method further comprises: in a case where the start state of at least one of the external sound output driver and the external sound input driver is start failure, re-detecting a sound channel type available for the terminal device; in a case where the re-detected sound channel type represents that there is an external sound channel, recording the re-detected sound channel type and starting the re-detected external sound output driver and the re-detected external sound input driver; and playing the singing page for the target audio, in a case where the start state of the re-detected external sound output driver and the re-detected external sound input driver is start success.
[0012] In one of the embodiments, after the re-detected external sound output driver and the re-detected external sound input driver are started, the method further comprises: in a case where the start state of at least one of the re-detected external sound output driver and the re-detected external sound input driver is start failure, starting the local sound output driver and the local sound input driver.
[0013] In one of the embodiments, after the sound channel type available for the terminal device is re-detected, the method further comprises: in a case where the re-detected sound channel type represents that there is no external sound channel, starting the local sound output driver and the local sound input driver.
[0014] In one of the embodiments, in the case that the start state of at least one of the external sound output driver or the external sound input driver is a start failure, the re-detection of the sound channel type available to the terminal device comprises: in the case that the start state of at least one of the external sound output driver or the external sound input driver is a start failure, presenting a user prompt information matching the current external start failure state; in response to a confirmation operation for re-detecting the sound channel triggered by the user prompt information, re-detecting the sound channel type available to the terminal device; wherein the current external start failure state comprises at least one of the following: the start state of the external sound output driver is a start failure, and the start state of the external sound input driver is a start success; the start state of the external sound output driver is a start success, and the start state of the external sound input driver is a start failure; the start state of the external sound output driver and the external sound input driver is a start failure.
[0015] In one of the embodiments, after the start of the local sound output driver corresponding to the local sound channel of the terminal device where the music client is located and the start of the local sound input driver corresponding to the local sound channel, in the case that the start state of at least one of the local sound output driver or the local sound input driver is a start failure, the method further comprises: presenting a user prompt information matching the current local start failure state; wherein the current local start failure state comprises at least one of the following: the start state of the local sound output driver is a start failure, and the start state of the local sound input driver is a start success; the start state of the local sound output driver is a start success, and the start state of the local sound input driver is a start failure; the start state of the local sound output driver and the local sound input driver is a start failure.
[0016] In one of the embodiments, before the receiving of the singing start request for the target audio, the method further comprises: receiving a start request for the music client, and detecting the sound channel type available to the terminal device; in the case that the sound channel type represents an external sound channel, recording the sound channel type.
[0017] In one of the embodiments, the singing start request is triggered through an audio playing page presented by the music client; before the receiving of the singing start request for the target audio, the method further comprises: in the case that a change in the connection state of the external microphone is detected during the presentation of the audio playing page, re-detecting the sound channel type available to the terminal device; in the case that the re-detected sound channel type represents an external sound channel, recording the re-detected sound channel type.
[0018] In one of the embodiments, after the playing of the singing page for the target audio, the method further comprises: in case that the connection state of the external microphone is detected to change, re-detecting the sound channel type available to the terminal device; in case that the re-detected sound channel type is indicative of the existence of the external sound channel, recording the re-detected sound channel type, and presenting prompt information for prompting whether to sing the target audio again; receiving a request for singing the target audio again triggered based on the prompt information, and returning to the step of detecting whether the external sound channel type corresponding to the external microphone is pre-recorded.
[0019] In a second aspect, the present application further provides a singing page starting device applied to a music client, the device comprising:
[0020] a channel type detection module configured to receive a request for starting singing of a target audio, and detect whether an external sound channel type corresponding to an external microphone is pre-recorded;
[0021] an external drive starting module configured to, in case that the pre-recording of the external sound channel type is detected, start an external sound output drive corresponding to an external sound channel represented by the external sound channel type, and an external sound input drive corresponding to the external sound channel;
[0022] a local drive starting module configured to, in case that the pre-recording of the external sound channel type is not detected, start a local sound output drive corresponding to a local sound channel of a terminal device where the music client is located, and a local sound input drive corresponding to the local sound channel;
[0023] a target audio playing module configured to, in case that the starting state of the external sound output drive and the external sound input drive is both successful, or the starting state of the local sound output drive and the local sound input drive is both successful, play a singing page for the target audio.
[0024] In a third aspect, the present application further provides a computer device. The computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0025] receiving a request for starting singing of a target audio, and detecting whether an external sound channel type corresponding to an external microphone is pre-recorded;
[0026] in case that the pre-recording of the external sound channel type is detected, starting an external sound output drive corresponding to an external sound channel represented by the external sound channel type, and an external sound input drive corresponding to the external sound channel;
[0027] In a case where it is detected that the external sound channel type is not pre-recorded, starting a local sound output driver corresponding to a local sound channel of a terminal device where the music client is located, and a local sound input driver corresponding to the local sound channel;
[0028] In a case where the starting states of the external sound output driver and the external sound input driver are both successful starting, or the starting states of the local sound output driver and the local sound input driver are both successful starting, playing a singing page for the target audio.
[0029] In a fourth aspect, the present application further provides a computer readable storage medium. The computer readable storage medium has a computer program stored thereon, and the computer program is executed by a processor to implement the following steps:
[0030] receiving a singing start request for a target audio, and detecting whether an external sound channel type corresponding to an external microphone is pre-recorded;
[0031] In a case where it is detected that the external sound channel type is pre-recorded, starting an external sound output driver corresponding to an external sound channel represented by the external sound channel type, and an external sound input driver corresponding to the external sound channel;
[0032] In a case where it is detected that the external sound channel type is not pre-recorded, starting a local sound output driver corresponding to a local sound channel of a terminal device where the music client is located, and a local sound input driver corresponding to the local sound channel;
[0033] In a case where the starting states of the external sound output driver and the external sound input driver are both successful starting, or the starting states of the local sound output driver and the local sound input driver are both successful starting, playing a singing page for the target audio.
[0034] In a fifth aspect, the present application further provides a computer program product. The computer program product comprises a computer program, and the computer program is executed by a processor to implement the following steps:
[0035] receiving a singing start request for a target audio, and detecting whether an external sound channel type corresponding to an external microphone is pre-recorded;
[0036] In a case where it is detected that the external sound channel type is pre-recorded, starting an external sound output driver corresponding to an external sound channel represented by the external sound channel type, and an external sound input driver corresponding to the external sound channel;
[0037] start a local sound output driver corresponding to a local sound channel of a terminal device where the music client is located and a local sound input driver corresponding to the local sound channel, in a case where it is detected that the external sound channel type is not pre-recorded;
[0038] play the singing page for the target audio, in a case where the start states of the external sound output driver and the external sound input driver are both start successes or the start states of the local sound output driver and the local sound input driver are both start successes.
[0039] The singing page starting method, device, computer device, storage medium and computer program product, by receiving a singing starting request for a target audio by a music client, detecting whether an external sound channel type corresponding to an external microphone is pre-recorded; in a case where it is detected that the external sound channel type is pre-recorded, starting an external sound output driver corresponding to an external sound channel represented by the external sound channel type and an external sound input driver corresponding to the external sound channel; in a case where it is detected that the external sound channel type is not pre-recorded, starting a local sound output driver corresponding to a local sound channel of a terminal device where the music client is located and a local sound input driver corresponding to the local sound channel; in a case where the start states of the external sound output driver and the external sound input driver are both start successes or the start states of the local sound output driver and the local sound input driver are both start successes, playing the singing page for the target audio. By the present application, when a user initiates a singing starting request, whether an external sound channel type corresponding to an external microphone is pre-recorded is detected by a music client, if the external sound channel type is pre-recorded, an output driver and an input driver corresponding to an external sound channel are started, if the external sound channel type is not pre-recorded, an output driver and an input driver of a local sound channel of a terminal device where the music client is located are started, to realize playing of a singing page for a target audio. By the singing page starting method provided by the present application, the situation that an input driver used is a local sound input driver and an output driver is an external sound output driver or an input driver used is an external sound input driver and an output driver is a local sound output driver after the singing page is started can be avoided, so that the failure rate of starting the singing page can be reduced. BRIEF DESCRIPTION OF DRAWINGS
[0040] Figure 1 a flowchart of a singing page starting method in one embodiment;
[0041] Figure 2 a flowchart of starting a re-detected external sound driver in one embodiment;
[0042] Figure 3A flowchart of recording sound channel type in an embodiment;
[0043] Figure 4 A flowchart of re-detecting sound channel type after playing target audio in an embodiment;
[0044] Figure 5 An audio architecture diagram of a terminal device in an embodiment;
[0045] Figure 6 An audio architecture diagram of a terminal device in another embodiment;
[0046] Figure 7 A song starting flowchart in an embodiment;
[0047] Figure 8 A song starting flowchart in another embodiment;
[0048] Figure 9 A singing starting success rate diagram in an embodiment;
[0049] Figure 10 A singing mode audio preparation success rate diagram in an embodiment;
[0050] Figure 11 A structure block diagram of a singing page starting device in an embodiment;
[0051] Figure 12 An internal structure diagram of a computer device in an embodiment. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.
[0053] In an embodiment, as shown in Figure 1 , a singing page starting method is provided, and the present embodiment takes the method applied to a music client as an example, which includes the following steps:
[0054] Step S101, receiving a singing starting request for target audio, and detecting whether the type of an external sound channel corresponding to an external microphone is recorded in advance.
[0055] In this embodiment, the music client can be an application program for implementing audio playing, for example, can be some singing software, and the target audio is audio information that needs to be played through the music client, for example, can be a music song played through the singing software, and the singing start request is a request triggered by the user to start playing the music song for singing.
[0056] Specifically, when the user needs to start playing music through the music client for singing, the singing start request can be triggered by selecting a song to be sung through the music client, at this time, the music client can receive the singing start request, and take the song to be sung selected by the user as the target audio, and detect whether the sound channel type corresponding to the external microphone has been recorded in advance in the music client, that is, the external sound channel type corresponding to the external microphone.
[0057] Step S102, in the case of detecting that the external sound channel type is recorded in advance, starting the external sound output driver represented by the external sound channel type corresponding to the external sound channel, and the external sound input driver corresponding to the external sound channel.
[0058] The external sound channel refers to the sound channel used by the external microphone, the external sound output driver is the driver for implementing sound output of the external sound channel, and the external sound input driver is the driver for implementing sound input of the external sound channel. In the case that the music client detects that the external sound channel type is recorded in advance, that is, it is represented that the terminal device where the current music client is located can be externally connected with a microphone, at this time, the music client can start the external sound output driver corresponding to the external sound channel, and the external sound input driver corresponding to the external sound channel, so that the external sound output driver and the external sound input driver can be used in pairs in the case that the music client records the external sound channel type in advance.
[0059] Step S103, in the case of detecting that the external sound channel type is not recorded in advance, starting the local sound output driver corresponding to the local sound channel of the terminal device where the music client is located, and the local sound input driver corresponding to the local sound channel.
[0060] The terminal device where the music client is located refers to a terminal device where the music client is installed, which can be a personal computer, a notebook computer, a smart phone, a tablet computer, a television device, and the like. The local sound channel refers to a sound channel of the terminal device for processing sound input or output. For example, if the terminal device where the music client is located is a television device, the local sound channel refers to a sound channel of the television device. The local sound output driver refers to a driver of the local sound channel for sound output, which can be AudioTrack. The local sound input driver refers to a driver of the local sound channel for sound input, which can be AudioFlinger.
[0061] If the music client cannot detect the pre-recorded external sound channel type, it means that the terminal device where the music client is located can not have an external microphone. In this case, the music client can start the local sound output driver corresponding to the local sound channel of the terminal device and the local sound input driver corresponding to the local sound channel, so that the local sound output driver and the local sound input driver can be used in the case where the music client does not record the external sound channel type.
[0062] In step S104, if the starting state of the external sound output driver and the external sound input driver is both successful, or the starting state of the local sound output driver and the local sound input driver is both successful, the singing page for the target audio is played.
[0063] The singing page for the target audio refers to a display page in the music client for a user to perform a singing operation on the target audio. In the display page, the target audio can be played, and the user can perform a singing operation according to the played target audio. If the music client successfully starts the external sound output driver and the external sound input driver in step S102, or the music client successfully starts the local sound output driver and the local sound input driver in step S103, the music client can display the singing page for playing the target audio, and play the target audio in the singing page.
[0064] In the singing page starting method, the music client receives a singing starting request for the target audio, detects whether the external sound channel type corresponding to the external microphone is pre-recorded, starts the external sound output driver corresponding to the external sound channel type and the external sound input driver corresponding to the external sound channel type in the case that the external sound channel type is pre-recorded, starts the local sound output driver corresponding to the local sound channel of the terminal device where the music client is located and the local sound input driver corresponding to the local sound channel in the case that the external sound channel type is not pre-recorded, and plays the singing page for the target audio in the case that the starting states of the external sound output driver and the external sound input driver are both starting success or the starting states of the local sound output driver and the local sound input driver are both starting success. The music client detects whether the external sound channel type corresponding to the external microphone is pre-recorded when the user initiates the singing starting request, and the output driver and the input driver corresponding to the external sound channel are started if the external sound channel type is recorded, or the output driver and the input driver of the local sound channel of the terminal device where the music client is located are started if the external sound channel type is not recorded, to realize the singing page playing of the target audio. The singing page starting method can avoid the case that the sound input driver used is the local sound input driver and the sound output driver is the external sound output driver, or the sound input driver used is the external sound input driver and the sound output driver is the local sound output driver, thereby reducing the singing page starting failure rate.
[0065] In one embodiment, as shown in FIG. 1, after step S102, the method can further include: Figure 2
[0066] Step S201, in the case that the starting state of at least one of the external sound output driver or the external sound input driver is starting failure, re-detecting the sound channel type available for the terminal device.
[0067] If one of the external sound output driver or the external sound input driver fails to start, or both the external sound output driver and the external sound input driver fail to start, it indicates that the external microphone may have connection problems, such as loose connection, and in this case, in order to ensure that the singing page of the target audio can be normally played, the music client can re-detect the sound channel type available for the terminal device, i.e., re-determine whether the external sound channel can be used for the current terminal device, to realize the singing page playing of the target audio.
[0068] Step S202, in case the re-detected sound channel type is indicative of the presence of an external sound channel, record the re-detected sound channel type, and start the re-detected external sound output drive and the re-detected external sound input drive.
[0069] The re-detected external sound output drive can refer to a sound output drive corresponding to the re-detected external sound channel, and the re-detected external sound input drive can refer to a sound input drive corresponding to the re-detected external sound channel. If the re-detected sound channel is still indicative of the presence of an external sound channel, i.e., the current terminal device can use the external sound channel, the music client can record the re-detected sound channel type, and since different external microphones can correspond to different external sound channel types, e.g., microphones of different manufacturers can use different sound channel types for audio input or output, in order to ensure that the music client can start the corresponding external sound output drive and external sound input drive based on the re-detected external sound channel, the music client can also record the re-detected sound channel type, and start the re-detected external sound output drive and the re-detected external sound input drive.
[0070] For example, the pre-recorded external sound channel type can be sound channel type A corresponding to external microphone A, and the music client can start the external sound output drive and the external sound input drive corresponding to sound channel type A. If one of the sound output drive or the sound input drive corresponding to sound channel type A fails to start, the music client can perform re-detection of the sound channel type available to the terminal device at present, and if the user replaces external microphone B, the re-detected sound channel type can be sound channel type B corresponding to external microphone B. In order to ensure the successful start of the external sound output drive, the music client can record the re-detected sound channel type B, and start the external sound output drive and the external sound input drive corresponding to sound channel type B, instead of starting the external sound output drive and the external sound input drive corresponding to sound channel type A, and since the recorded external sound channel type has been updated to sound channel type B, the music client can directly start the external sound output drive and the external sound input drive corresponding to sound channel type B, instead of starting the external sound output drive and the external sound input drive corresponding to sound channel type A, when the target audio is played for singing.
[0071] Step S203, in case the start of the re-detected external sound output drive and the re-detected external sound input drive are both successful, play the singing page for the target audio.
[0072] Finally, if the re-detected external sound output drive and the re-detected external sound input drive are both in the state of successful startup, the music client can play the singing page of the target audio by using the re-detected external sound output drive and the re-detected external sound input drive, so that the smooth playing of the singing page of the target audio can be ensured.
[0073] In the embodiment, if at least one of the external sound output drive or the external sound input drive fails to start up, the music client can re-detect the sound channel type available for the terminal device, and if the re-detected sound channel type still indicates that the external sound channel exists, the re-detected external sound channel can be recorded, and the corresponding external sound output drive and the external sound input drive can be started to play the singing page of the target audio, so that the external sound output drive and the external sound input drive can be successfully started, and the success rate of starting up the external sound output drive and the external sound input drive can be further improved.
[0074] In addition, after step S202, the method can further include: starting the local sound output drive and the local sound input drive in a case where the re-detected external sound output drive or the re-detected external sound input drive fails to start up.
[0075] If one of the re-detected external sound output drive or the re-detected external sound input drive still fails to start up, or both the re-detected external sound output drive and the re-detected external sound input drive fail to start up, if the sound channel type available for the terminal device is detected again, the playing efficiency of the singing page of the target audio can be reduced, so in this case, in order to ensure the playing efficiency of the singing page, the music client can prompt the user that the external microphone is faulty and cannot be used, and stop re-detecting the sound channel type available for the terminal device, and start the local sound output drive and the local sound input drive of the terminal device where the music client is located, so as to play the singing page of the target audio by using the local sound output drive and the local sound input drive.
[0076] In the embodiment, if at least one of the external sound output drive or the external sound input drive fails to start up, and at least one of the re-detected external sound output drive and the re-detected external sound input drive still fails to start up, the music client can stop re-detecting the sound channel type available for the terminal device, and directly start the local sound output drive and the local sound input drive to play the singing page of the target audio, so that the playing efficiency of the singing page of the target audio can be improved.
[0077] Additionally, after step S201, the process may include: if the re-detected audio channel type indicates that there is no external audio channel, starting the local audio output driver and the local audio input driver.
[0078] If the re-detected audio channel type indicates that there is no external audio channel, meaning that the current terminal device has no usable external audio channel, then in order to ensure that the target audio's singing page can play smoothly, the music client can start the local audio output driver and the local audio input driver to play the target audio's singing page, instead of continuing to use the external audio output driver and the external audio input driver.
[0079] In this embodiment, if the re-detected sound channel type indicates that there is no external sound channel, that is, the current terminal device has no usable external sound channel, the music client can start the local sound output driver and the local sound input driver to play the target audio on the singing page, thereby ensuring the smooth playback of the target audio on the singing page and further improving the success rate of starting the singing page.
[0080] In one embodiment, step S201 may further include: if the startup state of at least one of the external audio output driver or the external audio input driver is startup failure, displaying a user prompt message matching the current external startup failure state; in response to a confirmation operation triggered by the user prompt message for re-detecting the audio channel, re-detecting the available audio channel type of the terminal device; wherein the current external startup failure state includes at least one of the following: the startup state of the external audio output driver is startup failure, and the startup state of the external audio input driver is startup success; the startup state of the external audio output driver is startup success, and the startup state of the external audio input driver is startup failure; the startup state of both the external audio output driver and the external audio input driver is startup failure.
[0081] The user notification message indicates the current failure status of the external audio driver. This message can be of three types, corresponding to three different external audio driver failure states: external audio output driver failed to start, but external audio input driver started successfully; external audio output driver started successfully, but external audio input driver failed to start; and both external audio output and external audio input drivers failed to start. For the case where the external audio output driver failed to start, but the external audio input driver started successfully, the user notification message might indicate that the microphone has no sound. For the case where the external audio output driver started successfully, but the external audio input driver failed to start, the user notification message might indicate that the user cannot score. Finally, for the case where both external audio output and external audio input drivers failed to start, the user notification message might indicate that the microphone has no sound and the user cannot score.
[0082] After displaying the user prompt, the user can check the microphone according to the prompt and click to confirm the displayed prompt, thereby triggering a confirmation operation for the music client to re-detect the available sound channels. The music client can then respond to the confirmation operation and perform the step of re-detecting the available sound channel types of the terminal device.
[0083] In this embodiment, when at least one of the external sound output driver or external sound input driver fails to start, the music client can also display corresponding user prompt information to inform the user of the current external startup failure status. Only after the user confirms the operation will the step of re-detecting the available sound channel type of the terminal device be executed. This allows the user to understand the current external startup failure status and handle the fault in a targeted manner, thereby improving the efficiency of handling external startup failure status.
[0084] In one embodiment, after step S103, the method may further include: if the startup state of at least one of the local sound output driver or the local sound input driver is startup failed, displaying a user prompt message matching the current local startup failure state; wherein the current local startup failure state includes at least one of the following: the startup state of the local sound output driver is startup failed, and the startup state of the local sound input driver is startup successful; the startup state of the local sound output driver is startup successful, and the startup state of the local sound input driver is startup failed; or the startup states of both the local sound output driver and the local sound input driver are startup failed.
[0085] In this embodiment, the user prompt message can also be used to inform the user of the current local sound driver startup failure status. This user prompt message can include three types, corresponding to three different local startup failure states: local sound output driver startup failure, but local sound input driver startup success; local sound output driver startup success, but local sound input driver startup failure; and both local sound output driver and local sound input driver startup failure. Specifically, for the startup failure state where the local sound output driver fails to start but the local sound input driver starts successfully, the displayed user prompt message can be a message indicating a problem with the sound output device. For the startup failure state where the external sound output driver starts successfully but the external sound input driver fails to start, the displayed user prompt message can be a message indicating a problem with the sound input device. And for the startup failure state where both local sound output driver and local sound input driver startup fail, the displayed user prompt message can be a message indicating a problem with both the sound output device and the sound input device.
[0086] In this embodiment, if at least one of the local sound output driver or local sound input driver fails to start, the music client can also display corresponding user prompt information to inform the user of the current local startup failure status. This allows the user to understand the current local startup failure status, thereby improving the efficiency of local sound device fault handling.
[0087] In one embodiment, such as Figure 3 As shown, before step S101, the following may also be included:
[0088] Step S301: Receive a startup request for the music client and detect the available audio channel types on the terminal device.
[0089] A music client launch request refers to a user-triggered request to launch the music client. This could be triggered when a user opens a karaoke app. The music client can then receive this launch request and detect the types of audio channels currently available on the device, specifically whether an external microphone is connected.
[0090] Step S302: If the audio channel type is characterized as having an external audio channel, record the audio channel type.
[0091] If the available audio channel type on the terminal device indicates the presence of an external audio channel, meaning the terminal device has an external microphone, the music client can record this audio channel type. Then, when the user triggers a request to start singing for the target audio, since the audio channel type corresponding to the external microphone has already been recorded (i.e., the external audio channel type is recorded), the corresponding external audio output driver and external audio input driver can be activated. This allows the playback of the target audio's singing page to be achieved through the external audio output and external audio input drivers, eliminating the need to detect and record the available audio channel type on the terminal device every time singing is initiated. This further reduces the risk of audio channel opening failure and improves the efficiency of starting singing.
[0092] In this embodiment, the music client can perform detection of the available audio channel types of the terminal device at startup, and record the audio channel type of the external audio channel if an external audio channel is detected. Therefore, the music client does not need to perform detection and recording of the available audio channel types of the terminal device every time singing starts, thereby further reducing the risk of audio channel opening failure and improving the efficiency of singing starts.
[0093] In addition, the request to start singing is triggered through the audio playback page displayed by the music client; before step S101, it may also include: if the connection status of an external microphone changes during the display of the audio playback page, re-detecting the available sound channel type of the terminal device; if the re-detected sound channel type indicates that an external sound channel exists, recording the re-detected sound channel type.
[0094] In this embodiment, the singing start request can be triggered by the user on the audio playback page displayed in the music client. After the user launches the music client, the music client can display the audio playback page, which can display an audio list. The audio list can contain multiple audio songs that can be used to start singing. The user can select the target audio by selecting an audio song from the audio list and trigger the singing start request for the target audio.
[0095] Subsequently, if the user plugs or unplugs an external microphone during the audio playback page display, thus changing the connection status of the external microphone, the music client can re-detect the available audio channel types of the terminal device to ensure the accuracy of the currently available audio channel types. If the re-detected audio channel type indicates the existence of an external audio channel, the audio channel type of the re-detected external audio channel can be recorded. This allows the corresponding audio output and input drivers to be activated based on the audio channel after the external microphone plug-and-unplug operation when singing to the target audio, further improving the real-time accuracy of the recorded external audio channel type.
[0096] In this embodiment, if the connection status of an external microphone changes during the display of the audio playback page, the available audio channel type of the terminal device can be re-detected. If the re-detected audio channel type indicates the existence of an external audio channel, the re-detected audio channel type is recorded. This allows the corresponding audio output driver and audio input driver to be started based on the audio channel after the external microphone plug-in / unplug operation, further improving the real-time accuracy of the recorded external audio channel type.
[0097] In one embodiment, such as Figure 4 As shown, after step S103, the following may also be included:
[0098] Step S401: If the connection status of the external microphone is detected to have changed, the available audio channel types of the terminal device are re-detected.
[0099] If, after playing a singing page for the target audio, the music client detects a change in the connection status of the external microphone—for example, if the external microphone connection becomes loose after playing the target audio, or if the user replaces the external microphone—the music client can also re-detect the available audio channel types on the terminal device.
[0100] Step S402: If the re-detected sound channel type indicates the presence of an external sound channel, record the re-detected sound channel type and display a prompt message indicating whether to repeat the target audio.
[0101] If the re-detected audio channel type indicates the presence of an external audio channel, the music client can also record the re-detected audio channel type. Meanwhile, since the target audio is already playing, changes in the microphone connection status may affect the user's singing process. Therefore, in this case, the music client can also display a prompt message to ask the user whether they need to re-sing the target audio. For example, it can display a prompt message asking the user whether the microphone hardware has been plugged in or unplugged, which may affect singing, and whether they want to re-sing the target audio.
[0102] Step S403: Receive a request to repeat the target audio based on the prompt information, and return to execute step S101.
[0103] Subsequently, if the user selects a request to repeat the target audio based on the displayed prompt, this request can be triggered by a control selected in the prompt. For example, the prompt may display a control indicating whether to repeat the audio. If the user selects the control indicating that the target audio needs to be repeated, the request to repeat the audio can be triggered. At this time, the music client can again execute the step of checking whether the external sound channel type corresponding to the external microphone is pre-recorded, and then play the singing page for the target audio again.
[0104] If the user selects not to repeat the target audio based on the displayed prompts, such as a control indicating that the target audio should not be repeated, the music client will continue playing the singing page of the target audio without performing a replay of the target audio.
[0105] In this embodiment, if a change in the connection status of an external microphone is detected during the playback of the target audio, the available sound channel type of the terminal device can be re-detected, and a prompt message can be displayed to ask the user whether to repeat the target audio. If the user chooses to repeat the target audio, the process of detecting whether the external sound channel type corresponding to the external microphone is pre-recorded can be executed again to realize the replay of the target audio, thereby allowing the user to repeat the target audio and further improving the intelligence of the target audio playback.
[0106] In one embodiment, a method for activating a sound input device and an output device when singing in a terminal device is also provided, which can solve the problem of low activation success rate of sound input devices and output devices in traditional technologies.
[0107] In traditional technologies, the audio architecture used in terminal devices can be as follows: Figure 5As shown, without connecting an external microphone, the device's built-in microphone is used as the sound input. The system's AudioRecord is used to receive data from the sound device for use by the singing software. The accompaniment data is transmitted through AudioTrack and then through AudioFlinger to the sound output device for playback, which can meet the basic singing capabilities of the singing software.
[0108] If an external microphone is connected to the terminal device, the microphone manufacturer will pre-install microphone assistant software on the terminal device to handle microphone sound input and output. Therefore, the sound input and output architecture of the singing software is similar to... Figure 5 The architecture shown is different, as can be seen from Figure 6 As shown.
[0109] In response to the above Figure 6 The architecture shown in the prior art involves separately initializing the sound output and input devices. Regardless of whether the system's or a third-party microphone's sound channel is used, it is treated as an output or input device for activation. The song playback process can be as follows: Figure 7 As shown, during playback initiation, the supported third-party audio channel types are polled, and the third-party output drivers are initialized. If the third-party audio output drivers are successfully opened, the process of polling the supported third-party audio channel types and initializing the third-party input drivers begins. If the third-party audio output drivers fail to open, AudioTrack is opened, and if AudioTrack is successfully opened, the process of initializing the third-party input drivers begins. Subsequently, if the third-party audio input drivers are successfully opened, audio playback begins; if they fail to open, AudioRecord is opened, and if AudioRecord is successfully opened, audio playback begins.
[0110] The above process may encounter issues such as the audio output using a third-party audio channel driver, but the input driver for the third-party audio channel failing to open, resulting in the system audioRecord being used for audio input. However, the audioRecord cannot receive human voices, ultimately resulting in the microphone producing sound, but the app being unable to score or save. Alternatively, the output driver for the third-party audio channel failing to open, thus using the system audioTrack, but the input driver for the third-party audio channel successfully opening, ultimately causing the microphone to not produce sound, although the app can receive human voices and score. Furthermore, each time an audio channel is opened, polling and initialization are required, increasing the risk of audio channel opening failures and causing a high number of playback failures.
[0111] Therefore, traditional playback processes often fail multiple times. This embodiment proposes a compatible processing method for third-party and system audio channels, ensuring users ultimately receive a valid audio input and output method. Regardless of whether it's the system or a third party, this embodiment uses paired initialization and driver activation principles to ensure that outputs and inputs of the same type appear in pairs, avoiding mismatched outputs and inputs between third parties and the system, thus improving the usability and robustness of the audio channels.
[0112] Furthermore, in this embodiment, when a user sings, the app receives the vocals and provides corresponding scoring and MIDI matching. This solution improves the overall singing experience; the microphone produces sound, and the app provides scoring. The specific process is as follows: Figure 8 As shown, it includes the following steps:
[0113] (1) When starting playback, first determine whether there is a third-party microphone manufacturer's audio channel type recorded last time. If so, directly open the corresponding third-party audio channel's output and input drivers according to the recorded type.
[0114] (2) When opening the output and input drivers of the sound channel, since it involves the call of third-party processes, timeout logic and exception capture are added to throw errors in time and prevent the App process from freezing.
[0115] (3) If either the sound output or input driver fails to open, the user will be given a corresponding prompt based on the output or input type. If the output driver fails to open, the microphone will not output any sound; if the input driver fails to open, the user will not be able to score or save the work.
[0116] (4) Next, the audio channel type detection will be redone, and then the output and input drivers will be opened again.
[0117] (5) If the second attempt still fails, the user will be prompted that the App will use the system’s AudioTrack and AudioRecord to complete the construction of the sound output and input modules.
[0118] (6) Finally, regardless of whether a three-way audio channel or the system's audio output and input modules are used, ensure that there is an effective solution available to the user.
[0119] Through this embodiment, as Figure 9 and Figure 10 As shown, Figure 9 This is a schematic diagram illustrating the success rate of singing playback in one embodiment. Figure 10 This is a schematic diagram of the audio preparation success rate in the singing mode in one embodiment. It can be seen that the success rate of singing start-up and audio preparation is significantly improved, the probability of the microphone not producing sound and being unable to score is reduced, and the success rate of starting the sound input device and the output device is also significantly improved.
[0120] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0121] Based on the same inventive concept, this application also provides a singing page launch device for implementing the singing page launch method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more singing page launch device embodiments provided below can be found in the limitations of the singing page launch method described above, and will not be repeated here.
[0122] In one embodiment, such as Figure 11 As shown, a singing page launch device is provided for use in a music client, including: a channel type detection module 1101, an external driver launch module 1102, a local driver launch module 1103, and a target audio playback module 1104, wherein:
[0123] The channel type detection module 1101 is used to receive a singing start request for the target audio and detect whether the external sound channel type corresponding to the external microphone is pre-recorded.
[0124] The external driver startup module 1102 is used to start the external sound output driver corresponding to the external sound channel characterized by the external sound channel type and the external sound input driver corresponding to the external sound channel when a pre-recorded external sound channel type is detected.
[0125] The local driver startup module 1103 is used to start the local sound output driver corresponding to the local sound channel of the terminal device where the music client is located, and the local sound input driver corresponding to the local sound channel, when it is detected that no external sound channel type has been pre-recorded.
[0126] The target audio playback module 1104 is used to play a singing page for the target audio when both the external sound output driver and the external sound input driver are successfully started, or when both the local sound output driver and the local sound input driver are successfully started.
[0127] The modules in the aforementioned singing page launch device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0128] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 12 As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When executed by the processor, the computer program implements a method for launching a singing page. The display screen can be an LCD screen or an e-ink display screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.
[0129] Those skilled in the art will understand that Figure 12 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0130] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0131] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0132] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0133] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0134] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0135] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0136] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for launching a singing page, characterized in that, Applied to music clients, the method includes: Receive a singing start request for the target audio and check if the external audio channel type corresponding to the external microphone is pre-recorded; If the external audio channel type is detected to be pre-recorded, the external audio output driver corresponding to the external audio channel represented by the external audio channel type and the external audio input driver corresponding to the external audio channel are started. If it is detected that the type of the external sound channel is not pre-recorded, the local sound output driver corresponding to the local sound channel of the terminal device where the music client is located, and the local sound input driver corresponding to the local sound channel are started. If both the external sound output driver and the external sound input driver are successfully started, or if both the local sound output driver and the local sound input driver are successfully started, play the singing page for the target audio.
2. The method according to claim 1, characterized in that, After activating the external audio output driver corresponding to the external audio channel characterized by the external audio channel type, and the external audio input driver corresponding to the external audio channel, the method further includes: If the startup status of at least one of the external audio output driver or the external audio input driver is a startup failure, the available audio channel type of the terminal device shall be re-detected; If the re-detected audio channel type indicates the presence of an external audio channel, record the re-detected audio channel type and start the re-detected external audio output driver and the re-detected external audio input driver. If both the re-detected external audio output driver and external audio input driver are successfully started, play the singing page for the target audio.
3. The method according to claim 2, characterized in that, After activating the re-detected external audio output driver and the re-detected external audio input driver, the method further includes: If the startup status of at least one of the re-detected external audio output driver or the re-detected external audio input driver is a startup failure, the local audio output driver and the local audio input driver are started.
4. The method according to claim 2, characterized in that, After re-detecting the available audio channel types of the terminal device, the method further includes: If the re-detected audio channel type indicates that there is no external audio channel, the local audio output driver and the local audio input driver are activated.
5. The method according to claim 2, characterized in that, If the startup state of at least one of the external audio output driver or the external audio input driver is a startup failure, the method of re-detecting the available audio channel type of the terminal device includes: If the startup status of at least one of the external sound output driver or the external sound input driver is a startup failure, a user prompt message matching the current external startup failure status will be displayed. In response to the confirmation operation triggered by the user prompt message, the available audio channel types of the terminal device are re-detected; The current external startup failure status includes at least one of the following: The external audio output driver is in a startup failure state, while the external audio input driver is in a startup success state. The external audio output driver is in a successful startup state, while the external audio input driver is in a failed startup state. Both the external audio output driver and the external audio input driver are in the startup failure state.
6. The method according to claim 1, characterized in that, After activating the local audio output driver corresponding to the local audio channel of the terminal device where the music client is located, and the local audio input driver corresponding to the local audio channel, the method further includes: If the startup status of at least one of the local sound output driver or the local sound input driver is a startup failure, display a user prompt message that matches the current local startup failure status. The current local startup failure status includes at least one of the following: The startup status of the local sound output driver is "startup failed," while the startup status of the local sound input driver is "startup successful." The local sound output driver is in a successful startup state, while the local sound input driver is in a failed startup state. Both the local sound output driver and the local sound input driver are in the startup status of failed startup.
7. The method according to claim 1, characterized in that, Before receiving the singing start request for the target audio, the method further includes: Receive a startup request for the music client and detect the available audio channel types on the terminal device; If the audio channel type indicates the presence of an external audio channel, the audio channel type is recorded.
8. The method according to claim 7, characterized in that, The singing start request is triggered by the audio playback page displayed by the music client; before receiving the singing start request for the target audio, the process also includes: If a change in the connection status of the external microphone is detected during the display of the audio playback page, the available audio channel types of the terminal device are re-detected. If the re-detected audio channel type indicates the presence of an external audio channel, the re-detected audio channel type is recorded.
9. The method according to claim 1, characterized in that, After playing the singing page for the target audio, the method further includes: If a change in the connection status of the external microphone is detected, the available audio channel types of the terminal device will be re-detected; If the re-detected audio channel type indicates the presence of an external audio channel, record the re-detected audio channel type and display a prompt message indicating whether to repeat the target audio. Upon receiving a request to repeat the target audio triggered by the prompt information, return to the step of checking whether the external audio channel type corresponding to the external microphone has been pre-recorded.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 9.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Display equipment and method for playing music in terminal
CN111343489A
Portable web karaoke
KR200167121Y1