Audio routing method, device and electronic device
By receiving the output request of the audio signal and judging the existence of a custom audio output device in the system, dynamically specifying the audio output device to establish an audio output channel, solving the problem of not being fixed or dynamically changing the number of audio output devices in the prior art, and achieving flexible audio routing.
Patent Information
- Application Number
- CN202211033874.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-26
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2042-08-26
AI Technical Summary
The prior art cannot adapt to the number of audio output devices that are not fixed or dynamically alterable, resulting in the inability to effectively route audio.
By receiving the output request of the audio signal, it is determined whether there is a custom audio output device, and a designated audio output device is established according to the output request of the audio signal, and selected from the custom audio output device and the native audio output device.
After adding any number of customized audio output devices in the system, it is possible to dynamically find the corresponding audio output devices and establish an audio output channel to meet various audio output needs.
Smart Images

Figure CN115412806B_ABST
Abstract
Description
Technical Field
[0001] The present invention mainly relates to the technical field of audio and video output, and in particular to an audio routing method, device and electronic equipment. Background Art
[0002] With the development of technology, smart devices have more and more uses and more and more complex functions. The audio and video output of smart devices is not limited to a single video output and a single audio output. For example, some smart devices include multiple sub-screens and sub-speakers in addition to the main display and main speaker. A smart device can be connected to multiple screens and can display different content on multiple screens according to the user's intention. Each screen can also be equipped with a corresponding speaker to output the corresponding audio content; of course, the display and speaker can also output related content independently.
[0003] Smart devices have penetrated into various application fields, and multi-video and multi-audio outputs are becoming more and more popular. There are more and more requirements for a smart device to take into account different scenarios at the same time. For example, smart devices in catering stores include counter hosts, door advertising screens, kitchen notification speakers, lobby broadcast speakers, and voice prompt speakers for each table, etc. Users of smart devices need to play different audio content for different speakers at different times or at the same time.
[0004] In the existing general audio routing strategy, audio output is achieved by specifying an audio output device, but this method can only specify a single native audio output device, and cannot specify output to a custom audio output device (an audio output device added later). There are also methods in the related art for configuring custom audio output devices and corresponding routing rules, but this configuration method can only configure a known number of audio output devices, that is, the number of added custom audio output devices is fixed, and cannot be configured for audio systems with an unfixed number or a dynamically changeable number. Therefore, the relevant audio routing strategy or routing control method cannot adapt to the audio output situation when the audio output device is uncertain. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide an audio routing method, device and electronic device to solve the problem of audio routing in a system in which the number of audio output devices is not fixed or the number of audio output devices can be dynamically changed.
[0006] In a first aspect, the present invention provides an audio routing method, comprising receiving an output request for an audio signal; wherein the audio signal comprises an independent audio signal and an audio signal in multimedia, and the output request comprises a request to establish an audio output channel; determining whether there is a custom audio output device; wherein the custom audio output device is an audio output device other than a native audio output device of the system, and each custom audio output device has a unique identifier, and the identifier is used to identify the custom audio output device corresponding thereto; if there is the custom audio output device, establishing an audio output channel according to the audio output device specified by the output request of the audio signal; wherein the audio output device is selected from the custom audio output device and the native audio output device.
[0007] Optionally, before receiving the output request of the audio signal, the method includes: if the custom audio output device exists, adding a unique identifier to each of the custom audio output devices.
[0008] Optionally, determining whether there is a custom audio output device further includes: if the custom audio output device does not exist, performing general audio routing; wherein the general audio routing is to perform audio routing using an audio routing rule provided by the system.
[0009] Optionally, the method further includes: if the output request of the audio signal does not specify an audio output device, performing general audio routing; wherein the general audio routing is to perform audio routing using audio routing rules provided by the system.
[0010] Optionally, the native audio output device includes a main speaker, an earpiece and headphones, and the custom audio output device includes an external speaker.
[0011] Optionally, after performing universal audio routing, the method includes: determining whether the result of the universal audio routing includes the main speaker in the native audio output device; if the result of the universal audio routing includes the main speaker in the native audio output device, establishing the audio output channel respectively according to the native audio output device and all the custom audio output devices in the universal audio routing result.
[0012] Optionally, determining whether the result of the universal audio routing includes the main speaker in the native audio output device further includes: if the result of the universal audio routing does not include the main speaker in the native audio output device, establishing the audio output channel according to the native audio output device in the result of the universal audio routing.
[0013] Optionally, after receiving an output request for an audio signal and before determining whether there is a custom audio output device, the method includes: determining whether there is a playback video; if there is no playback video, then determining whether there is a custom audio output device.
[0014] Optionally, determining whether there is a playback video also includes: if the playback video exists, determining whether the playback video is multi-screen display; if the playback video is not multi-screen display, determining whether there is the custom audio output device; wherein, the multi-screen display indicates that the playback video is not displayed on all display screens at the same time.
[0015] Optionally, determining whether the played video is multi-screen with different displays also includes: if the played video is multi-screen with different displays, determining whether the output request of the audio signal specifies the audio output device; if the output request of the audio signal specifies the audio output device, then determining whether there is the custom audio output device.
[0016] Optionally, determining whether the output request of the audio signal specifies the audio output device further includes: if the output request of the audio signal does not specify the audio output device, identifying the display screen on which the video is played, and using the audio output device corresponding to the display screen on which the video is played as the designated audio output device.
[0017] Optionally, after establishing the audio output channel, the method includes: binding the audio signal to the audio output device corresponding to the audio output channel.
[0018] In a second aspect, the present invention provides an audio routing device, comprising: a receiving module, used to receive an output request for an audio signal; wherein the audio signal comprises an independent audio signal and an audio signal in multimedia, and the output request comprises a request to establish an audio channel; a judging module, used to judge whether there is a custom audio output device; wherein the custom audio output device is an audio output device other than a native audio output device of the system, and each of the custom audio output devices has a unique identifier, and the identifier is used to identify the custom audio output device corresponding thereto; an establishing module, used to establish an audio output channel according to the audio output device specified by the output request of the audio signal if there is the custom audio output device; wherein the audio output device is selected from the custom audio output device and the native audio output device.
[0019] In a third aspect, the present invention provides an electronic device, comprising: a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the audio routing method described in the first aspect are implemented.
[0020] In a fourth aspect, the present invention provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the audio routing method described in the first aspect are implemented.
[0021] Compared with the prior art, the present invention has the following advantages: after adding any number of custom audio output devices to the system, dynamic audio routing methods such as designated or general routing can be used to find the corresponding audio output devices and establish audio output channels. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The accompanying drawings are included to provide a further understanding of the present application. They are included and constitute a part of the present application. The accompanying drawings illustrate embodiments of the present application and together with the present specification serve to explain the principles of the present application. In the accompanying drawings:
[0023] Figure 1 It is a flowchart of an audio routing method according to an embodiment of the present invention;
[0024] Figure 2 is a flowchart of an audio routing method according to another embodiment of the present invention;
[0025] Figure 3 is a flowchart of an audio routing method according to another embodiment of the present invention;
[0026] Figure 4 is a flowchart of an audio routing method according to another embodiment of the present invention;
[0027] Figure 5 is a structural diagram of an audio routing device in an embodiment of the present invention;
[0028] Figure 6 is a structural schematic diagram of an audio routing device in another embodiment of the present invention;
[0029] Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0030] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for the description of the embodiments. Obviously, the drawings described below are only some examples or embodiments of the present application. For ordinary technicians in this field, the present application can also be applied to other similar scenarios based on these drawings without creative work. Unless it is obvious from the language environment or otherwise explained, the same reference numerals in the figures represent the same structure or operation.
[0031] As shown in this application and claims, unless the context clearly indicates an exception, the words "a", "an", "an" and / or "the" do not refer to the singular and may also include the plural. Generally speaking, the terms "include" and "comprise" only indicate the inclusion of the steps and elements that have been clearly identified, and these steps and elements do not constitute an exclusive list. The method or device may also include other steps or elements.
[0032] It should be noted that the use of words such as "first" and "second" to define components is only for the convenience of distinguishing the corresponding components. If not otherwise stated, the above words have no special meaning and cannot be understood as limiting the scope of protection of this application. In addition, although the terms used in this application are selected from well-known and commonly used terms, some terms mentioned in the specification of this application may be selected by the applicant at his or her discretion, and their detailed meanings are explained in the relevant parts of the description of this article. In addition, it is required to understand this application not only by the actual terms used, but also by the meaning implied by each term.
[0033] Flowcharts are used in the present application to illustrate the operations performed by the system according to the embodiments of the present application. It should be understood that the preceding or following operations are not necessarily performed accurately in order. On the contrary, various steps may be processed in reverse order or simultaneously. At the same time, other operations may be added to these processes, or one or more operations may be removed from these processes.
[0034] Embodiment 1
[0035] Figure 1 FIG. 1 is a flow chart of an audio routing method according to an embodiment of the present invention. Figure 1 , the method 100 comprises:
[0036] S110, receiving an output request for an audio signal; wherein the audio signal includes an independent audio signal and an audio signal in multimedia, and the output request includes a request to establish an audio output channel.
[0037] There are many types of audio signals, the most common ones are ringtones, voice, music and calls, etc. These audio signals are independent audio signals, and there are also some audio signals in multimedia, for example, audio signals in videos. The user operates through the application interface, and if he wants to output the relevant audio signal through the corresponding audio output device, he needs to establish an audio output channel. That is, it is necessary to send a request to establish an audio output channel, and determine the final output terminal of the audio signal according to the output request of the audio signal. For example, in the case where the system only has a native audio output device, some common output requests for audio signals are: the sound in music and video is generally output from the speaker, and the sound of calls is generally output from the earpiece. If headphones are detected, the sound in music, video and call sounds are generally output from the headphones. It should be noted that the system mentioned in this embodiment and subsequent embodiments can be an intelligent device with a native audio output device or an intelligent device with both a native audio output device and a custom audio output device.
[0038] S120, determining whether there is a custom audio output device; wherein the custom audio output device is an audio output device other than the system native audio output device, and each of the custom audio output devices has a unique identifier, and the identifier is used to identify the corresponding custom audio output device.
[0039] Generally, the system is configured with relevant audio output devices, i.e., native audio output devices, when it leaves the factory or is sold, and is configured with commonly used audio routing rules by default. However, as the performance of the system gradually increases, the external devices that can be expanded are becoming more and more abundant, especially in some commercial services, which often expand more external audio output devices, i.e., custom audio output devices. For example, external audio output devices such as speakers and amplifiers. In this embodiment, whether the system has a custom audio output device will affect the audio signal routing method. Therefore, it is necessary to judge whether the system has a custom audio output device to determine the corresponding audio signal routing method. In this embodiment, each custom audio output device has a unique identifier, which is used to identify the custom audio output device corresponding to it.
[0040] S130: If the custom audio output device exists, establish an audio output channel for the audio output device specified by the output request of the audio signal; wherein the audio output device is selected from the custom audio output device and the native audio output device.
[0041] In this embodiment, when the system has a custom audio output device, such as the system has an external speaker, at this time, the audio output device of the entire system includes the system native audio output device and the custom audio output device, and then the audio output channel is established according to the audio signal output request of the specified audio output device, and the specified audio output device is derived from the custom audio output device or the native audio output device. For example, an Android device, the default supported common native audio output devices include the main speaker (different from the external speaker), the receiver, the earphone, etc., if the system adds three custom audio output devices A, B and C (external speakers). According to the above audio output configuration, when playing a section of audio, the user specifies the output to the external speaker A and the external speaker B and the system native main speaker through the API (Application Program Interface), then the audio signal is output to the external speaker A, the external speaker B and the main speaker according to this specification. Those skilled in the art should be able to understand that the user can have other specified methods according to actual needs, and no specific restrictions are made here.
[0042] In an optimized implementation, before receiving an output request for an audio signal, if the system has a custom audio output device, a unique identifier is added to each custom audio output device, and the identifier is used to identify the custom audio output device corresponding to the custom audio output device. Schematically, the identifier of the custom audio output device can be expressed in the form of a parameter. When the system has a custom audio output device, it adds a unique identifier to each custom audio output device, so that each custom audio output device is identifiable and unique, and can be applied to the user's audio signal output specification.
[0043] In a possible implementation, if the system does not have a custom audio output device, general audio routing is performed, wherein the general audio routing is to use the audio routing rules provided by the system for audio routing. That is, after judgment, in the absence of a custom audio output device, the system performs audio routing according to the default, general audio routing method.
[0044] A brief description of general audio routing is as follows: For an Android device, the default supported common audio output devices include speakers (main speakers), receivers, and headphones. 1. The sound in music and videos is usually output from the speakers. If the system detects that the system is connected to headphones, it is output from the headphones. 2. Calls are usually output from the receiver. If the system detects that the system is connected to headphones, it is output from the headphones. If the hands-free function is used, it is output from the speakers. 3. Incoming ringtones and alarms are output from the speakers. If the system detects that the system is connected to headphones, the speakers and headphones are output at the same time.
[0045] In a possible implementation, after the audio output channel is established, the audio signal is bound to an audio output device corresponding to the audio output channel, and the audio signal is output.
[0046] The audio routing method provided in this embodiment can use dynamic audio routing methods such as specified or general routing to find the corresponding audio output device and establish an audio output channel after any number of custom audio output devices are added to the system.
[0047] Embodiment 2
[0048] Figure 2 FIG. 1 is a flow chart of an audio routing method according to another embodiment of the present invention. Figure 2 , the method 200 comprises:
[0049] S110, receiving an output request for an audio signal, wherein the audio signal includes an independent audio signal and an audio signal in multimedia, and the output request includes a request to establish an audio output channel. The detailed description of this step has been described above and will not be repeated here.
[0050] S120, determining whether there is a custom audio output device; wherein the custom audio output device is an audio output device other than the system's native audio output device, and each custom audio output device has a unique identifier, and the identifier is used to identify the custom audio output device corresponding thereto. The detailed description of this step has been described before and will not be repeated here.
[0051] S210: If the custom audio output device exists and the output request of the audio signal does not specify an audio output device, general audio routing is performed; wherein the general audio routing is to perform audio routing using the audio routing rules provided by the system.
[0052] In this embodiment, although the system has a custom audio output device, the user has not specified a corresponding audio output device. At this time, the system performs general audio routing, that is, uses the system's own audio routing rules for audio routing.
[0053] In a possible implementation, the custom audio output device is used as a function extension of the main speaker. In this case, the native audio output device generally includes a main speaker, a receiver, and a headset, and the custom audio output device includes an external speaker.
[0054] After general audio routing is performed, determine whether the result of general audio routing includes the main speaker in the native audio output device. If the result of general audio routing includes the main speaker in the native audio output device, establish audio output channels according to the native audio output device and all custom audio output devices in the general audio routing result. For example, the system adds three custom audio output devices (external speakers) A, B, and C. When playing an audio (such as a ringtone), the user does not specify an audio output device. The system will use the default audio routing (general audio routing) method for audio routing and then check the audio routing result. If the audio routing result includes the main speaker, plus the custom audio output device that is an extension of the main speaker function, the final audio output result is the main speaker, external speaker A, external speaker B, and external speaker C. If the result of general audio routing does not include the main speaker in the native audio output device, establish audio output channels according to the native audio output device in the general audio routing result. For example, the system adds three custom audio output devices (external speakers) A, B, and C. When playing an audio clip (such as music played when headphones are connected), if the user does not specify an audio output device, the system will use the default audio routing (general audio routing) method for audio routing and then check the audio routing results. If the result of the general audio routing is headphones and does not include the main speaker, the system will directly establish an audio output channel for the headphones in the general audio routing result, and will not establish an audio output channel with the external speaker.
[0055] In a possible implementation, after the audio output channel is established, the audio signal is bound to an audio output device corresponding to the audio output channel, and the audio signal is output.
[0056] The audio routing method provided in this embodiment, when the system has a custom audio output device, still adopts a general audio routing method when no audio output device is specified, and finds the corresponding audio output device and establishes an audio output channel according to the association relationship between the main speaker and the custom audio output device.
[0057] Embodiment 3
[0058] Figure 3 FIG. 1 is a flow chart of an audio routing method according to another embodiment of the present invention. Figure 3 , the method 300 comprises:
[0059] S110, receiving an output request for an audio signal, wherein the audio signal includes an independent audio signal and an audio signal in multimedia, and the output request includes a request to establish an audio output channel. The detailed description of this step has been described above and will not be repeated here.
[0060] S310, determining whether there is a playing video; if there is no playing video, determining whether there is the custom audio output device.
[0061] As mentioned above, audio signals include independent audio signals and audio signals in multimedia, such as audio signals in videos. Although audio signals can exist independently, they can establish audio routing channels according to corresponding audio routing rules. However, in most cases, if there is video playback in the current system, the output audio signal is likely to be audio associated with the played video. Therefore, after receiving an output request for an audio signal, it can be determined whether there is a played video in the current system. If there is no played video, at this time, the audio signal is output as an independent output, and then it is determined whether there is a custom audio output device, and then the corresponding subsequent steps are performed.
[0062] In a possible implementation, if there is a video being played, it is determined whether the video being played is displayed on multiple screens with different displays. If the video being played is not displayed on multiple screens with different displays, it is determined whether there is a custom audio output device, and then the corresponding subsequent steps are performed. Multiple screens with different displays means that the video being played is not displayed on all display screens at the same time.
[0063] In one possible implementation, if the video is played on multiple screens, it is determined whether the output request of the audio signal specifies an audio output device. If the output request of the audio signal specifies an audio output device, it is determined whether there is a custom audio output device, and then the corresponding subsequent steps are performed.
[0064] In a possible implementation, if the audio signal output request does not specify an audio output device, the display screen that plays the video is identified, and the audio output device corresponding to the display screen that plays the video is used as the designated audio output device.
[0065] S120, determining whether there is a custom audio output device; wherein the custom audio output device is an audio output device other than the system's native audio output device, and each custom audio output device has a unique identifier, and the identifier is used to identify the custom audio output device corresponding thereto. The detailed description of this step has been described before and will not be repeated here.
[0066] S130: If the custom audio output device exists, establish an audio output channel for the audio output device specified by the output request of the audio signal; wherein the audio output device is selected from the custom audio output device and the native audio output device. The detailed description of this step has been described before and will not be repeated here.
[0067] In a possible implementation, after the audio output channel is established, the audio signal is bound to an audio output device corresponding to the audio output channel, and the audio signal is output.
[0068] The audio routing method provided in this embodiment determines whether there is a video currently being played in the system after receiving an output request for an audio signal, and performs corresponding processing based on whether there is a video being played, thereby more accurately meeting the output requirements of the audio signal.
[0069] Embodiment 4
[0070] Figure 4 FIG. 1 is a flow chart of an audio routing method according to another embodiment of the present invention. Figure 4 , the method 400 comprises:
[0071] 401. Request to establish an audio output channel.
[0072] An output request for an audio signal is received, where the output request includes a request to establish an audio output channel.
[0073] 402. Determine whether there is a video to be played. If so, proceed to step 403; if not, proceed to step 407.
[0074] 403. Determine whether the video playback is multi-screen with different displays. If it is, proceed to step 404; if it is not, proceed to step 407.
[0075] 404. Determine whether the audio signal output request specifies an audio output device. If so, proceed to step 407; if not, proceed to step 405.
[0076] 405. Identify the display screen that plays the video.
[0077] 406. Designate the speaker (or other audio output device) corresponding to the display screen playing the video as the audio output device, and then proceed to step 407.
[0078] 407 . Determine whether the system has a custom audio output device. If so, proceed to step 408 . If not, proceed to step 413 .
[0079] 408. Determine whether the audio signal output request specifies an audio output device. If so, proceed to step 411; if not, proceed to step 409.
[0080] 409. Perform general audio routing, that is, use the audio routing rules provided by the system to perform audio routing.
[0081] 410. Determine whether the result of the general audio routing includes the main speaker in the native audio output device. If yes, proceed to step 412; if no, proceed to step 413.
[0082] 411. Use the specified audio output device to establish an audio output channel.
[0083] 412. Use the general audio routing result and the custom audio output device to establish an audio output channel.
[0084] 413. Use the general audio routing result to establish an audio output channel.
[0085] The audio routing method provided in this embodiment determines whether there is a video currently being played in the system, and performs corresponding processing according to whether there is a video being played, so as to more accurately meet the output requirements of the audio signal. And according to whether the system has a custom audio output device, dynamic audio routing methods such as specified or general routing are used to find the corresponding audio output device and establish an audio output channel.
[0086] Embodiment 5
[0087] Figure 5 FIG. 1 is a schematic diagram of the structure of an audio routing device according to an embodiment of the present invention. Figure 5 , the device 500 mainly includes:
[0088] The receiving module 501 is configured to receive an output request for an audio signal, wherein the audio signal includes an independent audio signal and an audio signal in multimedia, and the output request includes a request to establish an audio channel.
[0089] The determination module 502 is used to determine whether there is a custom audio output device, wherein the custom audio output device is an audio output device other than the system native audio output device, and each custom audio output device has a unique identifier, which is used to identify the corresponding custom audio output device.
[0090] The establishing module 503 is used to establish an audio output channel according to the audio output device specified by the output request of the audio signal if there is a custom audio output device, wherein the audio output device is selected from the custom audio output device and the native audio output device.
[0091] In a possible implementation, if there is no customized audio output device, general audio routing is performed, wherein the general audio routing is to perform audio routing using the audio routing rules provided by the system.
[0092] In a possible implementation, if the audio signal output request does not specify an audio output device, general audio routing is performed.
[0093] In a possible implementation, the native audio output device includes a main speaker, an earpiece, and a headset, and the custom audio output device includes an external speaker.
[0094] In a possible implementation, it is determined whether the result of the general audio routing includes the main speaker in the native audio output device. If the result of the general audio routing includes the main speaker in the native audio output device, audio output channels are established respectively according to the native audio output device and all custom audio output devices in the general audio routing result.
[0095] In a possible implementation, if the result of the general audio routing does not include the main speaker in the native audio output device, an audio output channel is established according to the native audio output device in the result of the general audio routing.
[0096] In one possible implementation, reference Figure 6 , Figure 6 6 is a schematic diagram of the structure of an audio routing device in another embodiment of the present invention. The device 500 also includes a video determination module 601, which is used to determine whether there is a playing video. If there is no playing video, it is determined whether there is a custom audio output device.
[0097] In a possible implementation, if there is a video being played, it is determined whether the video being played is displayed on multiple screens with different displays. If the video being played is not displayed on multiple screens with different displays, it is determined whether there is a custom audio output device. Multiple screens with different displays means that the video being played is not displayed on all display screens at the same time.
[0098] In a possible implementation, if the video is played on multiple screens, it is determined whether the output request of the audio signal specifies an audio output device. If the output request of the audio signal specifies an audio output device, it is determined whether there is a custom audio output device.
[0099] In a possible implementation, if the audio signal output request does not specify an audio output device, the display screen that plays the video is identified, and the audio output device corresponding to the display screen that plays the video is used as the designated audio output device.
[0100] The audio routing device provided in this embodiment can find the corresponding audio output device and establish an audio output channel by using dynamic audio routing methods such as designated or general routing after adding any number of custom audio output devices to the audio system. It can also directly use general audio routing when there is no custom audio output device. Therefore, the device in this embodiment can route audio signals to the corresponding audio output devices when the system has any number of audio output devices.
[0101] An audio routing device in the embodiment of the present application may be a device, or a component, an integrated circuit, or a chip in a terminal. The device may be a mobile electronic device, or a non-mobile electronic device.
[0102] An audio routing device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0103] like Figure 7 As shown, the embodiment of the present application also provides an electronic device 700, including a processor 701, a memory 702, and a program or instruction stored in the memory 702 and executable on the processor 701. When the program or instruction is executed by the processor 701, each process of the above-mentioned audio routing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0104] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
[0105] The embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by the processor, each process of the above-mentioned audio routing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0106] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0107] A computer-readable medium may include a propagated data signal containing computer program code, such as in baseband or as part of a carrier wave. The propagated signal may have a variety of manifestations, including electromagnetic, optical, etc., or a suitable combination. A computer-readable medium may be any computer-readable medium other than a computer-readable storage medium, which may be connected to an instruction execution system, device or apparatus to communicate, propagate or transmit a program for use. The program code on the computer-readable medium may be propagated via any suitable medium, including radio, cable, fiber optic cable, radio frequency signal, or similar medium, or any combination of the above mediums.
[0108] The basic concepts have been described above. Obviously, for those skilled in the art, the above invention disclosure is only used as an example and does not constitute a limitation of the present application. Although not explicitly stated herein, those skilled in the art may make various modifications, improvements and amendments to the present application. Such modifications, improvements and amendments are suggested in the present application, so such modifications, improvements and amendments still belong to the spirit and scope of the exemplary embodiments of the present application.
[0109] At the same time, the present application uses specific words to describe the embodiments of the present application. For example, "one embodiment", "an embodiment", and / or "some embodiments" refer to a certain feature, structure or characteristic related to at least one embodiment of the present application. Therefore, it should be emphasized and noted that "one embodiment" or "an embodiment" or "an alternative embodiment" mentioned twice or more in different positions in this specification does not necessarily refer to the same embodiment. In addition, some features, structures or characteristics in one or more embodiments of the present application can be appropriately combined.
[0110] Some aspects of the present application may be performed entirely by hardware, entirely by software (including firmware, resident software, microcode, etc.), or by a combination of hardware and software. The above hardware or software may be referred to as "data blocks", "modules", "engines", "units", "components" or "systems". The processor may be one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DAPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, or combinations thereof. In addition, various aspects of the present application may be expressed as computer products located in one or more computer-readable media, which include computer-readable program codes. For example, computer-readable media may include, but are not limited to, magnetic storage devices (e.g., hard disks, floppy disks, tapes ...), optical disks (e.g., compact disks CDs, digital versatile disks DVDs ...), smart cards, and flash memory devices (e.g., cards, sticks, key drives ...).
[0111] Similarly, it should be noted that in order to simplify the description of the disclosure of this application and thus help understand one or more embodiments of the invention, in the above description of the embodiments of this application, multiple features are sometimes combined into one embodiment, figure or description thereof. However, this disclosure method does not mean that the features required by the object of this application are more than the features mentioned in the claims. In fact, the features of the embodiments are less than all the features of the single embodiment disclosed above.
[0112] Although the present application has been described with reference to the current specific embodiments, ordinary technicians in this technical field should recognize that the above embodiments are only used to illustrate the present application, and various equivalent changes or substitutions may be made without departing from the spirit of the present application. Therefore, as long as the changes and modifications to the above embodiments are within the essential spirit of the present application, they will fall within the scope of the claims of the present application.
Claims
1. An audio routing method, characterized in that: include: Receiving an output request for an audio signal; wherein the audio signal includes an independent audio signal and an audio signal in multimedia, and the output request includes a request to establish an audio output channel; Determine whether there is a custom audio output device; wherein the custom audio output device is an audio output device other than the native audio output device of the system, each of the custom audio output devices has a unique identifier, and the identifier is used to identify the custom audio output device corresponding thereto; the native audio output device includes a main speaker, an earpiece, and a headset, and the custom audio output device includes an external speaker; If the custom audio output device exists, an audio output channel is established according to the audio output device specified by the output request of the audio signal; wherein the audio output device is selected from the custom audio output device and the native audio output device; if the output request of the audio signal does not specify an audio output device, general audio routing is performed; wherein the general audio routing is to perform audio routing using the audio routing rules provided by the system; Determine whether the result of the general audio routing includes the main speaker in the native audio output device; if the result of the general audio routing includes the main speaker in the native audio output device, establish the audio output channel respectively according to the native audio output device and all the custom audio output devices in the general audio routing result.
2. The audio routing method according to claim 1, characterized in that: Before receiving a request to output an audio signal, the method includes: If the custom audio output device exists, unique identifiers are added to all the custom audio output devices respectively.
3. The audio routing method according to claim 1, characterized in that: Determining whether there is a custom audio output device also includes: If the custom audio output device is not present, general audio routing is performed; wherein the general audio routing is to perform audio routing using the audio routing rules provided by the system.
4. The audio routing method according to claim 1, characterized in that: Determining whether the result of the general audio route includes the main speaker in the native audio output device further includes: If the result of the general audio routing does not include the main speaker in the native audio output device, the audio output channel is established according to the native audio output device in the result of the general audio routing.
5. The audio routing method according to claim 1, characterized in that: After receiving an output request for an audio signal and before determining whether there is a custom audio output device, the method includes: Determine whether there is a playback video; if there is no playback video, then determine whether there is the custom audio output device.
6. The audio routing method according to claim 5, characterized in that: Determining whether there is a video to be played also includes: If the playback video exists, determine whether the playback video is multi-screen with different displays; if the playback video is not multi-screen with different displays, determine whether there is the custom audio output device; wherein, the multi-screen with different displays means that the playback video is not displayed on all display screens at the same time.
7. The audio routing method according to claim 6, characterized in that: Determining whether the played video is multi-screen display also includes: If the played video is multi-screen with different displays, it is determined whether the output request of the audio signal specifies the audio output device; if the output request of the audio signal specifies the audio output device, it is determined whether there is the custom audio output device.
8. The audio routing method according to claim 7, characterized in that: Determining whether the output request of the audio signal specifies the audio output device further includes: If the audio signal output request does not specify the audio output device, the display screen on which the video is played is identified, and the audio output device corresponding to the display screen on which the video is played is used as the designated audio output device.
9. The audio routing method according to any one of claims 1 to 8, characterized in that: After establishing the audio output channel, the method includes: The audio signal is bound to the audio output device corresponding to the audio output channel.
10. An audio routing device, characterized in that: include: A receiving module, configured to receive an output request for an audio signal; wherein the audio signal includes an independent audio signal and an audio signal in multimedia, and the output request includes a request to establish an audio channel; A judgment module, used to judge whether there is a custom audio output device; wherein the custom audio output device is an audio output device other than the native audio output device of the system, each of the custom audio output devices has a unique identifier, and the identifier is used to identify the custom audio output device corresponding thereto; the native audio output device includes a main speaker, an earpiece and a headset, and the custom audio output device includes an external speaker; An establishing module, configured to establish an audio output channel according to the audio output device specified by the output request of the audio signal if the custom audio output device exists; wherein the audio output device is selected from the custom audio output device and the native audio output device; if the output request of the audio signal does not specify an audio output device, perform general audio routing; wherein the general audio routing is to perform audio routing using the audio routing rules provided by the system; Determine whether the result of the general audio routing includes the main speaker in the native audio output device; if the result of the general audio routing includes the main speaker in the native audio output device, establish the audio output channel respectively according to the native audio output device and all the custom audio output devices in the general audio routing result.
11. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the audio routing method according to any one of claims 1 to 9 are implemented.
12. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the audio routing method according to any one of claims 1 to 9 are implemented.
Citation Information
Patent Citations
Information processing method and electronic device
CN110032356A
Method, device and equipment for realizing double-screen abnormal sound of Android system and medium
CN111405337A
Audio output method and electronic equipment
CN112286481A