WO2022078056A1 - Audio playback method and apparatus, electronic device, and storage medium - Google Patents

Audio playback method and apparatus, electronic device, and storage medium Download PDF

Info

Publication number
WO2022078056A1
WO2022078056A1 PCT/CN2021/113242 CN2021113242W WO2022078056A1 WO 2022078056 A1 WO2022078056 A1 WO 2022078056A1 CN 2021113242 W CN2021113242 W CN 2021113242W WO 2022078056 A1 WO2022078056 A1 WO 2022078056A1
Authority
WO
WIPO (PCT)
Prior art keywords
audio
audio output
audio input
input device
devices
Prior art date
Application number
PCT/CN2021/113242
Other languages
French (fr)
Chinese (zh)
Inventor
张辉
陈光明
钟卫东
张斌
杨俊拯
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2022078056A1 publication Critical patent/WO2022078056A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/16Sound input; Sound output
    • G06F3/165Management of the audio stream, e.g. setting of volume, audio stream path
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units
    • G06F3/1454Digital output to display device ; Cooperation and interconnection of the display device with other functional units involving copying of the display data of a local workstation or window to a remote workstation or window so that an actual copy of the data is displayed simultaneously on two or more displays, e.g. teledisplay

Definitions

  • the present application relates to the field of audio technology, and more particularly, to an audio playback method, device, electronic device, and storage medium.
  • a user can project a video image in a resource providing device (such as a smart phone) to a resource display device (such as a TV) for display, so that the user can view the display content in the resource providing device on the resource display device.
  • a resource providing device such as a smart phone
  • a resource display device such as a TV
  • video images played in multiple resource providing devices can be projected to the same resource display device for display.
  • an electronic device displays a video projected by multiple devices, it usually mixes the audio data in the video projected by multiple devices before playing it, resulting in poor sound playback effect when the video is projected. affect the user experience.
  • the present application proposes an audio playback method, device, electronic device and storage medium.
  • an embodiment of the present application provides an audio playback method, which is applied to an electronic device.
  • the electronic device includes at least one built-in audio output device and at least one external audio output device, and the audio output device includes multiple audio output devices.
  • audio output channels the method includes: acquiring multiple audio input devices and the number of the audio output devices, wherein the number of the multiple audio input devices is taken as the first number, and the number of the audio output devices is taken as a second quantity; based on the first quantity and the second quantity, allocating at least one audio output channel of at least one audio output device to each audio input device; acquiring audio data transmitted by the plurality of audio input devices; The audio data transmitted by each audio input device is played based on the audio output channel assigned to each audio input device.
  • an embodiment of the present application provides an audio playback device, which is applied to an electronic device.
  • the electronic device includes at least one built-in audio output device and at least one external audio output device, and the audio output device includes multiple audio output devices.
  • audio output channels the device includes: a quantity determination module, an audio distribution module, an audio acquisition module and a playback module, wherein the quantity determination module is used to acquire the number of multiple audio input devices and the audio output devices, Wherein, the number of the plurality of audio input devices is used as the first number, and the number of the audio output devices is used as the second number; the audio distribution module is configured to, based on the first number and the second number, assign each Each audio input device is allocated at least one audio output channel of at least one audio output device; the audio acquisition module is used to acquire the audio data transmitted by the plurality of audio input devices; the playback module is used to The audio output channel allocated by the audio input device plays the audio data transmitted by each audio input device.
  • embodiments of the present application provide an electronic device, comprising: one or more processors; a memory; and one or more application programs, wherein the one or more application programs are stored in the memory and Configured to be executed by the one or more processors, the one or more programs are configured to execute the audio playback method provided by the first aspect.
  • an embodiment of the present application provides a computer-readable storage medium, where a program code is stored in the computer-readable storage medium, and the program code can be called by a processor to execute the audio provided in the first aspect. play method.
  • FIG. 1 shows a schematic structural diagram of an application environment provided by an embodiment of the present application.
  • FIG. 2 shows another schematic structural diagram of an application environment provided by an embodiment of the present application.
  • FIG. 3 shows a flowchart of an audio playback method according to an embodiment of the present application.
  • FIG. 4 shows a flowchart of an audio playback method according to another embodiment of the present application.
  • FIG. 5 shows a schematic diagram of a first principle of an audio playback method provided by another embodiment of the present application.
  • FIG. 6 shows a schematic diagram of a second principle of an audio playback method provided by another embodiment of the present application.
  • FIG. 7 shows a schematic diagram of a third principle of an audio playback method provided by another embodiment of the present application.
  • FIG. 8 shows a schematic diagram of a fourth principle of an audio playback method provided by another embodiment of the present application.
  • FIG. 9 shows a schematic diagram of a fifth principle of an audio playback method provided by another embodiment of the present application.
  • FIG. 10 shows a schematic diagram of the sixth principle of the audio playback method provided by another embodiment of the present application.
  • FIG. 11 shows a schematic diagram of a seventh principle of an audio playback method provided by another embodiment of the present application.
  • FIG. 12 shows a schematic diagram of an eighth principle of an audio playback method provided by another embodiment of the present application.
  • FIG. 13 shows a flowchart of an audio playback method according to yet another embodiment of the present application.
  • FIG. 14 shows a flowchart of an audio playback method according to still another embodiment of the present application.
  • FIG. 15 shows a schematic diagram of the principle of an audio playback method provided by still another embodiment of the present application.
  • FIG. 16 shows a flowchart of an audio playback method according to yet another embodiment of the present application.
  • FIG. 17 shows a flowchart of an audio playback method according to still another embodiment of the present application.
  • FIG. 18 shows a block diagram of an audio playback apparatus according to an embodiment of the present application.
  • FIG. 19 is a block diagram of an electronic device for executing an audio playback method according to an embodiment of the present application according to an embodiment of the present application.
  • FIG. 20 is a storage unit for storing or carrying a program code for implementing the audio playback method according to the embodiment of the present application according to the embodiment of the present application.
  • the screen projection function is widely used in daily life.
  • Users can project content displayed on one device to another device for display, and can transmit audio data to another device for playback.
  • a user plays a video through a smart phone
  • he can project the video played on the mobile terminal to another device (such as a smart TV, etc.) for display, and transmit the audio data of the video to another device for playback, so as to facilitate the user
  • the user can project the audio playback interface displayed on the smart watch to the computer for display, and output the played music through the computer.
  • some electronic devices can realize the display of the display content projected by multiple devices, and can play the audio data input by multiple devices, but when the electronic device plays the audio data input by multiple devices, it usually Audio input from multiple devices is mixed and then output, but when the audio is played after mixing, the user cannot distinguish the audio input from each device, resulting in a chaotic feeling, resulting in poor playback effect.
  • the inventor proposes the audio playback method, device, electronic device, and storage medium provided by the embodiments of the present application, which can realize the assignment of different audio output channels to different audio input devices, and facilitate users to clearly distinguish different audio input.
  • the sound input by the device enhances the user experience.
  • the specific audio playback method will be described in detail in the following embodiments.
  • FIG. 1 shows an architecture diagram of an application scenario of an embodiment of the present application, and the application scenario may include an electronic device 100 and multiple input devices 200 .
  • the electronic device 100 may be a smart TV or the like as shown in FIG. 1 .
  • the electronic device 100 may also be other devices with display functions, such as a desktop computer, a notebook computer, etc., which are not limited herein.
  • the input device 200 may be a smart phone, a tablet computer, a smart watch, a computer, or other devices.
  • the input device 200 can be used as a resource providing device to project the display content to the electronic device 100 for display.
  • the input device 200 can also transmit the audio content to the electronic device 100 for playback.
  • the electronic device 100 and the input device 200 may communicate to complete data interaction.
  • the electronic device 100 and the input device 200 may communicate with each other through a local area network (LAN), or communicate with each other through a wide area network (WAN).
  • LAN local area network
  • WAN wide area network
  • the electronic device 100 and the input device 200 can be connected to a router at the same time, and the electronic device 100 and the input device 200 can communicate through the local area network provided by the router; for another example, the electronic device 100 and the input device 200 can communicate with the cloud, and The data interaction between the two is realized through the cloud; for another example, the electronic device 100 and the input device 200 can also establish an end-to-end network connection (ie, a P2P network connection) through Bluetooth, Zigbee, WebRTC and other communication methods, and through the established network connection for communication.
  • the communication manner between the electronic device 100 and the input device 200 may not be limited.
  • the electronic device 100 may be a large-screen device (such as the smart TV shown in FIG. 1 , etc.), and the user can project the display content on the small-screen device such as a smartphone, tablet computer, smart watch, etc., to the large-screen device. display, thereby enhancing the user experience when viewing the displayed content.
  • the electronic device 100 can simultaneously receive the content projected by the multiple input devices 200 and display the content projected by the multiple input devices 200, so that the content projected by the multiple input devices 200 can be projected to the electronic device 100 for display, so that the user can Viewing the contents projected by multiple input devices 200 at the same time greatly improves the user experience.
  • the electronic device 100 may perform a display layout (eg, layout position, size of the display area, etc.) for the display contents input by the multiple input devices according to the received display contents of the multiple input devices 100, and then based on the display layout , after rendering the display content input by multiple input devices, display it on the display screen.
  • a display layout eg, layout position, size of the display area, etc.
  • the electronic device 100 may include a content receiving module, a first capability negotiation module, a layout generating module, and a display rendering module; the input device 200 may include a content acquisition module, a content sending module, and a second capability negotiation module.
  • the input device 200 can first collect the content as the content to be displayed through the content collection module, and then transmit the content to be displayed to the electronic device 100 through the content sending module wirelessly, and the content receiving module is responsible for receiving the content in the electronic device 100 .
  • the second capability negotiation module of the input device 200 and the first capability negotiation module of the electronic device 100 are responsible for negotiating the software and hardware capabilities of both parties.
  • the optimal display parameters (such as resolution/bit rate/frame rate) are fed back to the input device 200 for adaptive tuning.
  • the layout generation module of the electronic device 100 comprehensively considers various factors according to the current constraints (such as the number of input devices connected, the display parameter information of the input device itself, the display parameter information of the electronic device, etc.), and follows the layout principle. , which dynamically generates the display layout. After the current layout mode is generated, it is then handed over to the display rendering module to draw and display the content to be displayed according to the layout.
  • the electronic device 100 may include at least one built-in first audio output device 140 and at least one externally connected second audio output device 150 .
  • the first audio output device 141 includes at least one first audio output channel 142
  • the second audio output device 143 includes at least one second audio output channel 144 .
  • the number of the first audio output devices 141 may not be limited (only one is shown in FIG. 2 ), and the number of the second audio output devices 143 may be unlimited (only two are shown in FIG. 2 )
  • the number of the first audio output channels of the first audio output device 141 may not be limited (only 4 are shown in FIG.
  • the electronic device 100 can output sound through the audio output channels of the above audio output devices.
  • the electronic device 100 can assign at least one audio data to the multiple input devices 200.
  • At least one audio output channel of the above-mentioned audio output device and ensure that the audio output channels allocated by each input device 200 are different, so that the audio data of each input device 200 will not share the same audio output channel output Audio data, which is convenient for users to distinguish sounds corresponding to audio data of different input devices.
  • FIG. 3 shows a schematic flowchart of an audio playback method provided by an embodiment of the present application.
  • the audio playback method is applied to the audio playback apparatus 400 shown in FIG. 18 and the electronic device 100 ( FIG. 19 ) equipped with the audio playback apparatus 400 .
  • the electronic device includes at least one built-in audio output device and at least one external audio output device, each of which includes a plurality of audio output channels.
  • the following will take an electronic device as an example to describe the specific process of this embodiment.
  • the electronic device applied in this embodiment may be a smart TV, a notebook computer, a desktop computer, etc., which is not limited here.
  • the flow shown in FIG. 3 will be described in detail below, and the audio playback method may specifically include the following steps:
  • Step S110 Acquire the number of multiple audio input devices and the audio output devices, wherein the number of the multiple audio input devices is taken as the first number, and the number of the audio output devices is taken as the second number.
  • the electronic device may receive input audio data from multiple audio input devices, and play the received audio data based on the built-in audio output device and the audio output channels of the external audio output device.
  • the audio input device may be an input device in a screen projection scenario, and the audio input device may input audio data to the electronic device for playback, or input display content to the electronic device for display.
  • the electronic device may establish a network connection with each audio input device to receive input data from the audio input device according to the established network connection.
  • the electronic device can establish a network connection with the audio input device by means of wireless communication, for example, a network connection can be established by means of Bluetooth, WiFi network, etc., and the specific communication method used may not be limited.
  • the electronic device when the electronic device establishes a network connection with the audio input device through the WiFi network, the electronic device can display a list of devices under the same WiFi network, and then detect the user's selection operation on the device, and according to the detected selection operation, and The device selected by the user establishes a network connection.
  • establishing a network connection between an electronic device and an audio input device can also be established according to the user's operation on the audio input device.
  • the audio input device can also display the information of the electronic device under the same WiFi network. device list, and then detect the user's selection operation on the device, and establish a network connection with the electronic device selected by the user according to the detected selection operation.
  • the electronic device when the electronic device plays the audio data input by the audio input device, it can determine the number of audio input devices that input audio data at this time, and the number of audio output devices of the electronic device, so as to determine the number of audio output devices of the electronic device according to the determined number of audio input devices.
  • the number of audio input devices and the number of audio output devices allocate the audio output channels corresponding to the audio input devices.
  • the determined number of audio input devices may be used as the first number, and the determined number of audio output devices may be used as the second number.
  • the electronic device may determine the number of audio input devices according to the audio input devices currently established with the network connection.
  • the electronic device can detect the external audio output devices, determine the number of external audio output devices, and can determine the number of its own built-in audio output devices, and then obtain the difference between the number of external audio output devices and the number of built-in audio output devices. and, that is, the number of audio output devices is obtained.
  • the audio input device when the electronic device establishes a network connection with the audio input device, the audio input device does not necessarily start to project the screen or input audio to the electronic device, so the electronic device can determine the actual screen projection or input audio data to the electronic device.
  • the number of audio input devices of the electronic device for example, the electronic device may determine the number of audio input devices that have sent a screen projection command to the electronic device and have established a network connection with the electronic device.
  • Step S120 Based on the first number and the second number, assign at least one audio output channel of at least one audio output device to each audio input device, wherein the audio output channel assigned by each audio input device different.
  • the electronic device may allocate audio output channels to the audio input device according to the above first number and second number.
  • the electronic device may allocate at least one audio output channel of at least one audio output device to each audio input device based on the first number and the second number.
  • the electronic device may try to ensure that all audio output channels of an audio output device are allocated to the audio input device according to the principle of prioritizing the allocation of the entire audio output device to the audio input device; the number of audio output devices cannot be guaranteed.
  • the different channels of the audio output device can be assigned to different audio input devices, and the audio output channels assigned by each audio input device are guaranteed.
  • at least part of the audio data of the audio input device can be played by the complete audio output device (that is, all channels of the audio output device are used to play the audio data of one audio input device), and it is convenient for the user to distinguish Playing sounds corresponding to the audio data of different audio input devices.
  • Step S130 Acquire audio data transmitted by the plurality of audio input devices.
  • the electronic device may acquire audio data input by these audio input devices for playback.
  • the electronic device can receive the audio data transmitted by the audio input device according to the network connection established with the audio input device, that is, obtain the audio data to be played.
  • the audio data input by the audio input device may be audio data of content such as music, video, games, etc., which is not limited herein.
  • Step S140 Play audio data transmitted by each audio input device based on the audio output channel allocated to each audio input device.
  • the electronic device after acquiring the audio data input by the above multiple audio input devices, the electronic device can de-multiplex the audio data, and after decoding, output the sound according to the audio allocated to each audio input device. channel to play the audio data transmitted by each audio input device.
  • the audio playback method according to the number of audio input devices and the number of audio output devices, at least one audio output channel of at least one audio output device is allocated to each audio input device, and then multiple audio output channels are obtained.
  • the audio data transmitted by the input device based on the audio output channel allocated to each audio input device, play the audio data transmitted by each audio input device, so as to realize the allocation of different audio output channels to different audio input devices, It is convenient for users to clearly distinguish the sounds input by different audio input devices and improve the user experience.
  • each audio output device includes a plurality of audio output channels, so when the number of audio input devices is large, the audio input device can also be guaranteed.
  • the input audio data is played in different audio output channels, which improves the sound playback effect.
  • FIG. 4 shows a schematic flowchart of an audio playback method provided by another embodiment of the present application.
  • the audio playback method is applied to the above-mentioned electronic equipment, and the flow shown in FIG. 4 will be described in detail below, and the audio playback method may specifically include the following steps:
  • Step S200 Acquire the number of multiple audio input devices and the audio output devices, wherein the number of the multiple audio input devices is taken as the first number, and the number of the audio output devices is taken as the second number.
  • step S200 reference may be made to the content of the foregoing embodiments, and details are not described herein again.
  • Step S210 Determine whether the second number is greater than the first number.
  • the electronic device may try to ensure that all audio output channels of an audio output device are allocated to the audio input device according to the principle of preferentially allocating the entire audio output device to the audio input device.
  • the electronic device can compare the second number with the first number, and then determine whether the second number is less than the first number according to the comparison result . It can be understood that if the second number is greater than or equal to the first number, it means that the number of audio output devices is greater than or equal to the number of audio input devices, so each audio input device can be assigned to at least one complete audio output device. ; If the second number is less than the first number, it means that the number of audio output devices is less than the number of audio input devices, so it cannot be guaranteed that each audio input device can be assigned to at least one complete audio output device.
  • Step S220 If the second number is greater than or equal to the first number, assign all audio output channels of at least one audio output device to each audio input device.
  • the electronic device determines that the second number is greater than or equal to the first number, the number of audio output devices at this time can ensure that each audio input device is assigned at least one complete audio output device, and also That is, for an audio input device, all audio output channels of the assigned audio output device are used for playing the audio data of the audio input device. Therefore, in this case, the electronic device can assign all audio output channels of at least one audio output device to each audio input device, and ensure that the audio output devices assigned to each audio input device are different.
  • the number of audio output devices 200 is 1, and the audio output device includes the first audio output device 140a and the second audio output device 140b, the number of audio output devices is 2, the audio output device 140b.
  • the number of input devices is 1, so the first audio output device 140a and the second audio output device 140b can be allocated to the audio input device 200, and the audio data input by the audio input device 200 can be simultaneously transmitted by the first audio output device 140a and the second audio output device 140b. All audio output channels of the two audio output devices 140b are played.
  • the audio input device includes: a first audio input device 201 and a second audio input device 202
  • the audio output device includes a first audio output device 140a and a second audio output device 140b, at this time the audio output
  • the number of devices is 2, the number of audio input devices is 2, and the number of audio output devices just satisfies that each audio input device is assigned a complete audio output device, so the first audio input device 201 can be assigned a first audio output
  • the device 140a assigns the second audio output device 140b to the second audio input device 202, so that the audio data input by the first audio input device 201 can be played by all audio output channels of the first audio output device 140a, and the second audio The audio data input by the input device 202 can be played by all output channels of the second audio output device 140b.
  • the audio input device includes: a first audio input device 201, a second audio input device 202 and a third audio input device 203
  • the audio output device includes a first audio output device 140a, a second audio output device
  • the device 140b and the third audio output device 140c at this time, the number of audio output devices is 3, the number of audio input devices is 3, and the number of audio output devices just satisfies that each audio input device is allocated a complete audio output device, so
  • the first audio output device 140a may be assigned to the first audio input device 201, the second audio output device 140b to the second audio input device 202, and the third audio output device 140c to the third audio input device 203, thereby
  • the audio data input by the first audio input device 201 can be played by all the audio output channels of the first audio output device 140a
  • the audio data input by the second audio input device 202 can be played by all the output channels of the second audio output device 140b
  • the audio data input by the third audio input device 203 can be played by all output channels
  • Step S230 If the second number is less than the first number, acquire the number of audio output channels of all the audio output devices as a third number.
  • the electronic device determines that the second number is smaller than the first number, the number of audio output devices is not sufficient for each audio input device to be assigned at least one complete audio output device. Therefore, in this case, the electronic device can determine whether all audio output channels of at least one complete audio output device can be allocated to some audio input devices, and then perform the allocation of audio output channels.
  • the number of audio output channels of each audio output device is the same, eg, both are 2, both are 4, and so on.
  • the electronic device may determine the number of audio output channels of all audio output devices as the third number when judging that the second number is smaller than the first number. As a way, the electronic device may acquire device information of each audio output device, and then determine the number of audio output channels from the device information.
  • Step S240 Obtain the ratio of the third quantity to the first quantity.
  • Step S250 If the ratio is greater than the set threshold, assign all audio output channels of at least one audio output device to some of the plurality of audio input devices.
  • the electronic device may acquire the ratio between the third number of all audio output channels and the first number of all audio input devices, To determine whether all audio output channels of at least one complete audio output device can be allocated to a part of the audio input device according to the ratio.
  • the electronic device may compare the ratio with a set threshold, where the set threshold is determined according to the number of audio output channels of a single audio output device. When the above ratio is greater than the set threshold, it means that there are many audio output channels, and at least some audio input devices can be allocated all audio output channels of at least one complete audio output device; when the above ratio is not greater than the set threshold, It means that there are fewer audio output channels.
  • the electronic device when the above ratio is greater than a set threshold, when the electronic device allocates all audio output channels of at least one complete audio output device to at least some of the audio input devices, it may determine that the audio frequency of the complete audio output device is to be allocated. The number of input devices is then allocated to all audio output channels of at least one audio output device for the number of audio input devices, and it is ensured that the audio output devices allocated to these audio input devices are different.
  • each audio input device in the number of audio input devices can be assigned all audio output channels of an audio output device, so as to avoid the audio output that cannot be assigned by other audio input devices of a complete audio output device.
  • the electronic device assigns all audio output channels of at least one audio output device to some of the plurality of audio input devices, which may include:
  • the fourth number of audio input devices is determined from the plurality of audio input devices as the partial audio input devices based on the priority of each audio input device, wherein the priority of the partial audio input devices The priority is higher than that of the other audio input devices; all audio output channels of an audio output device are allocated to the part of the audio input devices.
  • the electronic device allocates all audio output channels of an audio output device to each audio input device of the partial audio input devices. After the electronic device determines the number of audio input devices that can be assigned a complete audio output device, according to the priority of the audio input device, the number of audio input devices with relatively high priority is determined as the number of audio input devices that can be assigned an audio output device. audio input devices, and then assign an audio output to those audio input devices to promote all audio output channels. Therefore, an audio input device with a relatively high priority can be assigned a complete audio output device, and when the audio is played, it can be different from the audio input by other audio input devices, which can better meet the needs of users. Improve user experience.
  • the priority of the audio input device can be set according to the needs of the user.
  • the electronic device may display an interface for setting the priority of each audio input device for the user to set the priority of each audio input device.
  • the priority of the audio input device may be determined according to the type of the audio input device, that is, the electronic device may obtain the type of each audio input device, and then, according to the type of each audio input device, determine each audio input device Enter the priority of the device.
  • the audio input devices can be divided into: desktop computers, laptop computers, tablet computers, smart phones and smart watches, etc.
  • the priority of audio input devices is in the order of desktop computers, laptop computers, tablet computers, smart phones and smart watches Decrease in sequence, of course, the above is only an example, and does not represent a limitation on the actual priority.
  • the electronic device determines the number of audio input devices to which all audio output channels of one audio output device are allocated among the plurality of audio input devices, which may be determined according to the above ratio.
  • the integer part of the ratio can be used as the quantity, so that more audio input devices can be allocated to all audio output channels of an audio output device; for another example, the integer part of the ratio can be subtracted by 1 The value obtained later is used as the number, so that some audio input devices can be assigned to all audio output channels of an audio output device, and at the same time, the occurrence of uneven sound volume can also be avoided.
  • the above set threshold is determined according to the number of audio output channels of a single audio output device. Since the number of audio output channels of each audio output device is the same, the audio output of any audio output device can be The number of channels to determine the set threshold. Exemplarily, if the number of audio output channels of a single audio output device is 4, the set threshold may be 2. Of course, the specific manner of determining the threshold value may not be limited.
  • the audio input device includes: a first audio input device 201, a second audio input device 202 and a third audio input device 203, and the audio output device includes a first audio output device 140a and a second audio output device 140a
  • the number of audio output channels of the device 140b, the first audio output device 140a and the second audio output device 140b are all four.
  • the number of all audio output devices is 8
  • the number of audio input devices is 3
  • the ratio of the number of all audio output devices to the number of audio input devices is greater than 2, so the first audio input device 201 can be assigned a first audio
  • the output device 140a assigns the audio output channels b1 and b2 of the second audio output device 140b to the second audio input device 202, and assigns the audio output channels b3 and b4 of the second audio output device to the third audio input device 203.
  • the audio input device includes: a first audio input device 201, a second audio input device 202, a third audio input device 203 and a fourth audio input device 204
  • the audio output device includes a first audio output device
  • the number of audio output channels of the device 140a, the second audio output device 140b and the third audio output device 140c, the first audio output device 140a, the second audio output device 140b and the third audio output device 140c are all four.
  • the number of all audio output devices is 12, the number of audio input devices is 4, and the ratio of the number of all audio output devices to the number of audio input devices is greater than 2, so the first audio input device 201 can be assigned a first audio
  • the output device 140a assigns the second audio output device 140b to the second audio input device 202, assigns the audio output channels c1 and c2 of the third audio output device 140c to the third audio input device 203, and assigns the audio output channels c1 and c2 of the third audio output device 140c to the fourth audio input device 203.
  • 204 allocates audio output channels c3 and c4 of the third audio output device 140c.
  • Step S260 Allocate at least one audio output channel of the remaining audio output device to each audio input device in the other audio input devices.
  • the electronic device may allocate at least one of the remaining audio output devices to each of the other audio input devices Audio output channels, other audio input devices are audio input devices other than some audio input devices among the multiple audio input devices, and ensure that the audio output channels assigned to different audio input devices in the other audio input devices are different.
  • Step S270 If the ratio is less than or equal to the set threshold, assign at least one audio output channel to each of the plurality of audio input devices.
  • the electronic device determines that the above ratio is less than or equal to the set threshold, it means that no audio input device can be assigned to all audio output channels of an audio output device, so each audio output channel can be allocated according to the guarantee According to the principle that the input device is assigned at least one audio output channel, at least one audio output channel is assigned to each audio input device.
  • the audio input device includes: a first audio input device 201, a second audio input device 202, a third audio input device 203 and a fourth audio input device 204, and the audio output device includes a first audio output device
  • the number of audio output channels of the device 140a and the second audio output device 140b, the first audio output device 140a and the second audio output device 140b are all four.
  • the number of all audio output devices is 8
  • the number of audio input devices is 4, and the ratio of the number of all audio output devices to the number of audio input devices is equal to 2, so the first audio input device 201 can be assigned a first audio
  • the audio output channels a1 and a2 of the output device 140a, the audio output channels a3 and a4 of the first audio output device 140a to the second audio input device 202, the second audio output device 140b is assigned to the third audio input device 203
  • the audio output channels b1 and b2 of the fourth audio input device 204 are allocated to the audio output channels b3 and b4 of the second audio output device 140b.
  • the data of all audio output devices may be obtained in step S230.
  • the electronic device can also determine whether the number of audio output channels of each audio output device is the same, and when the number of audio output channels is the same, the number of audio output channels of all audio output devices can be obtained; , the audio output channels can be allocated to the audio input devices according to the principle of allocating all the audio output channels of an audio output device to some audio input devices as much as possible.
  • Step S280 Acquire audio data transmitted by the plurality of audio input devices.
  • Step S290 Play audio data transmitted by each audio input device based on the audio output channel allocated to each audio input device.
  • step S280 and step S290 reference may be made to the content of the foregoing embodiments, and details are not described herein again.
  • the electronic device may have no external audio output device.
  • the electronic device may have only one audio output device.
  • at least one audio output device can be assigned to each audio input device according to the guarantee.
  • assign at least one audio output channel to the audio input device. 12 the audio input device includes: a first audio input device 201 and a second audio input device 202, and the audio output device includes a first audio output device 140a. At this time, the first audio input device 201 can be used.
  • the audio output channels a1 and a2 of the first audio output device 140a are allocated to the audio output channels a3 and a4 of the first audio output device 140a for the second audio input device 202 .
  • the audio playback method when multiple audio input devices input audio input to the electronic device for playback, according to the principle of preferentially assigning all audio output channels of at least one audio output device to the audio input device, based on the audio input device
  • the relationship between the number of devices and the number of audio output devices, assigning different audio output channels to audio input devices ensures that the audio data of different audio input devices is played through different audio output channels, and can give priority to
  • the audio data of the audio input device can be output in all audio output channels of at least one audio output device, which improves the audio playback effect.
  • FIG. 13 shows a schematic flowchart of an audio playback method provided by yet another embodiment of the present application.
  • the audio playback method is applied to the above-mentioned electronic equipment, and the flow shown in FIG. 13 will be described in detail below.
  • the audio playback method may specifically include the following steps:
  • Step S310 Acquire the number of multiple audio input devices and the audio output devices, wherein the number of the multiple audio input devices is used as the first number, and the number of the audio output devices is used as the second number.
  • step S310 for step S310, reference may be made to the content of the foregoing embodiments, and details are not described herein again.
  • Step S320 Obtain the relative positional relationship between each audio input device and the electronic device.
  • the relative positional relationship may be used to represent the relative distance and relative angle between the audio input device and the electronic device.
  • the audio input device may be located directly in front of the electronic device, may be located in the front left of the electronic device, may be located in the front right of the electronic device, may be located in the upper front of the electronic device, or may be located in the lower front of the electronic device, etc.
  • the second source device can be located directly in front of the electronic device, can be located in the front left of the electronic device, can be located in the front right of the electronic device, can be located in the upper front of the electronic device, or can be located in the lower front of the electronic device, etc. Do limit.
  • the electronic device may include an ultra-wide band (UWB) sensor, and each audio input device may also include an ultra-wideband sensor, and the electronic device may pass the electronic device and the UWB sensor of each audio input device. , to obtain the relative positional relationship between each audio input device and the electronic device.
  • UWB ultra-wide band
  • the electronic device may include an image capture device, and the relative positional relationship between the audio input device and the electronic device may be acquired through the image capture device.
  • Step S330 Based on the first quantity, the second quantity, and the relative positional relationship between each audio input device and the electronic device, assign at least one of at least one audio output device to each audio input device.
  • An audio output channel wherein the audio output channel allocated by each audio input device corresponds to the relative positional relationship.
  • the electronic device when the electronic device allocates an audio output channel to each audio input device, in addition to referring to the number of audio output devices and the number of audio input devices, it may also refer to the relationship between the audio input device and the electronic device. relative positional relationship.
  • the electronic device may, in accordance with the principle of prioritizing the allocation of the entire audio output device to the audio input device, try to ensure that all audio output channels of an audio output device are allocated to the audio input device; the number of audio output devices cannot guarantee that one
  • assign different channels of the audio output device to different audio input devices, and ensure that the audio output channels assigned to each audio input device are different, like this , the audio data of at least part of the audio input device can be played by the complete audio output device (that is, all channels of the audio output device are used to play the audio data of one audio input device), and it is convenient for users to distinguish different audio input devices.
  • the playback sound corresponding to the audio data of the device.
  • the electronic device can also make the audio output channel assigned to the audio input device close to the audio input device according to the above relative positional relationship.
  • the audio input device 1 is located on the left side of the electronic device. side, the audio output channel on the left can be assigned to the audio input device 1; if the audio input device 2 is located on the right side of the electronic device, the audio output channel on the right can be assigned to the audio input device 2.
  • the electronic device may allocate a corresponding number of audio output channels to each audio input device according to the first number and the second number, and then according to the relative positional relationship between the audio input device and the electronic device, and The position of the audio output channels, assign the corresponding number of audio output channels to each audio input device.
  • Step S340 Acquire audio data transmitted by the multiple audio input devices.
  • Step S350 Play audio data transmitted by each audio input device based on the audio output channel allocated to each audio input device.
  • the audio playback method when multiple audio input devices input audio input to the electronic device for playback, according to the principle of preferentially assigning all audio output channels of at least one audio output device to the audio input device, based on the audio input device
  • the number of devices, the number of audio output devices, and the relative positional relationship between the audio input device and the electronic device Assign different audio output channels to the audio input device to ensure that the audio data of different audio input devices pass through different audio outputs.
  • the audio output channel can be guaranteed to correspond to the above relative positional relationship, which further facilitates the user to distinguish the playback sound of the audio data of different audio input devices, and improves the audio playback effect.
  • FIG. 14 shows a schematic flowchart of an audio playback method provided by still another embodiment of the present application.
  • the audio playback method is applied to the above-mentioned electronic equipment, and the flow shown in FIG. 14 will be described in detail below.
  • the audio playback method may specifically include the following steps:
  • Step S410 Acquire the number of multiple audio input devices and the audio output devices, wherein the number of the multiple audio input devices is used as the first number, and the number of the audio output devices is used as the second number.
  • step S410 reference may be made to the content of the foregoing embodiments, and details are not described herein again.
  • Step S420 Obtain the distance of each audio input device relative to the electronic device.
  • the electronic device may also acquire the distance of each audio input device relative to the electronic device.
  • the electronic device can obtain the distance of each audio input device relative to the electronic device through the distance sensor; as another way, the electronic device can be provided with multiple depth cameras, and the depth images collected by the depth cameras can be used to determine each The distance of the audio input device relative to the electronic device.
  • Step S430 Allocate at least one audio output of at least one audio output device to each audio input device based on the first number, the second number, and the distance of each audio input device relative to the electronic device channel, wherein the number of audio output channels allocated by each audio input device is positively related to the distance.
  • the electronic device when the electronic device allocates an audio output channel to each audio input device, in addition to referring to the number of audio output devices and the number of audio input devices, it may also refer to the relationship between the audio input device and the electronic device. distance. Similarly, the electronic device may, in accordance with the principle of assigning the entire audio output device to the audio input device preferentially, try to ensure that all audio output channels of an audio output device are allocated to the audio input device, and refer to the relationship between the audio input device and the electronic device. The distance finally makes the audio output channels allocated by each audio input device different, and the number of audio output channels allocated by each audio input device is positively related to the above distance. That is to say, the greater the distance, the greater the number of allocated audio output channels. Since the number of allocated audio output channels is different, the sound volume is also different, so that the user can easily distinguish different audio inputs. The audio sound of the device.
  • the electronic device may determine the number of audio output channels allocated by each audio input device according to the above distance, and the number of audio output channels allocated by each audio input device is positively correlated with the above distance . Then, based on the number of audio output channels allocated to each audio input device, and according to the first number and the second number, the audio output channels of all audio output devices are allocated to the audio input devices, that is, on this basis On the condition that the number of audio output channels allocated by each audio input device is kept unchanged, according to the first number and the second number, the audio output channels of all audio output devices are allocated to the audio input device to ensure As many audio input devices as possible are assigned to complete audio output devices, ie all audio output channels of at least one audio deletion device.
  • Step S440 Acquire audio data transmitted by the multiple audio input devices.
  • Step S450 Play audio data transmitted by each audio input device based on the audio output channel allocated to each audio input device.
  • the audio playback method when multiple audio input devices input audio input to an electronic device for playback, according to the principle of preferentially assigning all audio output channels of at least one audio output device to the audio input device, based on the audio input device
  • the number of devices, the number of audio output devices, and the distance between the audio input device and the electronic device assign different audio output channels to the audio input device, ensuring that the audio data of different audio input devices pass through different audio output channels Play, and can ensure that the number of audio output channels corresponds to the above distance, which further facilitates the user to distinguish the playback sound of audio data of different audio input devices, and improves the audio playback effect.
  • FIG. 15 shows a schematic flowchart of an audio playback method provided by yet another embodiment of the present application.
  • the audio playback method is applied to the above-mentioned electronic equipment, and the flow shown in FIG. 15 will be described in detail below.
  • the audio playback method may specifically include the following steps:
  • Step S510 Acquire the number of multiple audio input devices and the audio output devices, wherein the number of the multiple audio input devices is taken as the first number, and the number of the audio output devices is taken as the second number.
  • step S510 reference may be made to the content of the foregoing embodiments, and details are not described herein again.
  • Step S520 Perform a display layout on the resources to be displayed corresponding to each audio input device.
  • the audio input device may be an input device in a screen projection scenario, and the audio input device may not only input display content to the electronic device for display, but also input audio data to the electronic device for playback.
  • the electronic device may display a layout for the resources to be displayed corresponding to each audio input device, so that when displaying the resources to be displayed, the resources to be displayed inputted by multiple input devices are displayed according to the display layout.
  • the display layout may include at least: the position of each channel of video in the preset window and the area size of each channel of video in the preset window, etc., which are not limited herein.
  • the resources to be displayed may include videos, music, documents, games, etc., which are not limited herein.
  • the electronic device performs a display layout for the resources to be displayed corresponding to each audio input device, which may include: acquiring the number of resources to be displayed corresponding to multiple audio input devices; based on the number, generating multiple audio input devices The display layout of the corresponding resource to be displayed in the interface.
  • the electronic device may divide the display interface into multiple regions based on the number of resources to be displayed corresponding to the multiple audio input devices, and then assign each region in the multiple regions to the to-be-displayed corresponding to one audio input device resources (ie, one channel of video), so as to obtain the display layout of the resources to be displayed corresponding to each audio input device in the display interface.
  • the ratio of the sum of the areas occupied by the resources to be displayed in the display interface of the multiple audio input devices to the area of the display interface may be the largest. It can be understood that by using this layout method to lay out the positions and sizes of the resources to be displayed in the display interface of the multiple audio input devices, the resources to be displayed of the multiple audio input devices can occupy the largest proportion in the display interface. to make full use of the area in the display interface.
  • the electronic device may also generate the display layout based on the display parameters of the resource to be displayed corresponding to each audio input device in the corresponding audio input device.
  • the ratio of the sum of the areas occupied by the resources to be displayed in the display interface of the plurality of audio input devices to the area of the display interface may be the largest.
  • the display parameters may include size information and display status of the resources to be displayed in each audio input device in the audio input device, and the size information may include "length", "width”, “aspect ratio", "area” etc.
  • the display state may include a landscape display state and a portrait display state.
  • the audio input device corresponding to the resource to be displayed can use JavaScript to determine whether it is in a horizontal screen display state or a vertical screen display state.
  • the audio input device generally supports the parameter window.orientation, then the audio input device can The display state is determined by window.orientation, and the display state is sent to the electronic device.
  • the electronic device may acquire size information of the video, that is, the electronic device may acquire size information such as "length", "width", “aspect ratio", and "area” of the video.
  • the audio input device can use JavaScript to obtain its sizing information and send the sizing information to the electronic device.
  • the electronic device determines the display layout by acquiring the display parameters of the resources to be displayed of multiple audio input devices, and can divide the display interface into multiple areas according to the above size information and display status, and divide each Regions are allocated to the resources to be displayed of an audio input device, so that the relationship between the sizes of the regions to which the resources to be displayed of different audio input devices are allocated can correspond to the size relationship between the size information in the audio input devices, for example , the size information of the resources to be displayed in the audio input device A is larger than the size information of the resources to be displayed in the audio input device B
  • the size of the area is also larger than the size allocated by the resources to be displayed of the audio input device B; and the display state of the resources to be displayed of each audio input device in the display interface also corresponds to the display state in the audio input device, for example, If the resource to be displayed on the audio input device A is displayed in landscape on the audio input device, the allocated area should also be in landscape.
  • the electronic device may also acquire the relative positional relationship between the audio input device and the electronic device for each audio input device that outputs the resource to be displayed, and then determine the display layout based on the relative positional relationship.
  • the relative positional relationship can be used to characterize the relative distance and relative angle between the audio input device and the electronic device.
  • the audio input device may be located directly in front of the electronic device, may be located in the front left of the electronic device, may be located in the front right of the electronic device, may be located in the upper front of the electronic device, or may be located in the lower front of the electronic device, etc.
  • the second source device can be located directly in front of the electronic device, can be located in the front left of the electronic device, can be located in the front right of the electronic device, can be located in the upper front of the electronic device, or can be located in the lower front of the electronic device, etc. Do limit.
  • the electronic device may include an ultra-wide band (UWB) sensor, and the audio input device may also include an ultra-wideband sensor, and the electronic device may obtain the difference between the audio input device and the electronic device through the two UWB sensors. relative positional relationship.
  • UWB ultra-wide band
  • the electronic device may include an image capture device, and the relative positional relationship between the audio input device and the electronic device may be acquired through the image capture device.
  • the display layout may be determined based on the relative positional relationship.
  • the display layout determined based on the relative positional relationship may include: The position of the display resource in the display interface is located in the left area of the display interface, and the position of the resource to be displayed of the second audio input device in the display interface is located in the right area of the display interface, etc., which are not limited here.
  • the electronic device may also combine the number of resources to be displayed of multiple audio input devices, the display parameters of the resources to be displayed, and the relative positional relationship between the audio input device and the electronic device to determine the display interface of each channel of video. display layout.
  • Step S530 Based on the first quantity, the second quantity and the display layout, assign at least one audio output channel of at least one audio output device to each audio input device, wherein each audio input device The assigned audio output channel corresponds to the display layout.
  • the electronic device when the electronic device allocates audio output channels to each audio input device, in addition to referring to the number of audio output devices and the number of audio input devices, the above display layout may also be referred to.
  • the electronic device may, in accordance with the principle of prioritizing the allocation of the entire audio output device to the audio input device, try to ensure that all audio output channels of an audio output device are allocated to the audio input device; the number of audio output devices cannot guarantee that one
  • all the audio output channels of the audio output device are assigned to the audio input device, then assign different channels of the audio output device to different audio input devices, and ensure that the audio output channels assigned to each audio input device are different, like this , the audio data of at least part of the audio input device can be played by the complete audio output device (that is, all channels of the audio output device are used to play the audio data of one audio input device), and it is convenient for users to distinguish different audio input devices.
  • the playback sound corresponding to the audio data of the device can also, according to the above display layout, enable the audio output channel allocated to the audio input device to be close to the display position of the resource to be displayed on the audio input device when allocating the audio output channel.
  • the resource A1 to be displayed corresponding to the audio input device 1 is located on the left side of the display interface of the electronic device, then the audio output channel on the left can be assigned to the audio input device 1; the audio input device 2 If the corresponding resource A2 to be displayed is located on the right side of the display interface of the electronic device, the audio output channel on the right side can be allocated to the audio input device 2 .
  • Step S540 Acquire audio data transmitted by the plurality of audio input devices.
  • Step S550 Play audio data transmitted by each audio input device based on the audio output channel allocated to each audio input device.
  • the display layout of the display content of the multiple audio input devices is performed, and the audio input devices are given priority according to the display layout.
  • FIG. 17 shows a schematic flowchart of an audio playback method provided by yet another embodiment of the present application.
  • the audio playback method is applied to the above-mentioned electronic equipment, and the flow shown in FIG. 17 will be described in detail below.
  • the audio playback method may specifically include the following steps:
  • Step S610 Acquire the number of multiple audio input devices and the audio output devices, wherein the number of the multiple audio input devices is taken as the first number, and the number of the audio output devices is taken as the second number.
  • Step S620 Based on the first number and the second number, assign at least one audio output channel of at least one audio output device to each audio input device, wherein the audio output channel assigned by each audio input device different.
  • Step S630 Acquire audio data transmitted by the multiple audio input devices.
  • Step S640 Play audio data transmitted by each audio input device based on the audio output channel allocated to each audio input device.
  • steps S610 to S640 reference may be made to the content of the foregoing embodiments, and details are not described herein again.
  • Step S650 when the number of audio input devices that input audio data to the electronic device changes, reassign at least one audio output to each audio input device based on the changed number of audio input devices and the second number At least one audio output channel of the device.
  • the electronic device can also monitor the number of audio input devices that input audio data to the electronic device in the process of playing the audio data input by each audio input device according to the audio output channels allocated above, When the number of audio input devices that input audio data to the electronic device changes, based on the changed number of audio input devices and the second number, the audio output channels are re-assigned to each audio input device, so that the assigned audio The output channel can be adapted to the current audio input device.
  • the changed number of audio input devices and the second number of audio output channels are re-allocated to each audio input device, you can refer to the foregoing embodiment, according to the first number and the second number of audio input How the device assigns at least one audio output channel.
  • Step S660 Play audio data transmitted by each audio input device based on the audio output channel reassigned to each audio input device.
  • the audio data transmitted by each audio input device may be played based on the reassigned audio output channel.
  • each audio input device is re-allocated
  • the audio output channel ensures the real-time distribution of the audio output channel, so that the user can distinguish the audio input by different audio input devices.
  • FIG. 18 shows a structural block diagram of an audio playback apparatus 400 provided by an embodiment of the present application.
  • the audio playback device 400 applies the above-mentioned electronic equipment, the electronic equipment includes at least one built-in audio output device and at least one external audio output device, the audio output devices each include a plurality of audio output channels, the audio playback device 400 includes: a quantity determination module 410 , an audio distribution module 420 , an audio acquisition module 430 and a playback module 440 .
  • the quantity determination module 410 is configured to acquire the quantity of multiple audio input devices and the audio output devices, wherein the number of the multiple audio input devices is taken as the first quantity, and the quantity of the audio output devices is taken as the first quantity.
  • the audio allocation module 420 is configured to allocate at least one audio output channel of at least one audio output device to each audio input device based on the first quantity and the second quantity, wherein each audio input
  • the audio output channels allocated by the devices are different
  • the audio acquisition module 430 is used to acquire the audio data transmitted by the multiple audio input devices
  • the playback module 440 is used to obtain the audio data based on the audio input devices allocated to each of the audio input devices
  • the output channel plays the audio data transmitted by each audio input device.
  • the audio distribution module 420 may include: a quantity determination unit and a first distribution unit.
  • the quantity judgment unit is used for judging whether the second quantity is less than the first quantity; the first allocation unit is used for allocating at least the first quantity to each audio input device if the second quantity is greater than or equal to the first quantity All audio output channels of an audio output device, wherein each audio input device is assigned a different audio output device.
  • the audio distribution module 420 may further include: a channel number acquisition unit, a ratio acquisition unit, a second distribution unit, and a third distribution unit.
  • the channel number acquisition unit is used to acquire the number of audio output channels of all the audio output devices as the third number if the second number is less than the first number;
  • the ratio acquisition unit is used to acquire the third number a ratio with the first number;
  • the second allocation unit is configured to allocate all audio output channels of at least one audio output device to some audio input devices in the plurality of audio input devices if the ratio is greater than a set threshold , wherein the audio output devices assigned by different audio input devices in the part of the audio input devices are different;
  • the third distribution unit is used to assign an audio output sound of the remaining audio output devices to each audio input device in the other audio input devices
  • the other audio input devices are audio input devices other than the part of the audio input devices in the plurality of audio input devices, wherein the audio output channels allocated by different audio input devices in the other audio input devices different.
  • the second allocating unit may be specifically configured to: determine the number of audio input devices to which all audio output channels of one audio output device are allocated among the plurality of audio input devices, as the fourth number; obtain the plurality of audio input devices the priority of each audio input device of the plurality of audio input devices; based on the priority of each audio input device, determining the fourth number of audio input devices as the partial audio from the plurality of audio input devices The input device, wherein the priority of the part of the audio input device is higher than the priority of the other audio input devices; all the audio output channels of the at least one audio output device are allocated to the part of the audio input device.
  • the audio distribution module 420 may further include: a fourth distribution unit.
  • the fourth allocating unit is configured to allocate at least one audio output channel to each of the plurality of audio input devices if the ratio is less than or equal to the set threshold.
  • the audio distribution module 420 may also include: a position relationship acquisition unit and a fifth distribution unit.
  • the positional relationship acquisition unit is used for acquiring the relative positional relationship between each audio input device and the electronic device;
  • the fifth allocating unit is used for acquiring the relative positional relationship between the first quantity, the second quantity and the each audio
  • the relative positional relationship between the input device and the electronic device, at least one audio output channel of at least one audio output device is allocated to each audio input device, wherein the audio output channel allocated to each audio input device corresponding to the relative positional relationship.
  • the audio distribution module 420 may also include: a distance acquisition unit and a sixth distribution unit.
  • the distance obtaining unit is used to obtain the distance of each audio input device relative to the electronic device;
  • the sixth allocating unit is used to obtain the relative distance of each audio input device based on the first quantity, the second quantity and the relative distance of each audio input device.
  • the distance of the electronic device, at least one audio output channel of at least one audio output device is allocated to each audio input device, wherein the number of audio output channels allocated by each audio input device is the same as the number of audio output channels allocated by the each audio input device. distance is positively correlated.
  • the audio input device is further configured to transmit the resource to be displayed to the electronic device for display.
  • the audio playback apparatus 400 may further include a display layout module configured to allocate at least one audio output of at least one audio output device to each audio input device based on the first quantity and the second quantity Before the channel, the display layout is performed on the resources to be displayed corresponding to each audio input device.
  • the audio allocation module 420 may also be specifically configured to: based on the first quantity, the second quantity and the display layout, allocate at least one audio output channel of at least one audio output device to each audio input device, wherein, The audio output channel assigned to each audio input device corresponds to the display layout.
  • the audio distribution module 420 is further configured to, when the number of audio input devices for inputting audio data to the electronic device changes, based on the changed number of audio input devices and the second number, re-allocate Each audio input device is assigned at least one audio output channel of at least one audio output device.
  • the coupling between the modules may be electrical, mechanical or other forms of coupling.
  • each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist physically alone, or two or more modules may be integrated into one module.
  • the above-mentioned integrated modules can be implemented in the form of hardware, and can also be implemented in the form of software function modules.
  • the solution provided by the present application allocates at least one audio output channel of at least one audio output device to each audio input device according to the number of audio input devices and the number of audio output devices, and then obtains multiple audio output channels.
  • the audio data transmitted by the audio input device plays the audio data transmitted by each audio input device based on the audio output channel assigned to each audio input device, thereby realizing the assignment of different audio output channels to different audio input devices. , which is convenient for users to clearly distinguish the sounds input by different audio input devices and improve the user experience.
  • the electronic device 100 may be an electronic device capable of running an application program, such as a smart TV, a notebook computer, a desktop computer, or the like.
  • the electronic device 100 in the present application may include one or more of the following components: a processor 110, a memory 120, a display screen 130, an audio output device 140, and one or more application programs, wherein one or more application programs may be stored in In the memory 120 and configured to be executed by the one or more processors 110, one or more programs are configured to perform the methods described in the foregoing method embodiments.
  • the processor 110 may include one or more processing cores.
  • the processor 110 uses various interfaces and lines to connect various parts of the entire electronic device 100, and executes by running or executing the instructions, programs, code sets or instruction sets stored in the memory 120, and calling the data stored in the memory 120.
  • the processor 110 may adopt at least one of a digital signal processing (Digital Signal Processing, DSP), a Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), and a Programmable Logic Array (Programmable Logic Array, PLA).
  • DSP Digital Signal Processing
  • FPGA Field-Programmable Gate Array
  • PLA Programmable Logic Array
  • the processor 110 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU), a modem, and the like.
  • CPU Central Processing Unit
  • GPU Graphics Processing Unit
  • the CPU mainly handles the operating system, user interface and application programs, etc.
  • the GPU is used for rendering and drawing of the display content
  • the modem is used to handle wireless communication. It can be understood that, the above-mentioned modem may also not be integrated into the processor 110, and is implemented by a communication chip alone.
  • the memory 120 may include random access memory (Random Access Memory, RAM), or may include read-only memory (Read-Only Memory). Memory 120 may be used to store instructions, programs, codes, sets of codes, or sets of instructions.
  • the memory 120 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.) , instructions for implementing the following method embodiments, and the like.
  • the storage data area may also store data (such as phone book, audio and video data, chat record data) created by the electronic device 100 during use.
  • the display screen 130 is used to display information input by the user, information provided to the user, and various graphical user interfaces of the electronic device 100, which may be composed of graphics, text, icons, numbers, videos, and any combination thereof.
  • the display screen 130 may be a liquid crystal display (Liquid Crystal Display, LCD) or an organic light-emitting diode (Organic Light-Emitting Diode, OLED), which is not limited herein.
  • the audio output device 140 is used for converting digital audio information into analog audio signal output, and also for converting analog audio input into digital audio signal. Audio output device 140 may also be used to encode and decode audio signals. In some manners, the audio output device 140 may include speakers, receivers, microphones, etc., which are not limited herein.
  • FIG. 20 shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application.
  • the computer-readable medium 800 stores program codes, and the program codes can be invoked by the processor to execute the methods described in the above method embodiments.
  • the computer readable storage medium 800 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM.
  • the computer-readable storage medium 800 includes a non-transitory computer-readable storage medium.
  • Computer readable storage medium 800 has storage space for program code 810 to perform any of the method steps in the above-described methods. These program codes can be read from or written to one or more computer program products.
  • Program code 810 may be compressed, for example, in a suitable form.

Abstract

Disclosed in the present application are an audio playback method and apparatus, an electronic device, and a storage medium, the method being used in the electronic device, the electronic device comprising at least one built-in audio output apparatus and at least one externally-connecting audio output apparatus, each audio output apparatus comprising a plurality of audio output channels, and the method comprising: acquiring the number of a plurality of audio input devices and audio output apparatuses; on the basis of the number of the plurality of audio input devices and the number of audio output apparatuses, allocating at least one audio output channel of at least one audio output apparatus to each audio input device, the audio output channel allocated to each audio input device being different; acquiring audio data transmitted by the plurality of audio input devices; and, on the basis of the audio output channel allocated to each audio input device, implementing playback of the audio data transmitted by each audio input device. The present method enables the user to conveniently clearly distinguish the sound inputted by different audio input devices, enhancing the user experience.

Description

音频播放方法、装置、电子设备及存储介质Audio playback method, device, electronic device and storage medium
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本申请要求于2020年10月15日提交的申请号为202011105792.0的中国申请的优先权,其在此出于所有目的通过引用将其全部内容并入本文。This application claims priority to Chinese Application No. 202011105792.0 filed on October 15, 2020, which is hereby incorporated by reference in its entirety for all purposes.
技术领域technical field
本申请涉及音频技术领域,更具体地,涉及一种音频播放方法、装置、电子设备及存储介质。The present application relates to the field of audio technology, and more particularly, to an audio playback method, device, electronic device, and storage medium.
背景技术Background technique
随着科技水平的进步,投屏功能已经广泛应用到电子设备中。例如,用户可以将资源提供设备(如智能手机)中的视频画面投射至资源显示设备(如电视)中进行显示,方便用户在资源显示设备上查看资源提供设备中的显示内容。另外,随着投屏技术的发展,在投屏应用场景下,可将多个资源提供设备中播放的视频画面投射至同一资源显示设备中显示。但是,电子设备在显示多个设备投射的视频时,通常是将多个设备投射的视频中的音频数据进行混音后再进行播放,从而造成对视频进行投屏时的声音播放效果较差,影响了用户体验。With the advancement of science and technology, the screen projection function has been widely used in electronic devices. For example, a user can project a video image in a resource providing device (such as a smart phone) to a resource display device (such as a TV) for display, so that the user can view the display content in the resource providing device on the resource display device. In addition, with the development of screen projection technology, in a screen projection application scenario, video images played in multiple resource providing devices can be projected to the same resource display device for display. However, when an electronic device displays a video projected by multiple devices, it usually mixes the audio data in the video projected by multiple devices before playing it, resulting in poor sound playback effect when the video is projected. affect the user experience.
发明内容SUMMARY OF THE INVENTION
鉴于上述问题,本申请提出了一种音频播放方法、装置、电子设备及存储介质。In view of the above problems, the present application proposes an audio playback method, device, electronic device and storage medium.
第一方面,本申请实施例提供了一种音频播放方法,应用于电子设备,所述电子设备包括至少一个内置的音频输出装置以及至少一个外接的音频输出装置,所述音频输出装置均包括多个音频输出声道,所述方法包括:获取多个音频输入设备以及所述音频输出装置的数量,其中,所述多个音频输入设备的数量作为第一数量,所述音频输出装置的数量作为第二数量;基于所述第一数量以及所述第二数量,对每个音频输入设备分配至少一个音频输出装置的至少一个音频输出声道;获取所述多个音频输入设备传输的音频数据;基于对所述每个音频输入设备分配的音频输出声道,对所述每个音频输入设备传输的音频数据进行播放。In a first aspect, an embodiment of the present application provides an audio playback method, which is applied to an electronic device. The electronic device includes at least one built-in audio output device and at least one external audio output device, and the audio output device includes multiple audio output devices. audio output channels, the method includes: acquiring multiple audio input devices and the number of the audio output devices, wherein the number of the multiple audio input devices is taken as the first number, and the number of the audio output devices is taken as a second quantity; based on the first quantity and the second quantity, allocating at least one audio output channel of at least one audio output device to each audio input device; acquiring audio data transmitted by the plurality of audio input devices; The audio data transmitted by each audio input device is played based on the audio output channel assigned to each audio input device.
第二方面,本申请实施例提供了一种音频播放装置,应用于电子设备,所述电子设备包括至少一个内置的音频输出装置以及至少一个外接的音频输出装置,所述音频输出装置均包括多个音频输出声道,所述装置包括:数量确定模块、音频分配模块、音频获取模块以及播放模块,其中,所述数量确定模块用于获取多个音频输入设备以及所述音频输出装置的数量,其中,所述多个音频输入设备的数量作为第一数量,所述音频输出装置的数量作为第二数量;所述音频分配模块用于基于所述第一数量以及所述第二数量,对每个音频输入设备分配至少一个音频输出装置的至少一个音频输出声道;所述音频获取模块用于获取所述多个音频输入设备传输的音频数据;所述播放模块用于基于对所述每个音频输入设备分配的音频输出声道,对所述每个音频输入设备传输的音频数据进行播放。In a second aspect, an embodiment of the present application provides an audio playback device, which is applied to an electronic device. The electronic device includes at least one built-in audio output device and at least one external audio output device, and the audio output device includes multiple audio output devices. audio output channels, the device includes: a quantity determination module, an audio distribution module, an audio acquisition module and a playback module, wherein the quantity determination module is used to acquire the number of multiple audio input devices and the audio output devices, Wherein, the number of the plurality of audio input devices is used as the first number, and the number of the audio output devices is used as the second number; the audio distribution module is configured to, based on the first number and the second number, assign each Each audio input device is allocated at least one audio output channel of at least one audio output device; the audio acquisition module is used to acquire the audio data transmitted by the plurality of audio input devices; the playback module is used to The audio output channel allocated by the audio input device plays the audio data transmitted by each audio input device.
第三方面,本申请实施例提供了一种电子设备,包括:一个或多个处理器;存储器;一个或多个应用程序,其中所述一个或多个应用程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个程序配置用于执行上述第一方面提供的音频播放方法。In a third aspect, embodiments of the present application provide an electronic device, comprising: one or more processors; a memory; and one or more application programs, wherein the one or more application programs are stored in the memory and Configured to be executed by the one or more processors, the one or more programs are configured to execute the audio playback method provided by the first aspect.
第四方面,本申请实施例提供了一种计算机可读取存储介质,所述计算机可读取存储介质中存储有程序代码,所述程序代码可被处理器调用执行上述第一方面提供的音频播放方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where a program code is stored in the computer-readable storage medium, and the program code can be called by a processor to execute the audio provided in the first aspect. play method.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present application more clearly, the following briefly introduces the drawings that are used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, other drawings can also be obtained from these drawings without creative effort.
图1示出了本申请实施例提供的应用环境的一种架构示意图。FIG. 1 shows a schematic structural diagram of an application environment provided by an embodiment of the present application.
图2示出了本申请实施例提供的应用环境的另一种架构示意图。FIG. 2 shows another schematic structural diagram of an application environment provided by an embodiment of the present application.
图3示出了根据本申请一个实施例的音频播放方法流程图。FIG. 3 shows a flowchart of an audio playback method according to an embodiment of the present application.
图4示出了根据本申请另一个实施例的音频播放方法流程图。FIG. 4 shows a flowchart of an audio playback method according to another embodiment of the present application.
图5示出了本申请另一个实施例提供的音频播放方法的第一种原理示意图。FIG. 5 shows a schematic diagram of a first principle of an audio playback method provided by another embodiment of the present application.
图6示出了本申请另一个实施例提供的音频播放方法的第二种原理示意图。FIG. 6 shows a schematic diagram of a second principle of an audio playback method provided by another embodiment of the present application.
图7示出了本申请另一个实施例提供的音频播放方法的第三种原理示意图。FIG. 7 shows a schematic diagram of a third principle of an audio playback method provided by another embodiment of the present application.
图8示出了本申请另一个实施例提供的音频播放方法的第四种原理示意图。FIG. 8 shows a schematic diagram of a fourth principle of an audio playback method provided by another embodiment of the present application.
图9示出了本申请另一个实施例提供的音频播放方法的第五种原理示意图。FIG. 9 shows a schematic diagram of a fifth principle of an audio playback method provided by another embodiment of the present application.
图10示出了本申请另一个实施例提供的音频播放方法的第六种原理示意图。FIG. 10 shows a schematic diagram of the sixth principle of the audio playback method provided by another embodiment of the present application.
图11示出了本申请另一个实施例提供的音频播放方法的第七种原理示意图。FIG. 11 shows a schematic diagram of a seventh principle of an audio playback method provided by another embodiment of the present application.
图12示出了本申请另一个实施例提供的音频播放方法的第八种原理示意图。FIG. 12 shows a schematic diagram of an eighth principle of an audio playback method provided by another embodiment of the present application.
图13示出了根据本申请又一个实施例的音频播放方法流程图。FIG. 13 shows a flowchart of an audio playback method according to yet another embodiment of the present application.
图14示出了根据本申请再一个实施例的音频播放方法流程图。FIG. 14 shows a flowchart of an audio playback method according to still another embodiment of the present application.
图15示出了本申请再一个实施例提供的音频播放方法的原理示意图。FIG. 15 shows a schematic diagram of the principle of an audio playback method provided by still another embodiment of the present application.
图16示出了根据本申请又另一个实施例的音频播放方法流程图。FIG. 16 shows a flowchart of an audio playback method according to yet another embodiment of the present application.
图17示出了根据本申请又再一个实施例的音频播放方法流程图。FIG. 17 shows a flowchart of an audio playback method according to still another embodiment of the present application.
图18示出了根据本申请一个实施例的音频播放装置的一种框图。FIG. 18 shows a block diagram of an audio playback apparatus according to an embodiment of the present application.
图19是本申请实施例的用于执行根据本申请实施例的音频播放方法的电子设备的框图。FIG. 19 is a block diagram of an electronic device for executing an audio playback method according to an embodiment of the present application according to an embodiment of the present application.
图20是本申请实施例的用于保存或者携带实现根据本申请实施例的音频播放方法的程序代码的存储单元。FIG. 20 is a storage unit for storing or carrying a program code for implementing the audio playback method according to the embodiment of the present application according to the embodiment of the present application.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。In order to make those skilled in the art better understand the solutions of the present application, the following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application.
目前,投屏功能广泛的应用于生活中,用户可以通过将一个设备中显示的内容投射至另一设备进行显示,并且可以将音频数据传输至另一设备进行播放。例如,用户通过智能手机播放视频时,可以将移动终端上播放的视频投射至另一设备(例如智能电视等)上进行显示,并将视频的音频数据传输至另一设备进行播放,以方便用户有更佳的视频观看体验;又例如,用户通过智能手表播放音乐时,可以将智能手表上显示的音频播放界面投射到电脑上进行显示,并且通过电脑输出播放的音乐。At present, the screen projection function is widely used in daily life. Users can project content displayed on one device to another device for display, and can transmit audio data to another device for playback. For example, when a user plays a video through a smart phone, he can project the video played on the mobile terminal to another device (such as a smart TV, etc.) for display, and transmit the audio data of the video to another device for playback, so as to facilitate the user There is a better video viewing experience; for another example, when the user plays music through the smart watch, the user can project the audio playback interface displayed on the smart watch to the computer for display, and output the played music through the computer.
逐渐的,一些电子设备可以实现多个设备投射的显示内容的显示,并且可以将多个设备输入的音频数据进行播放,但是电子设备在将多个设备输入的音频数据进行播放时,通常是将多个设备输入的音频混音后进行输出,但是在混音后进行播放时,用户无法分辨各个设备输入的音频而产生混乱的感觉,造成播放效果不佳。Gradually, some electronic devices can realize the display of the display content projected by multiple devices, and can play the audio data input by multiple devices, but when the electronic device plays the audio data input by multiple devices, it usually Audio input from multiple devices is mixed and then output, but when the audio is played after mixing, the user cannot distinguish the audio input from each device, resulting in a chaotic feeling, resulting in poor playback effect.
针对上述问题,发明人提出了本申请实施例提供的音频播放方法、装置、电子设备以及存储介质,可以实现对不同的音频输入设备分配不同的音频输出声道,方便用户清楚地区分不同音频输入设备输入的声音,提升用户体验。其中,具体的音频播放方法在后续的实施例中进行详细的说明。In view of the above problems, the inventor proposes the audio playback method, device, electronic device, and storage medium provided by the embodiments of the present application, which can realize the assignment of different audio output channels to different audio input devices, and facilitate users to clearly distinguish different audio input. The sound input by the device enhances the user experience. The specific audio playback method will be described in detail in the following embodiments.
下面对本申请实施例提供的视频渲染方法的应用环境进行介绍。The following describes an application environment of the video rendering method provided by the embodiments of the present application.
请参阅图1,图1示出了为本申请实施例应用场景的一种架构图,该应用场景可以包括电子设备100以及多个输入设备200。电子设备100可以为如图1中所示的智能电视等,当然,电子设备100也可以为其他具有显示功能的设备,例如,台式电脑、笔记本电脑等,在此不做限定。输入设备200可以为智能手机、平板电脑、智能手表、电脑等设备。在该应用场景中,输入设备200可以作为资源提供设备,将显示内容投射到电子设备100进行显示,当然,输入设备200还可以将音频内容传输至电子设备100进行播放。Referring to FIG. 1 , FIG. 1 shows an architecture diagram of an application scenario of an embodiment of the present application, and the application scenario may include an electronic device 100 and multiple input devices 200 . The electronic device 100 may be a smart TV or the like as shown in FIG. 1 . Of course, the electronic device 100 may also be other devices with display functions, such as a desktop computer, a notebook computer, etc., which are not limited herein. The input device 200 may be a smart phone, a tablet computer, a smart watch, a computer, or other devices. In this application scenario, the input device 200 can be used as a resource providing device to project the display content to the electronic device 100 for display. Of course, the input device 200 can also transmit the audio content to the electronic device 100 for playback.
在一些实施方式中,电子设备100与输入设备200可以进行通信,以完成数据交互。其中,电子设备100与输入设备200可以通过局域网(local area network,LAN)进行通信,也可以通过广域网(wide area network,WAN)互相通信。例如,电子设备100与输入设备200可以同时连接至一个路由器,电子设备100与输入设备200可以通过路由器所提供的局域网进行通信;又例如,电子设备100与输入设备200可以与云端进行通信,并通过云端实现两者之间的数据交互;再例如,电子设备100与输入设备200也可以通过蓝牙、Zigbee、WebRTC等通信方式,建立端到端的网络连接(即P2P网络连接),并通过建立的网络连接进行通信。当然,电子设备100与输入设备200之间的通信方式可以不做限定。In some embodiments, the electronic device 100 and the input device 200 may communicate to complete data interaction. The electronic device 100 and the input device 200 may communicate with each other through a local area network (LAN), or communicate with each other through a wide area network (WAN). For example, the electronic device 100 and the input device 200 can be connected to a router at the same time, and the electronic device 100 and the input device 200 can communicate through the local area network provided by the router; for another example, the electronic device 100 and the input device 200 can communicate with the cloud, and The data interaction between the two is realized through the cloud; for another example, the electronic device 100 and the input device 200 can also establish an end-to-end network connection (ie, a P2P network connection) through Bluetooth, Zigbee, WebRTC and other communication methods, and through the established network connection for communication. Of course, the communication manner between the electronic device 100 and the input device 200 may not be limited.
在一些场景中,电子设备100可以为大屏设备(例如图1所示的智能电视等),用户可以将智能手机、平板电脑、智能手表等小屏设备上的显示内容投射至大屏设备进行显示,从而提升用户查看显示内容时的体验。另外,电子设备100可以同时接收多个输入设备200投射的内容,并将多个输入设备200投射的内容进行显示,从而可以实现多个输入设备200投射内容至电子设备100进行显示,使用户可以同时查看多个输入设备200投屏的内容,极大地提升了用户体验。In some scenarios, the electronic device 100 may be a large-screen device (such as the smart TV shown in FIG. 1 , etc.), and the user can project the display content on the small-screen device such as a smartphone, tablet computer, smart watch, etc., to the large-screen device. display, thereby enhancing the user experience when viewing the displayed content. In addition, the electronic device 100 can simultaneously receive the content projected by the multiple input devices 200 and display the content projected by the multiple input devices 200, so that the content projected by the multiple input devices 200 can be projected to the electronic device 100 for display, so that the user can Viewing the contents projected by multiple input devices 200 at the same time greatly improves the user experience.
在一些实施方式中,电子设备100可以根据接收的多个输入设备100的显示内容,对多个输入设备输入的显示内容进行显示布局(例如布局位置、显示区域的大小等),然后基于显示布局,对多个输入设备输入的显示内容进行渲染后,在显示屏上进行显示。In some embodiments, the electronic device 100 may perform a display layout (eg, layout position, size of the display area, etc.) for the display contents input by the multiple input devices according to the received display contents of the multiple input devices 100, and then based on the display layout , after rendering the display content input by multiple input devices, display it on the display screen.
在一些实施方式中,电子设备100可以包括内容接收模块、第一能力协商模块、布局生成模块以及显示渲染模块;输入设备200可以包括内容采集模块、内容发送模块以及第二能力协商模块。In some embodiments, the electronic device 100 may include a content receiving module, a first capability negotiation module, a layout generating module, and a display rendering module; the input device 200 may include a content acquisition module, a content sending module, and a second capability negotiation module.
其中,输入设备200可以首先通过内容采集模块采集内容作为待显示内容,再通过内容发送模块将待显示内容通过无线等方式传输给电子设备100,在电子设备100由内容接收模块负责接收。同时,输入设备200的第二能力协商模块和电子设备100的第一能力协商模块,负责协商双方的软硬件能力,同时在电子设备100上依据当前画面的路数即显示区域大小,动态协商出最优的显示参数(如分辨率/比特率/帧率),并反馈给输入设备200进行自适应调优。电子设备100的布局生成模块根据当前的约束条件(如接入的输入设备的个数、输入设备自身的显示参数信息、电子设备的显示参数信息等),综合考虑各方面的因素,依照布局原则,动态生成显示布局。生成好当前的布局方式之后,再交由显示渲染模块依据布局将待显示内容进行绘制并显示。The input device 200 can first collect the content as the content to be displayed through the content collection module, and then transmit the content to be displayed to the electronic device 100 through the content sending module wirelessly, and the content receiving module is responsible for receiving the content in the electronic device 100 . At the same time, the second capability negotiation module of the input device 200 and the first capability negotiation module of the electronic device 100 are responsible for negotiating the software and hardware capabilities of both parties. The optimal display parameters (such as resolution/bit rate/frame rate) are fed back to the input device 200 for adaptive tuning. The layout generation module of the electronic device 100 comprehensively considers various factors according to the current constraints (such as the number of input devices connected, the display parameter information of the input device itself, the display parameter information of the electronic device, etc.), and follows the layout principle. , which dynamically generates the display layout. After the current layout mode is generated, it is then handed over to the display rendering module to draw and display the content to be displayed according to the layout.
请参阅图2,电子设备100可以包括至少一个内置的第一音频输出装置140以及至少一个外接的第二音频输出装置150。其中,第一音频输出装置141包括至少一个第一音频输出声道142,第二音频输出装置143包括至少一个第二音频输出声道144。需要说明的是,第一音频输出装置141的数量可以不做限定(图2中仅示出1个),第二音频输出装置143的数量可以不做限定(图2中仅示出2个),第一音频输出装置141的第一音频输出声道的数量可以不做限定(图2中仅示出4个),第二音频输出装置143的第二音频输出声道的数量可以不做限定(图2中仅示出2个)。电子设备100可以通过以上的各个音频输出装置的音频输出声道来输出声音,在电子设备100接收多个输入设备200输入的音频数据进行输出时,电子设备100可以为多个输入设备200分配至少一个上述的音频输出装置的至少一个音频输出声道,且保证每个输入设备200所分配的音频输出声道不同,从而使得每个输入设备200的音频数据不会共用相同的音频输出声道输出音频数据,方便用户区分不同输入设备的音频数据对应的声音。Referring to FIG. 2 , the electronic device 100 may include at least one built-in first audio output device 140 and at least one externally connected second audio output device 150 . The first audio output device 141 includes at least one first audio output channel 142 , and the second audio output device 143 includes at least one second audio output channel 144 . It should be noted that the number of the first audio output devices 141 may not be limited (only one is shown in FIG. 2 ), and the number of the second audio output devices 143 may be unlimited (only two are shown in FIG. 2 ) , the number of the first audio output channels of the first audio output device 141 may not be limited (only 4 are shown in FIG. 2 ), and the number of the second audio output channels of the second audio output device 143 may not be limited (Only 2 are shown in Figure 2). The electronic device 100 can output sound through the audio output channels of the above audio output devices. When the electronic device 100 receives audio data input from multiple input devices 200 for output, the electronic device 100 can assign at least one audio data to the multiple input devices 200. At least one audio output channel of the above-mentioned audio output device, and ensure that the audio output channels allocated by each input device 200 are different, so that the audio data of each input device 200 will not share the same audio output channel output Audio data, which is convenient for users to distinguish sounds corresponding to audio data of different input devices.
请参阅图3,图3示出了本申请一个实施例提供的音频播放方法的流程示意图。在具体的实施例中,所述音频播放方法应用于如图18所示的音频播放装置400以及配置有所述音频播放装置400的电子设备100(图19)。该电子设备包括至少一个内置的音频输出装置以及至少一个外接的音频输出装置,所述音频输出装置均包括多个音频输出声道。下面将以电子设备为例,说明本实施例的具体流程,当然,可以理解的,本实施例所应用的电子设备可以为智能电视、笔记本电脑、台式电脑等,在此不做限定。下面将针对图3所示的流程进行详细的阐述,所述音频播放方法具体可以包括以下步骤:Please refer to FIG. 3, which shows a schematic flowchart of an audio playback method provided by an embodiment of the present application. In a specific embodiment, the audio playback method is applied to the audio playback apparatus 400 shown in FIG. 18 and the electronic device 100 ( FIG. 19 ) equipped with the audio playback apparatus 400 . The electronic device includes at least one built-in audio output device and at least one external audio output device, each of which includes a plurality of audio output channels. The following will take an electronic device as an example to describe the specific process of this embodiment. Of course, it can be understood that the electronic device applied in this embodiment may be a smart TV, a notebook computer, a desktop computer, etc., which is not limited here. The flow shown in FIG. 3 will be described in detail below, and the audio playback method may specifically include the following steps:
步骤S110:获取多个音频输入设备以及所述音频输出装置的数量,其中,所述多个音频输入设备的数量作为第一数量,所述音频输出装置的数量作为第二数量。Step S110: Acquire the number of multiple audio input devices and the audio output devices, wherein the number of the multiple audio input devices is taken as the first number, and the number of the audio output devices is taken as the second number.
在本申请实施例中,电子设备可以从多个音频输入设备接收输入的音频数据,并基于内置的音频输出装置以及外接的音频输出装置的音频输出声道,对接收的音频数据进行播放。In this embodiment of the present application, the electronic device may receive input audio data from multiple audio input devices, and play the received audio data based on the built-in audio output device and the audio output channels of the external audio output device.
在一些实施方式中,音频输入设备可以为投屏场景中的输入设备,音频输入设备可以输入音频数据至电子设备进行播放,也可以输入显示内容至电子设备进行显示。In some embodiments, the audio input device may be an input device in a screen projection scenario, and the audio input device may input audio data to the electronic device for playback, or input display content to the electronic device for display.
在一些实施方式中,电子设备可以与各个音频输入设备建立网络连接,以便根据建立的网络连接从音频输入设备接收输入的数据。其中,电子设备可以通过无线通信的方式与音频输入设备建立网络连接,例如,可以通过蓝牙、WiFi网络等方式建立网络连接,具体利用的通信方式可以不做限定。In some embodiments, the electronic device may establish a network connection with each audio input device to receive input data from the audio input device according to the established network connection. Wherein, the electronic device can establish a network connection with the audio input device by means of wireless communication, for example, a network connection can be established by means of Bluetooth, WiFi network, etc., and the specific communication method used may not be limited.
示例性的,电子设备通过WiFi网络的方式与音频输入设备建立网络连接时,电子设备可以展示处于同一WiFi网络下的设备列表,然后检测用户对设备的选择操作,根据检测到的选择操作,与用户选择的设备建立网络连接。同样的,建立电子设备与音频输入设备的网络连接也可以根据用户于音频输入设备的操作而建立,对于音频输入设备,例如智能手机,音频输入设备同样可以展示处于同一WiFi网络下的电子设备的设备列表,然后检测用户对设备的选择操作,根据检测到 的选择操作,与用户选择的电子设备建立网络连接。Exemplarily, when the electronic device establishes a network connection with the audio input device through the WiFi network, the electronic device can display a list of devices under the same WiFi network, and then detect the user's selection operation on the device, and according to the detected selection operation, and The device selected by the user establishes a network connection. Similarly, establishing a network connection between an electronic device and an audio input device can also be established according to the user's operation on the audio input device. For an audio input device, such as a smartphone, the audio input device can also display the information of the electronic device under the same WiFi network. device list, and then detect the user's selection operation on the device, and establish a network connection with the electronic device selected by the user according to the detected selection operation.
在本申请实施例中,电子设备在对音频输入设备输入的音频数据进行播放时,可以确定此时输入音频数据的音频输入设备的数量,以及电子设备的音频输出装置的数量,以根据确定的音频输入设备的数量以及音频输出装置的数量,对音频输入设备所对应的音频输出声道进行分配。其中,确定的音频输入设备的数量可以作为第一数量,确定的音频输出装置的数量可以作为第二数量。In this embodiment of the present application, when the electronic device plays the audio data input by the audio input device, it can determine the number of audio input devices that input audio data at this time, and the number of audio output devices of the electronic device, so as to determine the number of audio output devices of the electronic device according to the determined number of audio input devices. The number of audio input devices and the number of audio output devices allocate the audio output channels corresponding to the audio input devices. The determined number of audio input devices may be used as the first number, and the determined number of audio output devices may be used as the second number.
在一些实施方式中,电子设备可以根据当前建立有网络连接的音频输入设备,确定音频输入设备的数量。电子设备可以检测外接的音频输出装置,确定出外接的音频输出装置的数量,并且可以确定自身内置的音频输出装置的数量,然后获取外接的音频输出装置的数量与内置的音频输出装置的数量之和,即获得音频输出装置的数量。作为一种方式,由于电子设备与音频输入设备建立有网络连接时,音频输入设备并不一定会开始投屏或者输入音频至电子设备,因此电子设备可以确定实际的进行投屏或者输入音频数据至电子设备的音频输入设备的数量,例如,电子设备可以确定发送了投屏指令至电子设备,且与电子设备建立有网络连接的音频输入设备的数量。In some embodiments, the electronic device may determine the number of audio input devices according to the audio input devices currently established with the network connection. The electronic device can detect the external audio output devices, determine the number of external audio output devices, and can determine the number of its own built-in audio output devices, and then obtain the difference between the number of external audio output devices and the number of built-in audio output devices. and, that is, the number of audio output devices is obtained. As a method, when the electronic device establishes a network connection with the audio input device, the audio input device does not necessarily start to project the screen or input audio to the electronic device, so the electronic device can determine the actual screen projection or input audio data to the electronic device. The number of audio input devices of the electronic device, for example, the electronic device may determine the number of audio input devices that have sent a screen projection command to the electronic device and have established a network connection with the electronic device.
步骤S120:基于所述第一数量以及所述第二数量,对每个音频输入设备分配至少一个音频输出装置的至少一个音频输出声道,其中,每个音频输入设备所分配的音频输出声道不同。Step S120: Based on the first number and the second number, assign at least one audio output channel of at least one audio output device to each audio input device, wherein the audio output channel assigned by each audio input device different.
在本申请实施例中,电子设备在确定出音频输入设备以及音频输出装置的数量之后,则可以根据以上第一数量以及第二数量,对音频输入设备分配音频输出声道。其中,电子设备可以对基于第一数量以及第二数量,对每个音频输入设备分配至少一个音频输出装置的至少一个音频输出声道。In this embodiment of the present application, after determining the number of audio input devices and audio output devices, the electronic device may allocate audio output channels to the audio input device according to the above first number and second number. The electronic device may allocate at least one audio output channel of at least one audio output device to each audio input device based on the first number and the second number.
在一些实施方式中,电子设备可以按照优先分配整个音频输出装置至音频输入设备的原则,尽量保证将一个音频输出装置的全部音频输出声道分配给音频输入设备;在音频输出装置的数量不能保证能够将一个音频输出装置的全部音频输出声道分配给音频输入设备时,再将音频输出装置的不同声道分配至不同的音频输入设备,并且保证每个音频输入设备所分配的音频输出声道不同,如此,可以使得至少部分音频输入设备的音频数据能够被完整的音频输出装置进行播放(即音频输出装置的全部声道都用于播放一个音频输入设备的音频数据),并且可以方便用户区分不同音频输入设备的音频数据对应的播放声音。In some embodiments, the electronic device may try to ensure that all audio output channels of an audio output device are allocated to the audio input device according to the principle of prioritizing the allocation of the entire audio output device to the audio input device; the number of audio output devices cannot be guaranteed. When all the audio output channels of an audio output device can be assigned to the audio input device, the different channels of the audio output device can be assigned to different audio input devices, and the audio output channels assigned by each audio input device are guaranteed. In this way, at least part of the audio data of the audio input device can be played by the complete audio output device (that is, all channels of the audio output device are used to play the audio data of one audio input device), and it is convenient for the user to distinguish Playing sounds corresponding to the audio data of different audio input devices.
步骤S130:获取所述多个音频输入设备传输的音频数据。Step S130: Acquire audio data transmitted by the plurality of audio input devices.
在本申请实施例中,电子设备在对每个音频输入设备分配音频输出声道之后,则可以获取这些音频输入设备所输入的音频数据,以进行播放。其中,电子设备可以根据与音频输入设备所建立的网络连接,接收音频输入设备传输的音频数据,即得到待进行播放的音频数据。在一些实施方式中,音频输入设备输入的音频数据可以为音乐、视频、游戏等内容的音频数据,在此不做限定。In this embodiment of the present application, after assigning audio output channels to each audio input device, the electronic device may acquire audio data input by these audio input devices for playback. The electronic device can receive the audio data transmitted by the audio input device according to the network connection established with the audio input device, that is, obtain the audio data to be played. In some embodiments, the audio data input by the audio input device may be audio data of content such as music, video, games, etc., which is not limited herein.
步骤S140:基于对所述每个音频输入设备分配的音频输出声道,对所述每个音频输入设备传输的音频数据进行播放。Step S140: Play audio data transmitted by each audio input device based on the audio output channel allocated to each audio input device.
在本申请实施例中,电子设备在获取到以上多个音频输入设备输入的音频数据之后,则可以对音频数据进行解复,再进行解码后,根据对每个音频输入设备分配的音频输出声道,对每个音频输入设备传输的音频数据进行播放。In the embodiment of the present application, after acquiring the audio data input by the above multiple audio input devices, the electronic device can de-multiplex the audio data, and after decoding, output the sound according to the audio allocated to each audio input device. channel to play the audio data transmitted by each audio input device.
本申请实施例提供的音频播放方法,通过根据音频输入设备的数量,以及音频输出装置的数量,对每个音频输入设备分配至少一个音频输出装置的至少一个音频输出声道,然后获取多个音频输入设备传输的音频数据,基于对每个音频输入设备分配的音频输出声道,对每个音频输入设备传输的音频数据进行播放,从而实现对不同的音频输入设备分配不同的音频输出声道,方便用户清楚地区分不同音频输入设备输入的声音,提升用户体验。另外,由于电子设备不仅内置有音频输出装置,还外接有音频输出装置,且每个音频输出装置包括多个音频输出声道,因此可以在音频输入设备的数量较多时,也能够保证音频输入设备输入的音频数据在不同的音频输出声道进行播放,提升了声音的播放效果。In the audio playback method provided by the embodiments of the present application, according to the number of audio input devices and the number of audio output devices, at least one audio output channel of at least one audio output device is allocated to each audio input device, and then multiple audio output channels are obtained. The audio data transmitted by the input device, based on the audio output channel allocated to each audio input device, play the audio data transmitted by each audio input device, so as to realize the allocation of different audio output channels to different audio input devices, It is convenient for users to clearly distinguish the sounds input by different audio input devices and improve the user experience. In addition, since the electronic device not only has a built-in audio output device, but also has an external audio output device, and each audio output device includes a plurality of audio output channels, so when the number of audio input devices is large, the audio input device can also be guaranteed. The input audio data is played in different audio output channels, which improves the sound playback effect.
请参阅图4,图4示出了本申请另一个实施例提供的音频播放方法的流程示意图。该音频播放方法应用于上述电子设备,下面将针对图4所示的流程进行详细的阐述,所述音频播放方法具体可以包括以下步骤:Referring to FIG. 4, FIG. 4 shows a schematic flowchart of an audio playback method provided by another embodiment of the present application. The audio playback method is applied to the above-mentioned electronic equipment, and the flow shown in FIG. 4 will be described in detail below, and the audio playback method may specifically include the following steps:
步骤S200:获取多个音频输入设备以及所述音频输出装置的数量,其中,所述多个音频输入设备的数量作为第一数量,所述音频输出装置的数量作为第二数量。Step S200: Acquire the number of multiple audio input devices and the audio output devices, wherein the number of the multiple audio input devices is taken as the first number, and the number of the audio output devices is taken as the second number.
在本申请实施例中,步骤S200可以参阅前述实施例的内容,在此不再赘述。In this embodiment of the present application, for step S200, reference may be made to the content of the foregoing embodiments, and details are not described herein again.
步骤S210:判断所述第二数量是否大于所述第一数量。Step S210: Determine whether the second number is greater than the first number.
在本申请实施例中,电子设备可以按照优先分配整个音频输出装置至音频输入设备的原则,尽量保证将一个音频输出装置的全部音频输出声道分配给音频输入设备。电子设备在获取到音频输入设备的第一数量,以及音频输出装置的第二数量之后,则可以将第二数量与第一数量进行比较,然后根据比较结果,确定第二数量是否小于第一数量。可以理解的,若第二数量大于或等于第一数量,则表示音频输出装置的数量是大于或等于音频输入设备的数量的,因此每个音频输入设备都可以分配到至少一个完整的音频输出装置;若第二数量小于第一数量,则表示音频输出装置的数量是小于音频输入设备的数量的,因此不能够保证每个音频输入设备都可以分配到至少一个完整的音频输出装置。In this embodiment of the present application, the electronic device may try to ensure that all audio output channels of an audio output device are allocated to the audio input device according to the principle of preferentially allocating the entire audio output device to the audio input device. After acquiring the first number of audio input devices and the second number of audio output devices, the electronic device can compare the second number with the first number, and then determine whether the second number is less than the first number according to the comparison result . It can be understood that if the second number is greater than or equal to the first number, it means that the number of audio output devices is greater than or equal to the number of audio input devices, so each audio input device can be assigned to at least one complete audio output device. ; If the second number is less than the first number, it means that the number of audio output devices is less than the number of audio input devices, so it cannot be guaranteed that each audio input device can be assigned to at least one complete audio output device.
步骤S220:若所述第二数量大于或等于所述第一数量,对所述每个音频输入设备分配至少一个音频输出装置的所有音频输出声道。Step S220: If the second number is greater than or equal to the first number, assign all audio output channels of at least one audio output device to each audio input device.
在本申请实施例中,若电子设备判断出第二数量大于或等于第一数量时,此时音频输出装置的数量可以保证每个音频输入设备都被分配得到至少一个完整的音频输出装置,也就是说,对于一个音频输入设备而言,被分配的音频输出装置的所有音频输出声道都用于对该音频输入设备的音频数据的播放。因此,在该情况下,电子设备可以对每个音频输入设备分配至少一个音频输出装置的所有音频输出声道,并且保证每个音频输入设备所分配的音频输出装置不同。In this embodiment of the present application, if the electronic device determines that the second number is greater than or equal to the first number, the number of audio output devices at this time can ensure that each audio input device is assigned at least one complete audio output device, and also That is, for an audio input device, all audio output channels of the assigned audio output device are used for playing the audio data of the audio input device. Therefore, in this case, the electronic device can assign all audio output channels of at least one audio output device to each audio input device, and ensure that the audio output devices assigned to each audio input device are different.
示例性的,请参阅图5,在音频输入设备200的数量为1个,音频输出装置包括第一音频输出装置140a以及第二音频输出装置140b时,此时音频输出装置的数量为2,音频输入设备的数量为1,因此可以对该音频输入设备200分配第一音频输出装置140a以及第二音频输出装置140b,音频输入设备200所输入的音频数据可以同时由第一音频输出装置140a以及第二音频输出装置140b的所有音频输出声道进行播放。5, when the number of audio input devices 200 is 1, and the audio output device includes the first audio output device 140a and the second audio output device 140b, the number of audio output devices is 2, the audio output device 140b. The number of input devices is 1, so the first audio output device 140a and the second audio output device 140b can be allocated to the audio input device 200, and the audio data input by the audio input device 200 can be simultaneously transmitted by the first audio output device 140a and the second audio output device 140b. All audio output channels of the two audio output devices 140b are played.
示例性的,请参阅图6,音频输入设备包括:第一音频输入设备201以及第二音频输入设备202,音频输出装置包括第一音频输出装置140a以及第二音频输出装置140b,此时音频输出装置的数量为2,音频输入设备的数量为2,音频输出装置的数量恰好满足每个音频输入设备被分配一个完整的音频输出装置,因此可以对该第一音频输入设备201分配第一音频输出装置140a,对该第二音频输入设备202分配第二音频输出装置140b,从而第一音频输入设备201输入的音频数据可以由第一音频输出装置140a的所有音频输出声道进行播放,第二音频输入设备202输入的音频数据可以由第二音频输出装置140b的所有输出声道进行播放。6, the audio input device includes: a first audio input device 201 and a second audio input device 202, the audio output device includes a first audio output device 140a and a second audio output device 140b, at this time the audio output The number of devices is 2, the number of audio input devices is 2, and the number of audio output devices just satisfies that each audio input device is assigned a complete audio output device, so the first audio input device 201 can be assigned a first audio output The device 140a assigns the second audio output device 140b to the second audio input device 202, so that the audio data input by the first audio input device 201 can be played by all audio output channels of the first audio output device 140a, and the second audio The audio data input by the input device 202 can be played by all output channels of the second audio output device 140b.
示例性的,请参阅图7,音频输入设备包括:第一音频输入设备201、第二音频输入设备202以及第三音频输入设备203,音频输出装置包括第一音频输出装置140a、第二音频输出装置140b以及第三音频输出装置140c,此时音频输出装置的数量为3,音频输入设备的数量为3,音频输出装置的数量恰好满足每个音频输入设备被分配一个完整的音频输出装置,因此可以对该第一音频输入设备201分配第一音频输出装置140a,对该第二音频输入设备202分配第二音频输出装置140b,对该第三音频输入设备203分配第三音频输出装置140c,从而第一音频输入设备201输入的音频数据可以由第一音频输出装置140a的所有音频输出声道进行播放,第二音频输入设备202输入的音频数据可以由第二音频输出装置140b的所有输出声道进行播放,第三音频输入设备203输入的音频数据可以由第二音频输出装置140c的所有输出声道进行播放。7, the audio input device includes: a first audio input device 201, a second audio input device 202 and a third audio input device 203, the audio output device includes a first audio output device 140a, a second audio output device The device 140b and the third audio output device 140c, at this time, the number of audio output devices is 3, the number of audio input devices is 3, and the number of audio output devices just satisfies that each audio input device is allocated a complete audio output device, so The first audio output device 140a may be assigned to the first audio input device 201, the second audio output device 140b to the second audio input device 202, and the third audio output device 140c to the third audio input device 203, thereby The audio data input by the first audio input device 201 can be played by all the audio output channels of the first audio output device 140a, and the audio data input by the second audio input device 202 can be played by all the output channels of the second audio output device 140b For playback, the audio data input by the third audio input device 203 can be played by all output channels of the second audio output device 140c.
同理,请参阅图8,在音频输入设备的数量为4,音频输出装置的数量为4时,也能够对每个音频输入设备分配一个音频输出装置,使得每个音频输入设备输入的音频数据由一个音频输出装置的所有音频输出声道进行播放。Similarly, referring to FIG. 8 , when the number of audio input devices is 4 and the number of audio output devices is 4, it is also possible to assign an audio output device to each audio input device, so that the audio data input by each audio input device is Played by all audio output channels of an audio output device.
步骤S230:若所述第二数量小于所述第一数量,获取所有所述音频输出装置的音频输出声道的数量作为第三数量。Step S230: If the second number is less than the first number, acquire the number of audio output channels of all the audio output devices as a third number.
在本申请实施例中,若电子设备判断出第二数量小于第一数量时,此时音频输出装置的数量不足以每个音频输入设备都被分配得到至少一个完整的音频输出装置。因此,在该情况下,电子设备可以确定能否对部分音频输入设备分配至少一个完整的音频输出装置的所有音频输出声道,再进行音频输出声道的分配。In this embodiment of the present application, if the electronic device determines that the second number is smaller than the first number, the number of audio output devices is not sufficient for each audio input device to be assigned at least one complete audio output device. Therefore, in this case, the electronic device can determine whether all audio output channels of at least one complete audio output device can be allocated to some audio input devices, and then perform the allocation of audio output channels.
在一些实施方式中,每个音频输出装置的音频输出声道的数量相同,例如,都为2个,都为4个等。电子设备可以在判断出第二数量小于第一数量时,确定所有音频输出装置的音频输出声道的数量作为第三数量。作为一种方式,电子设备可以获取各个音频输出装置的装置信息,然后从装置信息中确定音频输出声道的数量。In some implementations, the number of audio output channels of each audio output device is the same, eg, both are 2, both are 4, and so on. The electronic device may determine the number of audio output channels of all audio output devices as the third number when judging that the second number is smaller than the first number. As a way, the electronic device may acquire device information of each audio output device, and then determine the number of audio output channels from the device information.
步骤S240:获取所述第三数量与所述第一数量的比值。Step S240: Obtain the ratio of the third quantity to the first quantity.
步骤S250:若所述比值大于设定阈值,对所述多个音频输入设备中的部分音频输入设备分配至少一个音频输出装置的所有音频输出声道。Step S250: If the ratio is greater than the set threshold, assign all audio output channels of at least one audio output device to some of the plurality of audio input devices.
在本申请实施例中,电子设备在获取到所有音频输出装置的音频输出声道的数量之后,可以获取所有音频输出声道的第三数量与所有音频输入设备的第一数量之间的比值,以根据该比值来确定是否可以对部分音频输入设备分配至少一个完整的音频输出装置的所有音频输出声道。其中,电子设备可以在获取到比值之后,将该比值与设定阈值进行比较,该设定阈值根据单个音频输出装置的音频输出声道的数量而定。在以上比值大于设定阈值时,则表示音频输出声道较多,可以对至少部分音频输入设备分配至少一个完整的音频输出装置的所有音频输出声道;在以上比值不大于设定阈值时,则表示音频输出声道较少,如果对至少部分音频输入设备分配至少一个完整的音频输出装置的所有音频输出声道,那么其他的音频输入设备无法分配到至少一个音频输出声道,或者音频输出声道分配不均匀,导致用户听到的各个音频输入设备输入的音频的声音响度不均,而体验不佳。In this embodiment of the present application, after acquiring the number of audio output channels of all audio output devices, the electronic device may acquire the ratio between the third number of all audio output channels and the first number of all audio input devices, To determine whether all audio output channels of at least one complete audio output device can be allocated to a part of the audio input device according to the ratio. Wherein, after acquiring the ratio, the electronic device may compare the ratio with a set threshold, where the set threshold is determined according to the number of audio output channels of a single audio output device. When the above ratio is greater than the set threshold, it means that there are many audio output channels, and at least some audio input devices can be allocated all audio output channels of at least one complete audio output device; when the above ratio is not greater than the set threshold, It means that there are fewer audio output channels. If all audio output channels of at least one complete audio output device are allocated to at least some audio input devices, other audio input devices cannot be allocated to at least one audio output channel, or the audio output The channel distribution is uneven, resulting in uneven sound loudness of the audio input by each audio input device heard by the user, resulting in a poor experience.
在一些实施方式中,在以上比值大于设定阈值时,电子设备对至少部分音频输入设备分配至少一个完整的音频输出装置的所有音频输出声道时,可以确定待分配完整的音频输出装置的音频输入设备的数量,然后将该数量的音频输入设备分配至少一个音频输出装置的所有音频输出声道,并且保证这些音频输入设备所分配的音频输出装置不同。In some embodiments, when the above ratio is greater than a set threshold, when the electronic device allocates all audio output channels of at least one complete audio output device to at least some of the audio input devices, it may determine that the audio frequency of the complete audio output device is to be allocated. The number of input devices is then allocated to all audio output channels of at least one audio output device for the number of audio input devices, and it is ensured that the audio output devices allocated to these audio input devices are different.
可选的,该数量的音频输入设备中每个音频输入设备可以分配一个音频输出装置的所有音频输出声道,以避免无法被分配完整的一个音频输出装置的其他音频输入设备所分配的音频输出声道较少,而使得用户听到的各个音频输入设备输入的音频的声音响度不均而体验不佳。Optionally, each audio input device in the number of audio input devices can be assigned all audio output channels of an audio output device, so as to avoid the audio output that cannot be assigned by other audio input devices of a complete audio output device. There are fewer channels, so that the audio input from each audio input device heard by the user has uneven loudness, resulting in a poor experience.
在一些实施方式中,电子设备对所述多个音频输入设备中的部分音频输入设备分配至少一个音频输出装置的所有音频输出声道,可以包括:In some embodiments, the electronic device assigns all audio output channels of at least one audio output device to some of the plurality of audio input devices, which may include:
确定所述多个音频输入设备中分配一个音频输出装置的所有音频输出声道的音频输入设备的数量,作为第四数量;获取所述多个音频输入设备中每个音频输入设备的优先级;基于所述每个音频输入设备的优先级,从所述多个音频输入设备中确定所述第四数量的音频输入设备作为所述部分音频输入设备,其中,所述部分音频输入设备的优先级高于所述其他音频输入设备的优先级;对所述部分音频输入设备分配一个音频输出装置的所有音频输出声道。Determine the number of audio input devices that allocate all audio output channels of an audio output device in the plurality of audio input devices, as the fourth number; obtain the priority of each audio input device in the plurality of audio input devices; The fourth number of audio input devices is determined from the plurality of audio input devices as the partial audio input devices based on the priority of each audio input device, wherein the priority of the partial audio input devices The priority is higher than that of the other audio input devices; all audio output channels of an audio output device are allocated to the part of the audio input devices.
在该实施方式中,电子设备对部分音频输入设备中每个音频输入设备分配一个音频输出装置的所有音频输出声道。电子设备在确定出可分配完整的音频输出装置的音频输入设备的数量后,根据音频输入设备的优先级,确定出优先级相对较高的该数量的音频输入设备作为可分配一个音频输出装置的音频输入设备,然后再对这些音频输入设备分配一个音频输出升职的所有音频输出声道。从而,可以使得优先级相对较高的音频输入设备能够被分配一个完整的音频输出装置,而在音频播放时,能够有别于其他音频输入设备所输入的音频,能更贴合用户的需求,提升用户体验。In this embodiment, the electronic device allocates all audio output channels of an audio output device to each audio input device of the partial audio input devices. After the electronic device determines the number of audio input devices that can be assigned a complete audio output device, according to the priority of the audio input device, the number of audio input devices with relatively high priority is determined as the number of audio input devices that can be assigned an audio output device. audio input devices, and then assign an audio output to those audio input devices to promote all audio output channels. Therefore, an audio input device with a relatively high priority can be assigned a complete audio output device, and when the audio is played, it can be different from the audio input by other audio input devices, which can better meet the needs of users. Improve user experience.
作为一种实施方式,音频输入设备的优先级可以根据用户的需求而设置。示例性的,电子设备可以展示用于设置各个音频输入设备的优先级的界面,以供用户设置各个音频输入设备的优先级。As an implementation manner, the priority of the audio input device can be set according to the needs of the user. Exemplarily, the electronic device may display an interface for setting the priority of each audio input device for the user to set the priority of each audio input device.
作为另一种实施方式,音频输入设备的优先级可以根据音频输入设备的类型确定,即电子设备可以获取每个音频输入设备的类型,然后,根据每个音频输入设备的类型,确定每个音频输入设备的优先级。示例性的,音频输入设备可以分为:台式电脑、笔记本电脑、平板电脑、智能手机和智能手表等,音频输入设备的优先级按照台式电脑、笔记本电脑、平板电脑、智能手机和智能手表的顺序依次降低,当然,以上仅为举例,并不代表对实际的优先级的限定。As another implementation manner, the priority of the audio input device may be determined according to the type of the audio input device, that is, the electronic device may obtain the type of each audio input device, and then, according to the type of each audio input device, determine each audio input device Enter the priority of the device. Exemplarily, the audio input devices can be divided into: desktop computers, laptop computers, tablet computers, smart phones and smart watches, etc. The priority of audio input devices is in the order of desktop computers, laptop computers, tablet computers, smart phones and smart watches Decrease in sequence, of course, the above is only an example, and does not represent a limitation on the actual priority.
在一些方式中,电子设备确定多个音频输入设备中分配一个音频输出装置的所有音频输出声道的音频输入设备的数量,可以根据以上比值确定。示例性的,可以将该比值的整数部分作为该数量,从而可以使得较多的音频输入设备被分配一个音频输出装置的所有音频输出声道;又例如,可以将该比值的整数部分减去1之后获得的值作为该数量,从而可以使得一些音频输入设备被分配一个音频输出装置的所有音频输出声道的同时,也避免声音音量不均的情况发生。In some manners, the electronic device determines the number of audio input devices to which all audio output channels of one audio output device are allocated among the plurality of audio input devices, which may be determined according to the above ratio. Exemplarily, the integer part of the ratio can be used as the quantity, so that more audio input devices can be allocated to all audio output channels of an audio output device; for another example, the integer part of the ratio can be subtracted by 1 The value obtained later is used as the number, so that some audio input devices can be assigned to all audio output channels of an audio output device, and at the same time, the occurrence of uneven sound volume can also be avoided.
在一些方式中,以上设定阈值根据单个音频输出装置的音频输出声道的数量而定,由于每个音频输出装置的音频输出声道的数量相同,因此可以以任意一个音频输出装置的音频输出声道的数量,来确定设定阈值。示例性的,单个音频输出装置的音频输出声道的数量为4,则设定阈值可以为2。当然,设定阈值的具体确定方式可以不做限定。In some manners, the above set threshold is determined according to the number of audio output channels of a single audio output device. Since the number of audio output channels of each audio output device is the same, the audio output of any audio output device can be The number of channels to determine the set threshold. Exemplarily, if the number of audio output channels of a single audio output device is 4, the set threshold may be 2. Of course, the specific manner of determining the threshold value may not be limited.
示例性的,请参阅图9,音频输入设备包括:第一音频输入设备201、第二音频输入设备202以及第三音频输入设备203,音频输出装置包括第一音频输出装置140a以及第二音频输出装置140b,第一音频输出装置140a以及第二音频输出装置140b的音频输出声道的数量均为4。此时所有音频输出装置的数量为8,音频输入设备的数量为3,所有音频输出装置的数量与音频输入设备 的数量的比值大于2,因此可以对该第一音频输入设备201分配第一音频输出装置140a,对该第二音频输入设备202分配第二音频输出装置140b的音频输出声道b1和b2,对第三音频输入设备203分配第二音频输出装置的音频输出声道b3和b4。9, the audio input device includes: a first audio input device 201, a second audio input device 202 and a third audio input device 203, and the audio output device includes a first audio output device 140a and a second audio output device 140a The number of audio output channels of the device 140b, the first audio output device 140a and the second audio output device 140b are all four. At this time, the number of all audio output devices is 8, the number of audio input devices is 3, and the ratio of the number of all audio output devices to the number of audio input devices is greater than 2, so the first audio input device 201 can be assigned a first audio The output device 140a assigns the audio output channels b1 and b2 of the second audio output device 140b to the second audio input device 202, and assigns the audio output channels b3 and b4 of the second audio output device to the third audio input device 203.
示例性的,请参阅图10,音频输入设备包括:第一音频输入设备201、第二音频输入设备202、第三音频输入设备203以及第四音频输入设备204,音频输出装置包括第一音频输出装置140a、第二音频输出装置140b以及第三音频输出装置140c,第一音频输出装置140a、第二音频输出装置140b以及第三音频输出装置140c的音频输出声道的数量均为4。此时所有音频输出装置的数量为12,音频输入设备的数量为4,所有音频输出装置的数量与音频输入设备的数量的比值大于2,因此可以对该第一音频输入设备201分配第一音频输出装置140a,对该第二音频输入设备202分配第二音频输出装置140b,对该第三音频输入设备203分配第三音频输出装置140c的音频输出声道c1和c2,对第四音频输入设备204分配第三音频输出装置140c的音频输出声道c3和c4。10, the audio input device includes: a first audio input device 201, a second audio input device 202, a third audio input device 203 and a fourth audio input device 204, and the audio output device includes a first audio output device The number of audio output channels of the device 140a, the second audio output device 140b and the third audio output device 140c, the first audio output device 140a, the second audio output device 140b and the third audio output device 140c are all four. At this time, the number of all audio output devices is 12, the number of audio input devices is 4, and the ratio of the number of all audio output devices to the number of audio input devices is greater than 2, so the first audio input device 201 can be assigned a first audio The output device 140a assigns the second audio output device 140b to the second audio input device 202, assigns the audio output channels c1 and c2 of the third audio output device 140c to the third audio input device 203, and assigns the audio output channels c1 and c2 of the third audio output device 140c to the fourth audio input device 203. 204 allocates audio output channels c3 and c4 of the third audio output device 140c.
步骤S260:对其他音频输入设备中每个音频输入设备分配剩余的音频输出装置的至少一个音频输出声道。Step S260: Allocate at least one audio output channel of the remaining audio output device to each audio input device in the other audio input devices.
在本申请实施例中,在对以上部分音频输入设备分配一个音频输出装置的所有音频输出声道之后,电子设备可以对其他音频输入设备中每个音频输入设备分配剩余的音频输出装置的至少一个音频输出声道,其他音频输入设备为多个音频输入设备中除部分音频输入设备以外的音频输入设备,并且保证其他音频输入设备中不同音频输入设备所分配的音频输出声道不同。In this embodiment of the present application, after all the audio output channels of one audio output device are allocated to the above part of the audio input devices, the electronic device may allocate at least one of the remaining audio output devices to each of the other audio input devices Audio output channels, other audio input devices are audio input devices other than some audio input devices among the multiple audio input devices, and ensure that the audio output channels assigned to different audio input devices in the other audio input devices are different.
步骤S270:若所述比值小于或等于设定阈值,对所述多个音频输入设备中每个音频输入设备分配至少一个音频输出声道。Step S270: If the ratio is less than or equal to the set threshold, assign at least one audio output channel to each of the plurality of audio input devices.
在本申请实施例中,若电子设备确定出以上比值小于或等于设定阈值时,则表示没有一个音频输入设备可被分配一个音频输出装置的所有音频输出声道,因此可以按照保证每个音频输入设备被分配至少一个音频输出声道的原则,对每个音频输入设备分配至少一个音频输出声道。In the embodiment of the present application, if the electronic device determines that the above ratio is less than or equal to the set threshold, it means that no audio input device can be assigned to all audio output channels of an audio output device, so each audio output channel can be allocated according to the guarantee According to the principle that the input device is assigned at least one audio output channel, at least one audio output channel is assigned to each audio input device.
示例性的,请参阅图11,音频输入设备包括:第一音频输入设备201、第二音频输入设备202、第三音频输入设备203以及第四音频输入设备204,音频输出装置包括第一音频输出装置140a以及第二音频输出装置140b,第一音频输出装置140a以及第二音频输出装置140b的音频输出声道的数量均为4。此时所有音频输出装置的数量为8,音频输入设备的数量为4,所有音频输出装置的数量与音频输入设备的数量的比值等于2,因此可以对该第一音频输入设备201分配第一音频输出装置140a的音频输出声道a1和a2,对该第二音频输入设备202第一音频输出装置140a的音频输出声道a3和a4,对该第三音频输入设备203分配第二音频输出装置140b的音频输出声道b1和b2,对第四音频输入设备204分配第二音频输出装置140b的音频输出声道b3和b4。11, the audio input device includes: a first audio input device 201, a second audio input device 202, a third audio input device 203 and a fourth audio input device 204, and the audio output device includes a first audio output device The number of audio output channels of the device 140a and the second audio output device 140b, the first audio output device 140a and the second audio output device 140b are all four. At this time, the number of all audio output devices is 8, the number of audio input devices is 4, and the ratio of the number of all audio output devices to the number of audio input devices is equal to 2, so the first audio input device 201 can be assigned a first audio The audio output channels a1 and a2 of the output device 140a, the audio output channels a3 and a4 of the first audio output device 140a to the second audio input device 202, the second audio output device 140b is assigned to the third audio input device 203 The audio output channels b1 and b2 of the fourth audio input device 204 are allocated to the audio output channels b3 and b4 of the second audio output device 140b.
在一些实施方式中,由于上述在第二数量小于第一数量时,基于每个音频输出装置的音频输出声道的数量相同的情况进行,因此,可以在执行步骤S230中获取所有音频输出装置的音频输出声道的数量之前,电子设备还可以确定是否各个音频输出装置的音频输出声道的数量相同,在相同时,才执行获取所有音频输出装置的音频输出声道的数量;在不相同时,则可以按照尽量给一些音频输入设备分配一个音频输出装置的所有音频输出声道的原则,对音频输入设备分配音频输出声道。In some embodiments, since the above-mentioned process is performed based on the condition that the number of audio output channels of each audio output device is the same when the second number is less than the first number, the data of all audio output devices may be obtained in step S230. Before the number of audio output channels, the electronic device can also determine whether the number of audio output channels of each audio output device is the same, and when the number of audio output channels is the same, the number of audio output channels of all audio output devices can be obtained; , the audio output channels can be allocated to the audio input devices according to the principle of allocating all the audio output channels of an audio output device to some audio input devices as much as possible.
步骤S280:获取所述多个音频输入设备传输的音频数据。Step S280: Acquire audio data transmitted by the plurality of audio input devices.
步骤S290:基于对所述每个音频输入设备分配的音频输出声道,对所述每个音频输入设备传输的音频数据进行播放。Step S290: Play audio data transmitted by each audio input device based on the audio output channel allocated to each audio input device.
在本申请实施例中,步骤S280及步骤S290可以参阅前述实施例的内容,在此不再赘述。In this embodiment of the present application, for step S280 and step S290, reference may be made to the content of the foregoing embodiments, and details are not described herein again.
在一些方式中,电子设备可能会存在没有外接音频输出装置的情况,此时可能电子设备仅有一个音频输出装置,该情况下,则可以按照保证对每个音频输入设备分配至少一个音频输出声道的原则,对音频输入设备分配至少一个音频输出声道。示例性的,请参阅图12,音频输入设备包括:第一音频输入设备201和第二音频输入设备202,音频输出装置包括第一音频输出装置140a,此时可以对该第一音频输入设备201分配第一音频输出装置140a的音频输出声道a1和a2,对该第二音频输入设备202第一音频输出装置140a的音频输出声道a3和a4。In some manners, the electronic device may have no external audio output device. In this case, the electronic device may have only one audio output device. In this case, at least one audio output device can be assigned to each audio input device according to the guarantee. According to the principle of channel, assign at least one audio output channel to the audio input device. 12, the audio input device includes: a first audio input device 201 and a second audio input device 202, and the audio output device includes a first audio output device 140a. At this time, the first audio input device 201 can be used. The audio output channels a1 and a2 of the first audio output device 140a are allocated to the audio output channels a3 and a4 of the first audio output device 140a for the second audio input device 202 .
本申请实施例提供的音频播放方法,在多个音频输入设备输入音频输入至电子设备进行播放时,按照优先给音频输入设备分配至少一个音频输出装置的所有音频输出声道的原则,基于音频输入设备的数量与音频输出装置的数量之间的关系,对音频输入设备分配不同的音频输出声道,保证了不同的音频输入设备的音频数据通过不同的音频输出声道进行播放,并且能够优先使得音频输入设备的音频数据能够在至少一个音频输出装置的所有音频输出声道进行输出,提升了音频播放效果。In the audio playback method provided by the embodiment of the present application, when multiple audio input devices input audio input to the electronic device for playback, according to the principle of preferentially assigning all audio output channels of at least one audio output device to the audio input device, based on the audio input device The relationship between the number of devices and the number of audio output devices, assigning different audio output channels to audio input devices ensures that the audio data of different audio input devices is played through different audio output channels, and can give priority to The audio data of the audio input device can be output in all audio output channels of at least one audio output device, which improves the audio playback effect.
请参阅图13,图13示出了本申请又一个实施例提供的音频播放方法的流程示意图。该音频播放方法应用于上述电子设备,下面将针对图13所示的流程进行详细的阐述,所述音频播放方法具体可以包括以下步骤:Please refer to FIG. 13. FIG. 13 shows a schematic flowchart of an audio playback method provided by yet another embodiment of the present application. The audio playback method is applied to the above-mentioned electronic equipment, and the flow shown in FIG. 13 will be described in detail below. The audio playback method may specifically include the following steps:
步骤S310:获取多个音频输入设备以及所述音频输出装置的数量,其中,所述多个音频输入设备的数量作为第一数量,所述音频输出装置的数量作为第二数量。Step S310: Acquire the number of multiple audio input devices and the audio output devices, wherein the number of the multiple audio input devices is used as the first number, and the number of the audio output devices is used as the second number.
在本申请实施例中,步骤S310可以参阅前述实施例的内容,在此不再赘述。In this embodiment of the present application, for step S310, reference may be made to the content of the foregoing embodiments, and details are not described herein again.
步骤S320:获取所述每个音频输入设备与所述电子设备的相对位置关系。Step S320: Obtain the relative positional relationship between each audio input device and the electronic device.
在本申请实施例中,相对位置关系可以用于表征音频输入设备和电子设备的相对距离和相对角度。In this embodiment of the present application, the relative positional relationship may be used to represent the relative distance and relative angle between the audio input device and the electronic device.
在该实施方式中,音频输入设备可以位于电子设备的正前方、可以位于电子设备的左前方、可以位于电子设备的右前方、可以位于电子设备的上前方、也可以位于电子设备的下前方等,第二源设备可以位于电子设备的正前方、可以位于电子设备的左前方、可以位于电子设备的右前方、可以位于电子设备的上前方、也可以位于电子设备的下前方等,在此不做限定。In this embodiment, the audio input device may be located directly in front of the electronic device, may be located in the front left of the electronic device, may be located in the front right of the electronic device, may be located in the upper front of the electronic device, or may be located in the lower front of the electronic device, etc. , the second source device can be located directly in front of the electronic device, can be located in the front left of the electronic device, can be located in the front right of the electronic device, can be located in the upper front of the electronic device, or can be located in the lower front of the electronic device, etc. Do limit.
作为第一种方式,电子设备可以包括超宽带传感器(ultra wide band,UWB),每个音频输入设备也可以包括超宽带传感器,则电子设备可以通过电子设备以及每个音频输入设备的超宽带传感器,获取每个音频输入设备与电子设备的相对位置关系。As a first approach, the electronic device may include an ultra-wide band (UWB) sensor, and each audio input device may also include an ultra-wideband sensor, and the electronic device may pass the electronic device and the UWB sensor of each audio input device. , to obtain the relative positional relationship between each audio input device and the electronic device.
作为第二种方式,电子设备可以包括图像采集装置,则可以通过图像采集装置获取音频输入设备与电子设备的相对位置关系。As a second manner, the electronic device may include an image capture device, and the relative positional relationship between the audio input device and the electronic device may be acquired through the image capture device.
步骤S330:基于所述第一数量、所述第二数量以及所述每个音频输入设备与所述电子设备的相对位置关系,对所述每个音频输入设备分配至少一个音频输出装置的至少一个音频输出声道,其中,所述每个音频输入设备所分配的音频输出声道与所述相对位置关系对应。Step S330: Based on the first quantity, the second quantity, and the relative positional relationship between each audio input device and the electronic device, assign at least one of at least one audio output device to each audio input device. An audio output channel, wherein the audio output channel allocated by each audio input device corresponds to the relative positional relationship.
在本申请实施例中,电子设备在对每个音频输入设备分配音频输出声道时,除了参考音频输出装置的数量以及音频输入设备的数量以外,还可以参考音频输入设备与电子设备之间的相对位置关系。同样的,电子设备可以按照优先分配整个音频输出装置至音频输入设备的原则,尽量保证将一个音频输出装置的全部音频输出声道分配给音频输入设备;在音频输出装置的数量不能保证能够将一个音频输出装置的全部音频输出声道分配给音频输入设备时,再将音频输出装置的不同声道分配至不同的音频输入设备,并且保证每个音频输入设备所分配的音频输出声道不同,如此,可以使得至少部分音频输入设备的音频数据能够被完整的音频输出装置进行播放(即音频输出装置的全部声道都用于播放一个音频输入设备的音频数据),并且可以方便用户区分不同音频输入设备的音频数据对应的播放声音。除此以外,电子设备还可以在分配音频输出声道时,根据以上相对位置关系,使分配给音频输入设备的音频输出声道能够靠近音频输入设备,例如,音频输入设备1位于电子设备的左侧,则可以分配左侧的音频输出声道至该音频输入设备1;音频输入设备2位于电子设备的右侧,则可以分配右侧的音频输出声道至该音频输入设备2。In this embodiment of the present application, when the electronic device allocates an audio output channel to each audio input device, in addition to referring to the number of audio output devices and the number of audio input devices, it may also refer to the relationship between the audio input device and the electronic device. relative positional relationship. Similarly, the electronic device may, in accordance with the principle of prioritizing the allocation of the entire audio output device to the audio input device, try to ensure that all audio output channels of an audio output device are allocated to the audio input device; the number of audio output devices cannot guarantee that one When all the audio output channels of the audio output device are assigned to the audio input device, then assign different channels of the audio output device to different audio input devices, and ensure that the audio output channels assigned to each audio input device are different, like this , the audio data of at least part of the audio input device can be played by the complete audio output device (that is, all channels of the audio output device are used to play the audio data of one audio input device), and it is convenient for users to distinguish different audio input devices. The playback sound corresponding to the audio data of the device. In addition, when assigning audio output channels, the electronic device can also make the audio output channel assigned to the audio input device close to the audio input device according to the above relative positional relationship. For example, the audio input device 1 is located on the left side of the electronic device. side, the audio output channel on the left can be assigned to the audio input device 1; if the audio input device 2 is located on the right side of the electronic device, the audio output channel on the right can be assigned to the audio input device 2.
在一些实施方式中,电子设备可以根据第一数量以及第二数量,对每个音频输入设备分配对应数量的音频输出声道后,再根据音频输入设备与电子设备之间的相对位置关系,以及音频输出声道的位置,分配对应数量的音频输出声道给每个音频输入设备。In some embodiments, the electronic device may allocate a corresponding number of audio output channels to each audio input device according to the first number and the second number, and then according to the relative positional relationship between the audio input device and the electronic device, and The position of the audio output channels, assign the corresponding number of audio output channels to each audio input device.
步骤S340:获取所述多个音频输入设备传输的音频数据。Step S340: Acquire audio data transmitted by the multiple audio input devices.
步骤S350:基于对所述每个音频输入设备分配的音频输出声道,对所述每个音频输入设备传输的音频数据进行播放。Step S350: Play audio data transmitted by each audio input device based on the audio output channel allocated to each audio input device.
在本申请实施例中,步骤S340以及步骤S350可以参阅前述实施例的内容,在此不再赘述。In this embodiment of the present application, for steps S340 and S350, reference may be made to the contents of the foregoing embodiments, and details are not described herein again.
本申请实施例提供的音频播放方法,在多个音频输入设备输入音频输入至电子设备进行播放时,按照优先给音频输入设备分配至少一个音频输出装置的所有音频输出声道的原则,基于音频输入设备的数量、音频输出装置的数量以及音频输入设备与电子设备之间的相对位置关系,对音频输入设备分配不同的音频输出声道,保证了不同的音频输入设备的音频数据通过不同的音频输出声道进行播放,并且能够保证音频输出声道与以上相对位置关系对应,进一步的方便了用户分辨不同音频输入设备的音频数据的播放声音,提升了音频播放效果。In the audio playback method provided by the embodiment of the present application, when multiple audio input devices input audio input to the electronic device for playback, according to the principle of preferentially assigning all audio output channels of at least one audio output device to the audio input device, based on the audio input device The number of devices, the number of audio output devices, and the relative positional relationship between the audio input device and the electronic device. Assign different audio output channels to the audio input device to ensure that the audio data of different audio input devices pass through different audio outputs. The audio output channel can be guaranteed to correspond to the above relative positional relationship, which further facilitates the user to distinguish the playback sound of the audio data of different audio input devices, and improves the audio playback effect.
请参阅图14,图14示出了本申请再一个实施例提供的音频播放方法的流程示意图。该音频播放方法应用于上述电子设备,下面将针对图14所示的流程进行详细的阐述,所述音频播放方法具体可以包括以下步骤:Please refer to FIG. 14. FIG. 14 shows a schematic flowchart of an audio playback method provided by still another embodiment of the present application. The audio playback method is applied to the above-mentioned electronic equipment, and the flow shown in FIG. 14 will be described in detail below. The audio playback method may specifically include the following steps:
步骤S410:获取多个音频输入设备以及所述音频输出装置的数量,其中,所述多个音频输入设备的数量作为第一数量,所述音频输出装置的数量作为第二数量。Step S410: Acquire the number of multiple audio input devices and the audio output devices, wherein the number of the multiple audio input devices is used as the first number, and the number of the audio output devices is used as the second number.
在本申请实施例中,步骤S410可以参阅前述实施例的内容,在此不再赘述。In this embodiment of the present application, for step S410, reference may be made to the content of the foregoing embodiments, and details are not described herein again.
步骤S420:获取所述每个音频输入设备相对所述电子设备的距离。Step S420: Obtain the distance of each audio input device relative to the electronic device.
在本申请实施例中,电子设备还可以获取每个音频输入设备相对电子设备的距离。作为一种方式,电子设备可以通过距离传感器获取每个音频输入设备相对电子设备的距离;作为另一种方式,电子设备可以设置多个深度摄像头,可以通过深度摄像头采集的深度图像,确定每个音频输入设备相对电子设备的距离。In this embodiment of the present application, the electronic device may also acquire the distance of each audio input device relative to the electronic device. As one way, the electronic device can obtain the distance of each audio input device relative to the electronic device through the distance sensor; as another way, the electronic device can be provided with multiple depth cameras, and the depth images collected by the depth cameras can be used to determine each The distance of the audio input device relative to the electronic device.
步骤S430:基于所述第一数量、所述第二数量以及所述每个音频输入设备相对所述电子设备的距离,对所述每个音频输入设备分配至少一个音频输出装置的至少一个音频输出声道,其中,所述每个音频输入设备所分配的音频输出声道的数量与所述距离呈正相关。Step S430: Allocate at least one audio output of at least one audio output device to each audio input device based on the first number, the second number, and the distance of each audio input device relative to the electronic device channel, wherein the number of audio output channels allocated by each audio input device is positively related to the distance.
在本申请实施例中,电子设备在对每个音频输入设备分配音频输出声道时,除了参考音频输出装置的数量以及音频输入设备的数量以外,还可以参考音频输入设备与电子设备之间的距离。同样的,电子设备可以按照优先分配整个音频输出装置至音频输入设备的原则,尽量保证将一个音频输出装置的全部音频输出声道分配给音频输入设备,且参考音频输入设备与电子设备之间的距离,最终使得每个音频输入设备所分配的音频输出声道不同,且每个音频输入设备所分配的音频输出声道的数量与以上距离呈正相关。也就是说,距离越大,则分配的音频输出声道的数量也越大,由于分配的音频输出声道的数量不同,因此发声的音量也有差别,从而使用户感官上能够易于区分不同音频输入设备的音频声音。In this embodiment of the present application, when the electronic device allocates an audio output channel to each audio input device, in addition to referring to the number of audio output devices and the number of audio input devices, it may also refer to the relationship between the audio input device and the electronic device. distance. Similarly, the electronic device may, in accordance with the principle of assigning the entire audio output device to the audio input device preferentially, try to ensure that all audio output channels of an audio output device are allocated to the audio input device, and refer to the relationship between the audio input device and the electronic device. The distance finally makes the audio output channels allocated by each audio input device different, and the number of audio output channels allocated by each audio input device is positively related to the above distance. That is to say, the greater the distance, the greater the number of allocated audio output channels. Since the number of allocated audio output channels is different, the sound volume is also different, so that the user can easily distinguish different audio inputs. The audio sound of the device.
在一些实施方式中,电子设备可以优先根据以上距离,确定出各个音频输入设备所分配的音频输出声道的数量,且每个音频输入设备所分配的音频输出声道的数量与以上距离呈正相关。然后基于每个音频输入设备所分配的音频输出声道的数量,并根据第一数量以及第二数量,将所有音频输出装置的音频输出声道分配给音频输入设备,也就是说,在此基础上,在保证各个音频输入设备所分配的音频输出声道的数量不变的情况下,根据第一数量以及第二数量,将所有音频输出装置的音频输出声道分配给音频输入设备,以保证尽量多的音频输入设备被分配到完整的音频输出装置,即至少一个音频删除装置的所有音频输出声道。In some embodiments, the electronic device may determine the number of audio output channels allocated by each audio input device according to the above distance, and the number of audio output channels allocated by each audio input device is positively correlated with the above distance . Then, based on the number of audio output channels allocated to each audio input device, and according to the first number and the second number, the audio output channels of all audio output devices are allocated to the audio input devices, that is, on this basis On the condition that the number of audio output channels allocated by each audio input device is kept unchanged, according to the first number and the second number, the audio output channels of all audio output devices are allocated to the audio input device to ensure As many audio input devices as possible are assigned to complete audio output devices, ie all audio output channels of at least one audio deletion device.
步骤S440:获取所述多个音频输入设备传输的音频数据。Step S440: Acquire audio data transmitted by the multiple audio input devices.
步骤S450:基于对所述每个音频输入设备分配的音频输出声道,对所述每个音频输入设备传输的音频数据进行播放。Step S450: Play audio data transmitted by each audio input device based on the audio output channel allocated to each audio input device.
在本申请实施例中,步骤S440以及步骤S450可以参阅前述实施例的内容,在此不再赘述。In this embodiment of the present application, for steps S440 and S450, reference may be made to the contents of the foregoing embodiments, and details are not described herein again.
本申请实施例提供的音频播放方法,在多个音频输入设备输入音频输入至电子设备进行播放时,按照优先给音频输入设备分配至少一个音频输出装置的所有音频输出声道的原则,基于音频输入设备的数量、音频输出装置的数量以及音频输入设备与电子设备之间的距离,对音频输入设备分配不同的音频输出声道,保证了不同的音频输入设备的音频数据通过不同的音频输出声道进行播放,并且能够保证音频输出声道的数量与以上距离对应,进一步的方便了用户分辨不同音频输入设备的音频数据的播放声音,提升了音频播放效果。In the audio playback method provided by the embodiment of the present application, when multiple audio input devices input audio input to an electronic device for playback, according to the principle of preferentially assigning all audio output channels of at least one audio output device to the audio input device, based on the audio input device The number of devices, the number of audio output devices, and the distance between the audio input device and the electronic device, assign different audio output channels to the audio input device, ensuring that the audio data of different audio input devices pass through different audio output channels Play, and can ensure that the number of audio output channels corresponds to the above distance, which further facilitates the user to distinguish the playback sound of audio data of different audio input devices, and improves the audio playback effect.
请参阅图15,图15示出了本申请又另一个实施例提供的音频播放方法的流程示意图。该音频播放方法应用于上述电子设备,下面将针对图15所示的流程进行详细的阐述,所述音频播放方法具体可以包括以下步骤:Please refer to FIG. 15. FIG. 15 shows a schematic flowchart of an audio playback method provided by yet another embodiment of the present application. The audio playback method is applied to the above-mentioned electronic equipment, and the flow shown in FIG. 15 will be described in detail below. The audio playback method may specifically include the following steps:
步骤S510:获取多个音频输入设备以及所述音频输出装置的数量,其中,所述多个音频输入设备的数量作为第一数量,所述音频输出装置的数量作为第二数量。Step S510: Acquire the number of multiple audio input devices and the audio output devices, wherein the number of the multiple audio input devices is taken as the first number, and the number of the audio output devices is taken as the second number.
在本申请实施例中,步骤S510可以参阅前述实施例的内容,在此不再赘述。In this embodiment of the present application, for step S510, reference may be made to the content of the foregoing embodiments, and details are not described herein again.
步骤S520:对所述每个音频输入设备对应的待显示资源进行显示布局。Step S520: Perform a display layout on the resources to be displayed corresponding to each audio input device.
在本申请实施例中,音频输入设备可以为投屏场景中的输入设备,音频输入设备可以既输入显示内容至电子设备进行显示,也同时输入音频数据至电子设备进行播放。在投屏场景中,电子设备可以对每个音频输入设备对应的待显示资源进行显示布局,以便在显示待显示资源时,按照该显示布局显示多个输入设备输入的待显示资源。其中,显示布局可以至少包括:每路视频在预设窗口中的位置以及每路视频在预设窗口中的区域大小等,在此不做限定。待显示资源可以包括视频、音乐、文档、游戏等,在此不做限定。In this embodiment of the present application, the audio input device may be an input device in a screen projection scenario, and the audio input device may not only input display content to the electronic device for display, but also input audio data to the electronic device for playback. In a screen-casting scenario, the electronic device may display a layout for the resources to be displayed corresponding to each audio input device, so that when displaying the resources to be displayed, the resources to be displayed inputted by multiple input devices are displayed according to the display layout. Wherein, the display layout may include at least: the position of each channel of video in the preset window and the area size of each channel of video in the preset window, etc., which are not limited herein. The resources to be displayed may include videos, music, documents, games, etc., which are not limited herein.
在一些实施方式中,电子设备对每个音频输入设备对应的待显示资源进行显示布局,可以包括:获取多个音频输入设备对应的待显示资源的数量;基于该数量,生成多个音频输入设备对应的待显示资源于界面中的显示布局。In some embodiments, the electronic device performs a display layout for the resources to be displayed corresponding to each audio input device, which may include: acquiring the number of resources to be displayed corresponding to multiple audio input devices; based on the number, generating multiple audio input devices The display layout of the corresponding resource to be displayed in the interface.
在该实施方式中,电子设备可以基于多个音频输入设备对应的待显示资源的数量,将显示界面划分为多个区域,然后将多个区域中每个区域对应一个音频输入设备对应的待显示资源(即一路视频),从而得到各个音频输入设备对应的待显示资源于显示界面中的显示布局。其中,多个 音频输入设备的待显示资源在显示界面中所占的面积之和与显示界面的面积的比值可以最大。可以理解地,利用该布局方式对多个音频输入设备的待显示资源于显示界面中的位置和大小进行布局,可以使得多个音频输入设备的待显示资源能够在显示界面中所占的比例最大,使显示界面中的区域充分利用。In this embodiment, the electronic device may divide the display interface into multiple regions based on the number of resources to be displayed corresponding to the multiple audio input devices, and then assign each region in the multiple regions to the to-be-displayed corresponding to one audio input device resources (ie, one channel of video), so as to obtain the display layout of the resources to be displayed corresponding to each audio input device in the display interface. Wherein, the ratio of the sum of the areas occupied by the resources to be displayed in the display interface of the multiple audio input devices to the area of the display interface may be the largest. It can be understood that by using this layout method to lay out the positions and sizes of the resources to be displayed in the display interface of the multiple audio input devices, the resources to be displayed of the multiple audio input devices can occupy the largest proportion in the display interface. to make full use of the area in the display interface.
在另一些实施方式中,电子设备也可以基于每个音频输入设备对应的待显示资源在其对应的音频输入设备中的显示参数,来生成显示布局。同样的,该多个音频输入设备的待显示资源在显示界面中所占的面积之和与显示界面的面积的比值可以最大。其中,显示参数可以包括每个音频输入设备的待显示资源在其音频输入设备中的尺寸信息以及显示状态,该尺寸信息可以包括“长”、“宽”、“长宽比”、“面积”等,显示状态可以包括横屏显示状态和竖屏显示状态。In other embodiments, the electronic device may also generate the display layout based on the display parameters of the resource to be displayed corresponding to each audio input device in the corresponding audio input device. Likewise, the ratio of the sum of the areas occupied by the resources to be displayed in the display interface of the plurality of audio input devices to the area of the display interface may be the largest. The display parameters may include size information and display status of the resources to be displayed in each audio input device in the audio input device, and the size information may include "length", "width", "aspect ratio", "area" etc., the display state may include a landscape display state and a portrait display state.
作为一种方式,待显示资源对应的音频输入设备可以使用JavaScript判断其为横屏显示状态或者为竖屏显示状态,具体地,音频输入设备一般都支持window.orientation这个参数,则音频输入设备可以通过window.orientation判断出其显示状态,并将该显示状态发送给电子设备。另外,电子设备可以获取视频的尺寸信息,即电子设备可以获取视频的“长”、“宽”、“长宽比”、“面积”等尺寸信息。作为一种方式,音频输入设备可以使用JavaScript获取其可尺寸信息,并将该尺寸信息发送给电子设备。As a method, the audio input device corresponding to the resource to be displayed can use JavaScript to determine whether it is in a horizontal screen display state or a vertical screen display state. Specifically, the audio input device generally supports the parameter window.orientation, then the audio input device can The display state is determined by window.orientation, and the display state is sent to the electronic device. In addition, the electronic device may acquire size information of the video, that is, the electronic device may acquire size information such as "length", "width", "aspect ratio", and "area" of the video. As one approach, the audio input device can use JavaScript to obtain its sizing information and send the sizing information to the electronic device.
在该实施方式中,电子设备通过获取多个音频输入设备的待显示资源的显示参数,确定显示布局,可以按照以上尺寸信息以及显示状态来对显示界面进行划分为多个区域,并将每个区域分配至一个音频输入设备的待显示资源,使得不同音频输入设备的待显示资源被分配的区域的尺寸大小之间的关系能够与在音频输入设备中的尺寸信息之间的大小关系对应,例如,音频输入设备A的待显示资源在音频输入设备A中的尺寸信息比音频输入设备B的待显示资源在音频输入设备B中的尺寸信息大,则音频输入设备A的待显示资源所分配的区域的尺寸也比音频输入设备B的待显示资源所分配的尺寸大;并且,每个音频输入设备的待显示资源在显示界面中的显示状态也与在音频输入设备中显示状态对应,例如,音频输入设备A的待显示资源在音频输入设备中是横屏显示,则分配的区域也应是横屏形状。In this embodiment, the electronic device determines the display layout by acquiring the display parameters of the resources to be displayed of multiple audio input devices, and can divide the display interface into multiple areas according to the above size information and display status, and divide each Regions are allocated to the resources to be displayed of an audio input device, so that the relationship between the sizes of the regions to which the resources to be displayed of different audio input devices are allocated can correspond to the size relationship between the size information in the audio input devices, for example , the size information of the resources to be displayed in the audio input device A is larger than the size information of the resources to be displayed in the audio input device B The size of the area is also larger than the size allocated by the resources to be displayed of the audio input device B; and the display state of the resources to be displayed of each audio input device in the display interface also corresponds to the display state in the audio input device, for example, If the resource to be displayed on the audio input device A is displayed in landscape on the audio input device, the allocated area should also be in landscape.
在又一些实施方式中,电子设备也可以获取输出待显示资源的每个音频输入设备音频输入设备与电子设备的相对位置关系,然后基于相对位置关系,来确定显示布局。其中,相对位置关系可以用于表征音频输入设备和电子设备的相对距离和相对角度。In still other embodiments, the electronic device may also acquire the relative positional relationship between the audio input device and the electronic device for each audio input device that outputs the resource to be displayed, and then determine the display layout based on the relative positional relationship. The relative positional relationship can be used to characterize the relative distance and relative angle between the audio input device and the electronic device.
在该实施方式中,音频输入设备可以位于电子设备的正前方、可以位于电子设备的左前方、可以位于电子设备的右前方、可以位于电子设备的上前方、也可以位于电子设备的下前方等,第二源设备可以位于电子设备的正前方、可以位于电子设备的左前方、可以位于电子设备的右前方、可以位于电子设备的上前方、也可以位于电子设备的下前方等,在此不做限定。In this embodiment, the audio input device may be located directly in front of the electronic device, may be located in the front left of the electronic device, may be located in the front right of the electronic device, may be located in the upper front of the electronic device, or may be located in the lower front of the electronic device, etc. , the second source device can be located directly in front of the electronic device, can be located in the front left of the electronic device, can be located in the front right of the electronic device, can be located in the upper front of the electronic device, or can be located in the lower front of the electronic device, etc. Do limit.
作为第一种方式,电子设备可以包括超宽带传感器(ultra wide band,UWB),音频输入设备也可以包括超宽带传感器,则电子设备可以通过两者的超宽带传感器获取音频输入设备与电子设备的相对位置关系。As a first method, the electronic device may include an ultra-wide band (UWB) sensor, and the audio input device may also include an ultra-wideband sensor, and the electronic device may obtain the difference between the audio input device and the electronic device through the two UWB sensors. relative positional relationship.
作为第二种方式,电子设备可以包括图像采集装置,则可以通过图像采集装置获取音频输入设备与电子设备的相对位置关系。As a second manner, the electronic device may include an image capture device, and the relative positional relationship between the audio input device and the electronic device may be acquired through the image capture device.
在本实施例中,在获取电子设备与音频输入设备的相对位置关系后,可以基于相对位置关系,确定显示布局。作为一种方式,当第一音频输入设备在电子设备的左前方,第二音频输入设备在电子设备的右前方时,则基于相对位置关系确定的显示布局可以包括:第一音频输入设备的待显示资源在显示界面中的位置位于显示界面的左部区域,第二音频输入设备的待显示资源在显示界面中的位置位于显示界面的右部区域等,在此不做限定。In this embodiment, after obtaining the relative positional relationship between the electronic device and the audio input device, the display layout may be determined based on the relative positional relationship. As an approach, when the first audio input device is in the front left of the electronic device and the second audio input device is in the front right of the electronic device, the display layout determined based on the relative positional relationship may include: The position of the display resource in the display interface is located in the left area of the display interface, and the position of the resource to be displayed of the second audio input device in the display interface is located in the right area of the display interface, etc., which are not limited here.
在以上实施方式中,电子设备也可以结合多个音频输入设备的待显示资源的数量、待显示资源的显示参数以及音频输入设备与电子设备的相对位置关系,来确定每路视频在显示界面中的显示布局。In the above embodiment, the electronic device may also combine the number of resources to be displayed of multiple audio input devices, the display parameters of the resources to be displayed, and the relative positional relationship between the audio input device and the electronic device to determine the display interface of each channel of video. display layout.
步骤S530:基于所述第一数量、所述第二数量以及所述显示布局,对每个音频输入设备分配至少一个音频输出装置的至少一个音频输出声道,其中,所述每个音频输入设备所分配的音频输出声道与所述显示布局对应。Step S530: Based on the first quantity, the second quantity and the display layout, assign at least one audio output channel of at least one audio output device to each audio input device, wherein each audio input device The assigned audio output channel corresponds to the display layout.
在本申请实施例中,电子设备在对每个音频输入设备分配音频输出声道时,除了参考音频输出装置的数量以及音频输入设备的数量以外,还可以参考以上显示布局。同样的,电子设备可以按照优先分配整个音频输出装置至音频输入设备的原则,尽量保证将一个音频输出装置的全部音频输出声道分配给音频输入设备;在音频输出装置的数量不能保证能够将一个音频输出装置的全部音频输出声道分配给音频输入设备时,再将音频输出装置的不同声道分配至不同的音频输入设 备,并且保证每个音频输入设备所分配的音频输出声道不同,如此,可以使得至少部分音频输入设备的音频数据能够被完整的音频输出装置进行播放(即音频输出装置的全部声道都用于播放一个音频输入设备的音频数据),并且可以方便用户区分不同音频输入设备的音频数据对应的播放声音。除此以外,电子设备还可以在分配音频输出声道时,根据以上显示布局,使分配给音频输入设备的音频输出声道能够靠近音频输入设备的待显示资源的显示位置。示例性的,请参阅图16,音频输入设备1对应的待显示资源A1位于电子设备的显示界面的左侧,则可以分配左侧的音频输出声道至该音频输入设备1;音频输入设备2对应的待显示资源A2位于电子设备的显示界面的右侧,则可以分配右侧的音频输出声道至该音频输入设备2。In this embodiment of the present application, when the electronic device allocates audio output channels to each audio input device, in addition to referring to the number of audio output devices and the number of audio input devices, the above display layout may also be referred to. Similarly, the electronic device may, in accordance with the principle of prioritizing the allocation of the entire audio output device to the audio input device, try to ensure that all audio output channels of an audio output device are allocated to the audio input device; the number of audio output devices cannot guarantee that one When all the audio output channels of the audio output device are assigned to the audio input device, then assign different channels of the audio output device to different audio input devices, and ensure that the audio output channels assigned to each audio input device are different, like this , the audio data of at least part of the audio input device can be played by the complete audio output device (that is, all channels of the audio output device are used to play the audio data of one audio input device), and it is convenient for users to distinguish different audio input devices. The playback sound corresponding to the audio data of the device. In addition, the electronic device can also, according to the above display layout, enable the audio output channel allocated to the audio input device to be close to the display position of the resource to be displayed on the audio input device when allocating the audio output channel. 16, the resource A1 to be displayed corresponding to the audio input device 1 is located on the left side of the display interface of the electronic device, then the audio output channel on the left can be assigned to the audio input device 1; the audio input device 2 If the corresponding resource A2 to be displayed is located on the right side of the display interface of the electronic device, the audio output channel on the right side can be allocated to the audio input device 2 .
步骤S540:获取所述多个音频输入设备传输的音频数据。Step S540: Acquire audio data transmitted by the plurality of audio input devices.
步骤S550:基于对所述每个音频输入设备分配的音频输出声道,对所述每个音频输入设备传输的音频数据进行播放。Step S550: Play audio data transmitted by each audio input device based on the audio output channel allocated to each audio input device.
在本申请实施例中,步骤S540以及步骤S550可以参阅前述实施例的内容,在此不再赘述。In this embodiment of the present application, for steps S540 and S550, reference may be made to the contents of the foregoing embodiments, and details are not described herein again.
本申请实施例提供的音频播放方法,在多个音频输入设备同时输入显示内容以及音频数据至电子设备进行显示和播放时,对多个音频输入设备的显示内容进行显示布局,按照优先给音频输入设备分配至少一个音频输出装置的所有音频输出声道的原则,基于音频输入设备的数量、音频输出装置的数量以及音频输入设备与显示不均,对音频输入设备分配不同的音频输出声道,保证了不同的音频输入设备的音频数据通过不同的音频输出声道进行播放,并且能够保证音频输出声道与显示布局相对应,进一步的方便了用户分辨不同音频输入设备的音频数据的播放声音,提升了音频播放效果。In the audio playback method provided by the embodiment of the present application, when multiple audio input devices simultaneously input display content and audio data to the electronic device for display and playback, the display layout of the display content of the multiple audio input devices is performed, and the audio input devices are given priority according to the display layout. The principle that the device allocates all audio output channels of at least one audio output device, based on the number of audio input devices, the number of audio output devices, and the uneven display of audio input devices, assign different audio output channels to audio input devices to ensure that The audio data of different audio input devices is played through different audio output channels, and it can ensure that the audio output channels correspond to the display layout, which further facilitates the user to distinguish the playback sound of the audio data of different audio input devices, and improves the audio playback effect.
请参阅图17,图17示出了本申请又另一个实施例提供的音频播放方法的流程示意图。该音频播放方法应用于上述电子设备,下面将针对图17所示的流程进行详细的阐述,所述音频播放方法具体可以包括以下步骤:Please refer to FIG. 17. FIG. 17 shows a schematic flowchart of an audio playback method provided by yet another embodiment of the present application. The audio playback method is applied to the above-mentioned electronic equipment, and the flow shown in FIG. 17 will be described in detail below. The audio playback method may specifically include the following steps:
步骤S610:获取多个音频输入设备以及所述音频输出装置的数量,其中,所述多个音频输入设备的数量作为第一数量,所述音频输出装置的数量作为第二数量。Step S610: Acquire the number of multiple audio input devices and the audio output devices, wherein the number of the multiple audio input devices is taken as the first number, and the number of the audio output devices is taken as the second number.
步骤S620:基于所述第一数量以及所述第二数量,对每个音频输入设备分配至少一个音频输出装置的至少一个音频输出声道,其中,每个音频输入设备所分配的音频输出声道不同。Step S620: Based on the first number and the second number, assign at least one audio output channel of at least one audio output device to each audio input device, wherein the audio output channel assigned by each audio input device different.
步骤S630:获取所述多个音频输入设备传输的音频数据。Step S630: Acquire audio data transmitted by the multiple audio input devices.
步骤S640:基于对所述每个音频输入设备分配的音频输出声道,对所述每个音频输入设备传输的音频数据进行播放。Step S640: Play audio data transmitted by each audio input device based on the audio output channel allocated to each audio input device.
在本申请实施例中,步骤S610至步骤S640可以参阅前述实施例的内容,在此不再赘述。In this embodiment of the present application, for steps S610 to S640, reference may be made to the content of the foregoing embodiments, and details are not described herein again.
步骤S650:在输入音频数据至所述电子设备的音频输入设备的数量发生变化时,基于变化后的音频输入设备的数量以及所述第二数量,重新对每个音频输入设备分配至少一个音频输出装置的至少一个音频输出声道。Step S650: when the number of audio input devices that input audio data to the electronic device changes, reassign at least one audio output to each audio input device based on the changed number of audio input devices and the second number At least one audio output channel of the device.
在本申请实施例中,电子设备在根据以上分配的音频输出声道,对各个音频输入设备输入的音频数据进行播放的过程中,还可以监测输入音频数据至电子设备的音频输入设备的数量,在输入音频数据至电子设备的音频输入设备的数量发生变化时,则基于变化后的音频输入设备的数量以及第二数量,重新对每个音频输入设备分配音频输出声道,以使分配的音频输出声道能够与当前的音频输入设备相适应。其中,根据变化后的音频输入设备的数量以及第二数量重新对每个音频输入设备分配音频输出声道的方式,可以参阅前述实施例中,根据第一数量以及第二数量对每个音频输入设备分配至少一个音频输出声道的方式。In the embodiment of the present application, the electronic device can also monitor the number of audio input devices that input audio data to the electronic device in the process of playing the audio data input by each audio input device according to the audio output channels allocated above, When the number of audio input devices that input audio data to the electronic device changes, based on the changed number of audio input devices and the second number, the audio output channels are re-assigned to each audio input device, so that the assigned audio The output channel can be adapted to the current audio input device. Wherein, according to the changed number of audio input devices and the second number of audio output channels are re-allocated to each audio input device, you can refer to the foregoing embodiment, according to the first number and the second number of audio input How the device assigns at least one audio output channel.
步骤S660:基于对所述每个音频输入设备重新分配的音频输出声道,对所述每个音频输入设备传输的音频数据进行播放。Step S660: Play audio data transmitted by each audio input device based on the audio output channel reassigned to each audio input device.
在本申请实施例中,在重新分配音频输出声道后,则可以基于重新分配的音频输出声道,对每个音频输入设备传输的音频数据进行播放。In this embodiment of the present application, after the audio output channel is reassigned, the audio data transmitted by each audio input device may be played based on the reassigned audio output channel.
本申请实施例提供的音频播放方法,还在输入音频数据至电子设备的音频输入设备的数量发生变化时,基于变化后的音频输入设备的数量以及第二数量,重新对每个音频输入设备分配音频输出声道,保证了音频输出声道的分配的实时性,使用户区分不同音频输入设备输入的音频能够得到保障。In the audio playback method provided by the embodiment of the present application, when the number of audio input devices for inputting audio data to the electronic device changes, based on the changed number of audio input devices and the second number, each audio input device is re-allocated The audio output channel ensures the real-time distribution of the audio output channel, so that the user can distinguish the audio input by different audio input devices.
请参阅图18,其示出了本申请实施例提供的一种音频播放装置400的结构框图。该音频播放装置400应用上述的电子设备,所述电子设备包括至少一个内置的音频输出装置以及至少一个外接的音频输出装置,所述音频输出装置均包括多个音频输出声道,该音频播放装置400包括:数量确定模块410、音频分配模块420、音频获取模块430以及播放模块440。其中,所述数量确定 模块410用于获取多个音频输入设备以及所述音频输出装置的数量,其中,所述多个音频输入设备的数量作为第一数量,所述音频输出装置的数量作为第二数量;所述音频分配模块420用于基于所述第一数量以及所述第二数量,对每个音频输入设备分配至少一个音频输出装置的至少一个音频输出声道,其中,每个音频输入设备所分配的音频输出声道不同;所述音频获取模块430用于获取所述多个音频输入设备传输的音频数据;所述播放模块440用于基于对所述每个音频输入设备分配的音频输出声道,对所述每个音频输入设备传输的音频数据进行播放。Please refer to FIG. 18 , which shows a structural block diagram of an audio playback apparatus 400 provided by an embodiment of the present application. The audio playback device 400 applies the above-mentioned electronic equipment, the electronic equipment includes at least one built-in audio output device and at least one external audio output device, the audio output devices each include a plurality of audio output channels, the audio playback device 400 includes: a quantity determination module 410 , an audio distribution module 420 , an audio acquisition module 430 and a playback module 440 . The quantity determination module 410 is configured to acquire the quantity of multiple audio input devices and the audio output devices, wherein the number of the multiple audio input devices is taken as the first quantity, and the quantity of the audio output devices is taken as the first quantity. Two quantities; the audio allocation module 420 is configured to allocate at least one audio output channel of at least one audio output device to each audio input device based on the first quantity and the second quantity, wherein each audio input The audio output channels allocated by the devices are different; the audio acquisition module 430 is used to acquire the audio data transmitted by the multiple audio input devices; the playback module 440 is used to obtain the audio data based on the audio input devices allocated to each of the audio input devices The output channel plays the audio data transmitted by each audio input device.
在一些实施方式中,所述音频分配模块420可以包括:数量判断单元以及第一分配单元。数量判断单元用于判断所述第二数量是否小于所述第一数量;第一分配单元用于若所述第二数量大于或等于所述第一数量,对所述每个音频输入设备分配至少一个音频输出装置的所有音频输出声道,其中,每个音频输入设备所分配的音频输出装置不同。In some embodiments, the audio distribution module 420 may include: a quantity determination unit and a first distribution unit. The quantity judgment unit is used for judging whether the second quantity is less than the first quantity; the first allocation unit is used for allocating at least the first quantity to each audio input device if the second quantity is greater than or equal to the first quantity All audio output channels of an audio output device, wherein each audio input device is assigned a different audio output device.
在该实施方式下,音频分配模块420还可以包括:声道数量获取单元、比值获取单元、第二分配单元以及第三分配单元。声道数量获取单元用于若所述第二数量小于所述第一数量,获取所有所述音频输出装置的音频输出声道的数量作为第三数量;比值获取单元用于获取所述第三数量与所述第一数量的比值;第二分配单元用于若所述比值大于设定阈值,对所述多个音频输入设备中的部分音频输入设备分配至少一个音频输出装置的所有音频输出声道,其中,所述部分音频输入设备中不同音频输入设备所分配的音频输出装置不同;第三分配单元用于对其他音频输入设备中每个音频输入设备分配剩余的音频输出装置的一个音频输出声道,所述其他音频输入设备为所述多个音频输入设备中除所述部分音频输入设备以外的音频输入设备,其中,所述其他音频输入设备中不同音频输入设备所分配的音频输出声道不同。In this embodiment, the audio distribution module 420 may further include: a channel number acquisition unit, a ratio acquisition unit, a second distribution unit, and a third distribution unit. The channel number acquisition unit is used to acquire the number of audio output channels of all the audio output devices as the third number if the second number is less than the first number; the ratio acquisition unit is used to acquire the third number a ratio with the first number; the second allocation unit is configured to allocate all audio output channels of at least one audio output device to some audio input devices in the plurality of audio input devices if the ratio is greater than a set threshold , wherein the audio output devices assigned by different audio input devices in the part of the audio input devices are different; the third distribution unit is used to assign an audio output sound of the remaining audio output devices to each audio input device in the other audio input devices The other audio input devices are audio input devices other than the part of the audio input devices in the plurality of audio input devices, wherein the audio output channels allocated by different audio input devices in the other audio input devices different.
在该方式下,第二分配单元可以具体用于:确定所述多个音频输入设备中分配一个音频输出装置的所有音频输出声道的音频输入设备的数量,作为第四数量;获取所述多个音频输入设备中每个音频输入设备的优先级;基于所述每个音频输入设备的优先级,从所述多个音频输入设备中确定所述第四数量的音频输入设备作为所述部分音频输入设备,其中,所述部分音频输入设备的优先级高于所述其他音频输入设备的优先级;对所述部分音频输入设备分配至少一个音频输出装置的所有音频输出声道。In this manner, the second allocating unit may be specifically configured to: determine the number of audio input devices to which all audio output channels of one audio output device are allocated among the plurality of audio input devices, as the fourth number; obtain the plurality of audio input devices the priority of each audio input device of the plurality of audio input devices; based on the priority of each audio input device, determining the fourth number of audio input devices as the partial audio from the plurality of audio input devices The input device, wherein the priority of the part of the audio input device is higher than the priority of the other audio input devices; all the audio output channels of the at least one audio output device are allocated to the part of the audio input device.
在该实施方式下,音频分配模块420还可以包括:第四分配单元。第四分配单元用于若所述比值小于或等于设定阈值,对所述多个音频输入设备中每个音频输入设备分配至少一个音频输出声道。In this embodiment, the audio distribution module 420 may further include: a fourth distribution unit. The fourth allocating unit is configured to allocate at least one audio output channel to each of the plurality of audio input devices if the ratio is less than or equal to the set threshold.
在另一些实施方式中,音频分配模块420也可以包括:位置关系获取单元以及第五分配单元。其中,位置关系获取单元用于获取所述每个音频输入设备与所述电子设备的相对位置关系;第五分配单元用于基于所述第一数量、所述第二数量以及所述每个音频输入设备与所述电子设备的相对位置关系,对所述每个音频输入设备分配至少一个音频输出装置的至少一个音频输出声道,其中,所述每个音频输入设备所分配的音频输出声道与所述相对位置关系对应。In other embodiments, the audio distribution module 420 may also include: a position relationship acquisition unit and a fifth distribution unit. Wherein, the positional relationship acquisition unit is used for acquiring the relative positional relationship between each audio input device and the electronic device; the fifth allocating unit is used for acquiring the relative positional relationship between the first quantity, the second quantity and the each audio The relative positional relationship between the input device and the electronic device, at least one audio output channel of at least one audio output device is allocated to each audio input device, wherein the audio output channel allocated to each audio input device corresponding to the relative positional relationship.
在又一些实施方式中,音频分配模块420也可以包括:距离获取单元以及第六分配单元。其中,距离获取单元用于获取所述每个音频输入设备相对所述电子设备的距离;第六分配单元用于基于所述第一数量、所述第二数量以及所述每个音频输入设备相对所述电子设备的距离,对所述每个音频输入设备分配至少一个音频输出装置的至少一个音频输出声道,其中,所述每个音频输入设备所分配的音频输出声道的数量与所述距离呈正相关。In still other embodiments, the audio distribution module 420 may also include: a distance acquisition unit and a sixth distribution unit. Wherein, the distance obtaining unit is used to obtain the distance of each audio input device relative to the electronic device; the sixth allocating unit is used to obtain the relative distance of each audio input device based on the first quantity, the second quantity and the relative distance of each audio input device. The distance of the electronic device, at least one audio output channel of at least one audio output device is allocated to each audio input device, wherein the number of audio output channels allocated by each audio input device is the same as the number of audio output channels allocated by the each audio input device. distance is positively correlated.
在再一些实施方式中,所述音频输入设备还用于传输待显示资源至所述电子设备进行显示。该音频播放装置400还可以包括显示布局模块,显示布局模块用于在所述基于所述第一数量以及所述第二数量,对每个音频输入设备分配至少一个音频输出装置的至少一个音频输出声道之前,对所述每个音频输入设备对应的待显示资源进行显示布局。音频分配模块420也可以具体用于:基于所述第一数量、所述第二数量以及所述显示布局,对每个音频输入设备分配至少一个音频输出装置的至少一个音频输出声道,其中,所述每个音频输入设备所分配的音频输出声道与所述显示布局对应。In still other embodiments, the audio input device is further configured to transmit the resource to be displayed to the electronic device for display. The audio playback apparatus 400 may further include a display layout module configured to allocate at least one audio output of at least one audio output device to each audio input device based on the first quantity and the second quantity Before the channel, the display layout is performed on the resources to be displayed corresponding to each audio input device. The audio allocation module 420 may also be specifically configured to: based on the first quantity, the second quantity and the display layout, allocate at least one audio output channel of at least one audio output device to each audio input device, wherein, The audio output channel assigned to each audio input device corresponds to the display layout.
在一些实施方式中,音频分配模块420还用于在输入音频数据至所述电子设备的音频输入设备的数量发生变化时,基于变化后的音频输入设备的数量以及所述第二数量,重新对每个音频输入设备分配至少一个音频输出装置的至少一个音频输出声道。In some embodiments, the audio distribution module 420 is further configured to, when the number of audio input devices for inputting audio data to the electronic device changes, based on the changed number of audio input devices and the second number, re-allocate Each audio input device is assigned at least one audio output channel of at least one audio output device.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述装置和模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, for the specific working process of the above-described devices and modules, reference may be made to the corresponding processes in the foregoing method embodiments, which will not be repeated here.
在本申请所提供的几个实施例中,模块相互之间的耦合可以是电性,机械或其它形式的耦合。In several embodiments provided in this application, the coupling between the modules may be electrical, mechanical or other forms of coupling.
另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块 单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist physically alone, or two or more modules may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware, and can also be implemented in the form of software function modules.
综上所述,本申请提供的方案,通过根据音频输入设备的数量,以及音频输出装置的数量,对每个音频输入设备分配至少一个音频输出装置的至少一个音频输出声道,然后获取多个音频输入设备传输的音频数据,基于对每个音频输入设备分配的音频输出声道,对每个音频输入设备传输的音频数据进行播放,从而实现对不同的音频输入设备分配不同的音频输出声道,方便用户清楚地区分不同音频输入设备输入的声音,提升用户体验。To sum up, the solution provided by the present application allocates at least one audio output channel of at least one audio output device to each audio input device according to the number of audio input devices and the number of audio output devices, and then obtains multiple audio output channels. The audio data transmitted by the audio input device plays the audio data transmitted by each audio input device based on the audio output channel assigned to each audio input device, thereby realizing the assignment of different audio output channels to different audio input devices. , which is convenient for users to clearly distinguish the sounds input by different audio input devices and improve the user experience.
请参考图19,其示出了本申请实施例提供的一种电子设备的结构框图。该电子设备100可以是智能电视、笔记本电脑、台式电脑等能够运行应用程序的电子设备。本申请中的电子设备100可以包括一个或多个如下部件:处理器110、存储器120、显示屏130、音频输出装置140以及一个或多个应用程序,其中一个或多个应用程序可以被存储在存储器120中并被配置为由一个或多个处理器110执行,一个或多个程序配置用于执行如前述方法实施例所描述的方法。Please refer to FIG. 19 , which shows a structural block diagram of an electronic device provided by an embodiment of the present application. The electronic device 100 may be an electronic device capable of running an application program, such as a smart TV, a notebook computer, a desktop computer, or the like. The electronic device 100 in the present application may include one or more of the following components: a processor 110, a memory 120, a display screen 130, an audio output device 140, and one or more application programs, wherein one or more application programs may be stored in In the memory 120 and configured to be executed by the one or more processors 110, one or more programs are configured to perform the methods described in the foregoing method embodiments.
处理器110可以包括一个或者多个处理核。处理器110利用各种接口和线路连接整个电子设备100内的各个部分,通过运行或执行存储在存储器120内的指令、程序、代码集或指令集,以及调用存储在存储器120内的数据,执行电子设备100的各种功能和处理数据。可选地,处理器110可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器110可集成中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器110中,单独通过一块通信芯片进行实现。The processor 110 may include one or more processing cores. The processor 110 uses various interfaces and lines to connect various parts of the entire electronic device 100, and executes by running or executing the instructions, programs, code sets or instruction sets stored in the memory 120, and calling the data stored in the memory 120. Various functions of the electronic device 100 and processing data. Optionally, the processor 110 may adopt at least one of a digital signal processing (Digital Signal Processing, DSP), a Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), and a Programmable Logic Array (Programmable Logic Array, PLA). A hardware form is implemented. The processor 110 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU), a modem, and the like. Among them, the CPU mainly handles the operating system, user interface and application programs, etc.; the GPU is used for rendering and drawing of the display content; the modem is used to handle wireless communication. It can be understood that, the above-mentioned modem may also not be integrated into the processor 110, and is implemented by a communication chip alone.
存储器120可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory)。存储器120可用于存储指令、程序、代码、代码集或指令集。存储器120可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等。存储数据区还可以存储电子设备100在使用中所创建的数据(比如电话本、音视频数据、聊天记录数据)等。The memory 120 may include random access memory (Random Access Memory, RAM), or may include read-only memory (Read-Only Memory). Memory 120 may be used to store instructions, programs, codes, sets of codes, or sets of instructions. The memory 120 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.) , instructions for implementing the following method embodiments, and the like. The storage data area may also store data (such as phone book, audio and video data, chat record data) created by the electronic device 100 during use.
显示屏130用于显示由用户输入的信息、提供给用户的信息以及所述电子设备100的各种图形用户接口,这些图形用户接口可以由图形、文本、图标、数字、视频和其任意组合来构成,在一个实例中,该显示屏130可以为液晶显示器(Liquid Crystal Display,LCD),也可以为有机发光二极管(Organic Light-Emitting Diode,OLED),在此不做限定。The display screen 130 is used to display information input by the user, information provided to the user, and various graphical user interfaces of the electronic device 100, which may be composed of graphics, text, icons, numbers, videos, and any combination thereof. In one example, the display screen 130 may be a liquid crystal display (Liquid Crystal Display, LCD) or an organic light-emitting diode (Organic Light-Emitting Diode, OLED), which is not limited herein.
音频输出装置140用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频输出装置140还可以用于对音频信号编码和解码。在一些方式中,音频输出装置140可以包括扬声器、受话器、麦克风等,在此不做限定。The audio output device 140 is used for converting digital audio information into analog audio signal output, and also for converting analog audio input into digital audio signal. Audio output device 140 may also be used to encode and decode audio signals. In some manners, the audio output device 140 may include speakers, receivers, microphones, etc., which are not limited herein.
请参考图20,其示出了本申请实施例提供的一种计算机可读存储介质的结构框图。该计算机可读介质800中存储有程序代码,所述程序代码可被处理器调用执行上述方法实施例中所描述的方法。Please refer to FIG. 20 , which shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application. The computer-readable medium 800 stores program codes, and the program codes can be invoked by the processor to execute the methods described in the above method embodiments.
计算机可读存储介质800可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。可选地,计算机可读存储介质800包括非易失性计算机可读介质(non-transitory computer-readable storage medium)。计算机可读存储介质800具有执行上述方法中的任何方法步骤的程序代码810的存储空间。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。程序代码810可以例如以适当形式进行压缩。The computer readable storage medium 800 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 800 includes a non-transitory computer-readable storage medium. Computer readable storage medium 800 has storage space for program code 810 to perform any of the method steps in the above-described methods. These program codes can be read from or written to one or more computer program products. Program code 810 may be compressed, for example, in a suitable form.
最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不驱使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand: it can still be Modifications are made to the technical solutions described in the foregoing embodiments, or some technical features thereof are equivalently replaced; and these modifications or replacements do not drive the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (20)

  1. 一种音频播放方法,其特征在于,应用于电子设备,所述电子设备包括至少一个内置的音频输出装置以及至少一个外接的音频输出装置,所述音频输出装置均包括多个音频输出声道,所述方法包括:An audio playback method, characterized in that it is applied to electronic equipment, the electronic equipment includes at least one built-in audio output device and at least one external audio output device, and the audio output devices each include a plurality of audio output channels, The method includes:
    获取多个音频输入设备以及所述音频输出装置的数量,其中,所述多个音频输入设备的数量作为第一数量,所述音频输出装置的数量作为第二数量;Acquiring the number of multiple audio input devices and the audio output devices, wherein the number of the multiple audio input devices is used as the first number, and the number of the audio output devices is used as the second number;
    基于所述第一数量以及所述第二数量,对每个音频输入设备分配至少一个音频输出装置的至少一个音频输出声道,其中,每个音频输入设备所分配的音频输出声道不同;based on the first number and the second number, assigning at least one audio output channel of at least one audio output device to each audio input device, wherein each audio input device is assigned a different audio output channel;
    获取所述多个音频输入设备传输的音频数据;obtaining audio data transmitted by the plurality of audio input devices;
    基于对所述每个音频输入设备分配的音频输出声道,对所述每个音频输入设备传输的音频数据进行播放。The audio data transmitted by each audio input device is played based on the audio output channel assigned to each audio input device.
  2. 根据权利要求1所述的方法,其特征在于,所述基于所述第一数量以及所述第二数量,对每个音频输入设备分配至少一个音频输出装置的至少一个音频输出声道,包括:The method according to claim 1, wherein, based on the first quantity and the second quantity, allocating at least one audio output channel of at least one audio output device to each audio input device comprises:
    判断所述第二数量是否小于所述第一数量;determining whether the second quantity is less than the first quantity;
    若所述第二数量大于或等于所述第一数量,对所述每个音频输入设备分配至少一个音频输出装置的所有音频输出声道,其中,每个音频输入设备所分配的音频输出装置不同。If the second number is greater than or equal to the first number, assign all audio output channels of at least one audio output device to each audio input device, wherein the audio output devices assigned to each audio input device are different .
  3. 根据权利要求2所述的方法,其特征在于,所述对所述每个音频输入设备分配至少一个音频输出装置的所有音频输出声道,包括:The method according to claim 2, wherein the allocating all audio output channels of at least one audio output device to each audio input device comprises:
    确定待分配完整的音频输出装置的音频输入设备的数量作为目标数量;Determine the number of audio input devices to be allocated a complete audio output device as the target number;
    将所述目标数量的音频输入设备分配至少一个音频输出装置的所有音频输出声道,并且每个音频输入设备所分配的音频输出装置不同。All audio output channels of at least one audio output device are allocated to the target number of audio input devices, and each audio input device is allocated a different audio output device.
  4. 根据权利要求2或3所述的方法,其特征在于,每个音频输出装置的音频输出声道的数量相同,所述基于所述第一数量以及所述第二数量,对每个音频输入设备分配至少一个音频输出装置的至少一个音频输出声道,还包括:The method according to claim 2 or 3, wherein the number of audio output channels of each audio output device is the same, and based on the first number and the second number, for each audio input device Allocating at least one audio output channel of at least one audio output device, further comprising:
    若所述第二数量小于所述第一数量,获取所有所述音频输出装置的音频输出声道的数量作为第三数量;If the second number is less than the first number, acquiring the number of audio output channels of all the audio output devices as a third number;
    获取所述第三数量与所述第一数量的比值;obtaining the ratio of the third quantity to the first quantity;
    若所述比值大于设定阈值,对所述多个音频输入设备中的部分音频输入设备分配至少一个音频输出装置的所有音频输出声道,其中,所述部分音频输入设备中不同音频输入设备所分配的音频输出装置不同,所述设定阈值根据单个音频输出装置的音频输出声道的数量设置;If the ratio is greater than the set threshold, assign all audio output channels of at least one audio output device to some audio input devices in the plurality of audio input devices, wherein different audio input devices in the part of the audio input devices have all audio output channels. The assigned audio output devices are different, and the set threshold is set according to the number of audio output channels of a single audio output device;
    对其他音频输入设备中每个音频输入设备分配剩余的音频输出装置的至少一个音频输出声道,所述其他音频输入设备为所述多个音频输入设备中除所述部分音频输入设备以外的音频输入设备,其中,所述其他音频输入设备中不同音频输入设备所分配的音频输出声道不同。Allocate at least one audio output channel of the remaining audio output device to each audio input device in the other audio input devices, where the other audio input devices are audios other than the part of the audio input devices in the plurality of audio input devices An input device, wherein the audio output channels assigned to different audio input devices in the other audio input devices are different.
  5. 根据权利要求4所述的方法,其特征在于,所述对所述多个音频输入设备中的部分音频输入设备分配至少一个音频输出装置的所有音频输出声道,包括:The method according to claim 4, wherein the allocating all audio output channels of at least one audio output device to some of the audio input devices in the plurality of audio input devices comprises:
    确定所述多个音频输入设备中分配一个音频输出装置的所有音频输出声道的音频输入设备的数量,作为第四数量;Determine the number of audio input devices that allocate all audio output channels of an audio output device in the plurality of audio input devices, as the fourth number;
    获取所述多个音频输入设备中每个音频输入设备的优先级;obtaining the priority of each audio input device in the plurality of audio input devices;
    基于所述每个音频输入设备的优先级,从所述多个音频输入设备中确定所述第四数量的音频输入设备作为所述部分音频输入设备,其中,所述部分音频输入设备的优先级高于所述其他音频输入设备的优先级;The fourth number of audio input devices is determined from the plurality of audio input devices as the partial audio input devices based on the priority of each audio input device, wherein the priority of the partial audio input devices higher priority than said other audio input devices;
    对所述部分音频输入设备分配一个音频输出装置的所有音频输出声道。All audio output channels of an audio output device are allocated to the part of the audio input device.
  6. 根据权利要求5所述的方法,其特征在于,所述获取所述多个音频输入设备中每个音频输入设备的优先级,包括:The method according to claim 5, wherein the acquiring the priority of each audio input device in the plurality of audio input devices comprises:
    获取所述多个音频输入设备中每个音频输入设备的类型;obtaining the type of each audio input device in the plurality of audio input devices;
    基于所述每个音频输入设备的类型,确定所述每个音频输入设备的优先级。Based on the type of each audio input device, the priority of each audio input device is determined.
  7. 根据权利要求4-6任一项所述的方法,其特征在于,所述基于所述第一数量以及所述第二数量,对每个音频输入设备分配至少一个音频输出装置的至少一个音频输出声道,还包括:The method according to any one of claims 4-6, wherein the at least one audio output of at least one audio output device is allocated to each audio input device based on the first quantity and the second quantity soundtrack, which also includes:
    若所述比值小于或等于设定阈值,对所述多个音频输入设备中每个音频输入设备分配至少一 个音频输出声道。If the ratio is less than or equal to the set threshold, assigning at least one audio output channel to each of the plurality of audio input devices.
  8. 根据权利要求1-7任一项所述的方法,其特征在于,所述基于所述第一数量以及所述第二数量,对每个音频输入设备分配至少一个音频输出装置的至少一个音频输出声道,包括:The method according to any one of claims 1-7, wherein the at least one audio output of at least one audio output device is allocated to each audio input device based on the first quantity and the second quantity soundtrack, including:
    获取所述每个音频输入设备与所述电子设备的相对位置关系;acquiring the relative positional relationship between each audio input device and the electronic device;
    基于所述第一数量、所述第二数量以及所述每个音频输入设备与所述电子设备的相对位置关系,对所述每个音频输入设备分配至少一个音频输出装置的至少一个音频输出声道,其中,所述每个音频输入设备所分配的音频输出声道与所述相对位置关系对应。Assigning at least one audio output sound of at least one audio output device to each audio input device based on the first number, the second number, and the relative positional relationship between each audio input device and the electronic device channel, wherein the audio output channel assigned by each audio input device corresponds to the relative positional relationship.
  9. 根据权利要求8所述的方法,其特征在于,所述基于所述第一数量、所述第二数量以及所述每个音频输入设备与所述电子设备的相对位置关系,对所述每个音频输入设备分配至少一个音频输出装置的至少一个音频输出声道,包括:The method according to claim 8, wherein, based on the first quantity, the second quantity, and the relative positional relationship between each audio input device and the electronic device, for each of the audio input devices The audio input device assigns at least one audio output channel of at least one audio output device, including:
    基于所述第一数量以及第二数量,对所述每个音频输入设备分配对应数量的音频输出声道;assigning a corresponding number of audio output channels to each audio input device based on the first number and the second number;
    根据所述每个音频输入设备与所述电子设备的相对位置关系,以及所述音频输出声道的位置,分配所述对应数量的音频输出声道至所述每个音频输入设备。The corresponding number of audio output channels are allocated to each audio input device according to the relative positional relationship between each audio input device and the electronic device, and the position of the audio output channel.
  10. 根据权利要求8或9所述的方法,其特征在于,所述电子设备包括超宽带传感器,所述音频输入设备也包括超宽带传感器,所述获取所述每个音频输入设备与所述电子设备的相对位置关系,包括:The method according to claim 8 or 9, wherein the electronic device includes an ultra-wideband sensor, the audio input device also includes an ultra-wideband sensor, and the acquiring the relationship between each audio input device and the electronic device The relative positional relationship of , including:
    通过所述电子设备以及所述每个音频输入设备的超宽带传感器,获取所述每个音频输入设备与所述电子设备的相对位置关系。The relative positional relationship between each audio input device and the electronic device is acquired through the electronic device and the ultra-wideband sensor of each audio input device.
  11. 根据权利要求1-7任一项所述的方法,其特征在于,所述基于所述第一数量以及所述第二数量,对每个音频输入设备分配至少一个音频输出装置的至少一个音频输出声道,包括:The method according to any one of claims 1-7, wherein the at least one audio output of at least one audio output device is allocated to each audio input device based on the first quantity and the second quantity soundtrack, including:
    获取所述每个音频输入设备相对所述电子设备的距离;obtaining the distance of each audio input device relative to the electronic device;
    基于所述第一数量、所述第二数量以及所述每个音频输入设备相对所述电子设备的距离,对所述每个音频输入设备分配至少一个音频输出装置的至少一个音频输出声道,其中,所述每个音频输入设备所分配的音频输出声道的数量与所述距离呈正相关。assigning to each audio input device at least one audio output channel of at least one audio output device based on the first number, the second number, and the distance of each audio input device relative to the electronic device, Wherein, the number of audio output channels allocated by each audio input device is positively correlated with the distance.
  12. 根据权利要求11所述的方法,其特征在于,所述基于所述第一数量、所述第二数量以及所述每个音频输入设备相对所述电子设备的距离,对所述每个音频输入设备分配至少一个音频输出装置的至少一个音频输出声道,包括:12. The method of claim 11, wherein the processing for each audio input is based on the first number, the second number, and the distance of each audio input device relative to the electronic device. The device assigns at least one audio output channel of at least one audio output device, including:
    根据所述每个音频输入设备相对所述电子设备的距离,确定所述每个音频输入设备所分配的音频输出声道的数量,所述每个音频输入设备所分配的音频输出声道的数量与所述距离呈正相关;According to the distance of each audio input device relative to the electronic device, the number of audio output channels allocated to each audio input device is determined, and the number of audio output channels allocated to each audio input device is positively correlated with said distance;
    基于所述每个音频输入设备所分配的音频输出声道的数量,并根据所述第一数量以及第二数量,将所有音频输出装置的音频输出声道分配给所述音频输入设备。Based on the number of audio output channels allocated to each audio input device, and according to the first number and the second number, the audio output channels of all audio output devices are allocated to the audio input device.
  13. 根据权利要求1-7任一项所述的方法,其特征在于,所述音频输入设备还用于传输待显示资源至所述电子设备进行显示,在所述基于所述第一数量以及所述第二数量,对每个音频输入设备分配至少一个音频输出装置的至少一个音频输出声道之前,所述方法还包括:The method according to any one of claims 1-7, wherein the audio input device is further configured to transmit resources to be displayed to the electronic device for display, and the audio input device is further configured to transmit resources to be displayed to the electronic device for display. For the second quantity, before allocating at least one audio output channel of at least one audio output device to each audio input device, the method further includes:
    对所述每个音频输入设备对应的待显示资源进行显示布局;Display layout for resources to be displayed corresponding to each audio input device;
    所述基于所述第一数量以及所述第二数量,对每个音频输入设备分配至少一个音频输出装置的至少一个音频输出声道,包括:The assigning at least one audio output channel of at least one audio output device to each audio input device based on the first number and the second number includes:
    基于所述第一数量、所述第二数量以及所述显示布局,对每个音频输入设备分配至少一个音频输出装置的至少一个音频输出声道,其中,所述每个音频输入设备所分配的音频输出声道与所述显示布局对应。At least one audio output channel of at least one audio output device is assigned to each audio input device based on the first number, the second number, and the display layout, wherein each audio input device is assigned with at least one audio output channel of at least one audio output device Audio output channels correspond to the display layout.
  14. 根据权利要求13所述的方法,其特征在于,所述对所述每个音频输入设备对应的待显示资源进行显示布局,包括:The method according to claim 13, wherein the displaying layout of the resources to be displayed corresponding to each audio input device comprises:
    获取所述多个音频输入设备对应的待显示资源的数量;obtaining the number of resources to be displayed corresponding to the plurality of audio input devices;
    基于所述待显示资源的数量,生成所述多个音频输入设备对应的待显示资源于界面中的显示布局。Based on the number of the resources to be displayed, a display layout of the resources to be displayed corresponding to the plurality of audio input devices in the interface is generated.
  15. 根据权利要求14所述的方法,其特征在于,所述基于所述待显示资源的数量,生成所述多个音频输入设备对应的待显示资源于界面中的显示布局,包括:The method according to claim 14, wherein the generating a display layout of the resources to be displayed corresponding to the plurality of audio input devices in the interface based on the number of the resources to be displayed comprises:
    基于所述多个音频输入设备对应的待显示资源的数量,将显示界面划分为多个区域;dividing the display interface into multiple areas based on the number of resources to be displayed corresponding to the multiple audio input devices;
    将所述多个区域中每个区域对应一个所述音频输入设备对应的待显示资源,得到所述每个音频输入设备对应的待显示资源于所述显示界面中的显示布局。Corresponding each of the multiple regions to a resource to be displayed corresponding to the audio input device to obtain a display layout of the resource to be displayed corresponding to each audio input device in the display interface.
  16. 根据权利要求13所述的方法,其特征在于,所述对所述每个音频输入设备对应的待显示资源进行显示布局,包括:The method according to claim 13, wherein the displaying layout of the resources to be displayed corresponding to each audio input device comprises:
    基于所述每个音频输入设备对应的待显示资源在其对应的音频输入设备中的显示参数,生成显示布局。Based on the display parameters of the resource to be displayed corresponding to each audio input device in the corresponding audio input device, a display layout is generated.
  17. 根据权利要求1-16任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-16, wherein the method further comprises:
    在输入音频数据至所述电子设备的音频输入设备的数量发生变化时,基于变化后的音频输入设备的数量以及所述第二数量,重新对每个音频输入设备分配至少一个音频输出装置的至少一个音频输出声道。When the number of audio input devices that input audio data to the electronic device changes, based on the changed number of audio input devices and the second number, reassign at least one audio output device to each audio input device. One audio output channel.
  18. 一种音频播放装置,其特征在于,应用于电子设备,所述电子设备包括至少一个内置的音频输出装置以及至少一个外接的音频输出装置,所述音频输出装置均包括多个音频输出声道,所述装置包括:数量确定模块、音频分配模块、音频获取模块以及播放模块,其中,An audio playback device, characterized in that it is applied to electronic equipment, the electronic equipment includes at least one built-in audio output device and at least one external audio output device, and the audio output devices each include a plurality of audio output channels, The device includes: a quantity determination module, an audio distribution module, an audio acquisition module and a playback module, wherein,
    所述数量确定模块用于获取多个音频输入设备以及所述音频输出装置的数量,其中,所述多个音频输入设备的数量作为第一数量,所述音频输出装置的数量作为第二数量;The quantity determination module is configured to obtain the quantity of multiple audio input devices and the audio output devices, wherein the number of the multiple audio input devices is used as the first quantity, and the number of the audio output devices is used as the second quantity;
    所述音频分配模块用于基于所述第一数量以及所述第二数量,对每个音频输入设备分配至少一个音频输出装置的至少一个音频输出声道,其中,每个音频输入设备所分配的音频输出声道不同;The audio distribution module is configured to allocate at least one audio output channel of at least one audio output device to each audio input device based on the first quantity and the second quantity, wherein the Different audio output channels;
    所述音频获取模块用于获取所述多个音频输入设备传输的音频数据;The audio acquisition module is used to acquire audio data transmitted by the plurality of audio input devices;
    所述播放模块用于基于对所述每个音频输入设备分配的音频输出声道,对所述每个音频输入设备传输的音频数据进行播放。The playing module is configured to play the audio data transmitted by each audio input device based on the audio output channel allocated to each audio input device.
  19. 一种电子设备,其特征在于,包括:An electronic device, comprising:
    一个或多个处理器;one or more processors;
    存储器;memory;
    一个或多个应用程序,其中所述一个或多个应用程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个程序配置用于执行如权利要求1-17任一项所述的方法。one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs are configured to perform such as The method of any of claims 1-17.
  20. 一种计算机可读取存储介质,其特征在于,所述计算机可读取存储介质中存储有程序代码,所述程序代码可被处理器调用执行如权利要求1-17任一项所述的方法。A computer-readable storage medium, wherein a program code is stored in the computer-readable storage medium, and the program code can be invoked by a processor to execute the method according to any one of claims 1-17 .
PCT/CN2021/113242 2020-10-15 2021-08-18 Audio playback method and apparatus, electronic device, and storage medium WO2022078056A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011105792.0A CN112181353B (en) 2020-10-15 2020-10-15 Audio playing method and device, electronic equipment and storage medium
CN202011105792.0 2020-10-15

Publications (1)

Publication Number Publication Date
WO2022078056A1 true WO2022078056A1 (en) 2022-04-21

Family

ID=73950542

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/113242 WO2022078056A1 (en) 2020-10-15 2021-08-18 Audio playback method and apparatus, electronic device, and storage medium

Country Status (2)

Country Link
CN (1) CN112181353B (en)
WO (1) WO2022078056A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112181353B (en) * 2020-10-15 2022-05-20 Oppo广东移动通信有限公司 Audio playing method and device, electronic equipment and storage medium
CN113050916A (en) * 2021-04-09 2021-06-29 深圳Tcl新技术有限公司 Audio playing method, device and storage medium
CN113422865A (en) * 2021-06-01 2021-09-21 维沃移动通信有限公司 Directional recording method and device
CN113676720B (en) * 2021-08-04 2023-11-10 Oppo广东移动通信有限公司 Multimedia resource playing method and device, computer equipment and storage medium
CN113885827A (en) * 2021-10-09 2022-01-04 Oppo广东移动通信有限公司 Audio playing method and device, electronic equipment, computer readable medium and product

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1791198A (en) * 2004-12-17 2006-06-21 Tcl王牌电子(深圳)有限公司 TV set apparatus capable of simultaneously receiving and playing multi-channel programs
CN105812887A (en) * 2016-03-18 2016-07-27 深圳创维-Rgb电子有限公司 Multi-screen display television and multi-screen play method
CN106325798A (en) * 2016-08-23 2017-01-11 努比亚技术有限公司 Method and device for achieving multi-screen content display
US20170078824A1 (en) * 2015-09-11 2017-03-16 Samsung Electronics Co., Ltd. Electronic apparatus, audio system and audio output method
CN110381197A (en) * 2019-06-27 2019-10-25 华为技术有限公司 Many-one throws the processing method of screen sound intermediate frequency data, apparatus and system
CN111263233A (en) * 2020-02-20 2020-06-09 腾讯科技(深圳)有限公司 Television multi-window processing method and device, computer equipment and storage medium
CN112181353A (en) * 2020-10-15 2021-01-05 Oppo广东移动通信有限公司 Audio playing method and device, electronic equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090207098A1 (en) * 2007-07-05 2009-08-20 Himax Display, Inc. Portable electronic device and displaying method thereof
CN103593111A (en) * 2013-11-14 2014-02-19 三星电子(中国)研发中心 Screen sharing method for mobile terminals and mobile terminals
CN104657099B (en) * 2015-01-15 2019-04-12 小米科技有限责任公司 Screen projective techniques, apparatus and system
US10097902B2 (en) * 2015-05-06 2018-10-09 Blackfire Research Corporation System and method for using multiple audio input devices for synchronized and position-based audio

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1791198A (en) * 2004-12-17 2006-06-21 Tcl王牌电子(深圳)有限公司 TV set apparatus capable of simultaneously receiving and playing multi-channel programs
US20170078824A1 (en) * 2015-09-11 2017-03-16 Samsung Electronics Co., Ltd. Electronic apparatus, audio system and audio output method
CN105812887A (en) * 2016-03-18 2016-07-27 深圳创维-Rgb电子有限公司 Multi-screen display television and multi-screen play method
CN106325798A (en) * 2016-08-23 2017-01-11 努比亚技术有限公司 Method and device for achieving multi-screen content display
CN110381197A (en) * 2019-06-27 2019-10-25 华为技术有限公司 Many-one throws the processing method of screen sound intermediate frequency data, apparatus and system
CN111263233A (en) * 2020-02-20 2020-06-09 腾讯科技(深圳)有限公司 Television multi-window processing method and device, computer equipment and storage medium
CN112181353A (en) * 2020-10-15 2021-01-05 Oppo广东移动通信有限公司 Audio playing method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN112181353B (en) 2022-05-20
CN112181353A (en) 2021-01-05

Similar Documents

Publication Publication Date Title
WO2022078056A1 (en) Audio playback method and apparatus, electronic device, and storage medium
CN107371044B (en) Electronic equipment interaction method, electronic equipment, user terminal and server
WO2022078040A1 (en) Display method and apparatus, and electronic device and storage medium
US11648474B2 (en) Dynamic adjustment of cloud game data streams to output device and network quality
JP6341023B2 (en) Terminal device, data transmission method and program
EP3787301B1 (en) Method and system for sharing an output device between multimedia devices to transmit and receive data
US20160259611A1 (en) Method and apparatus for implementing a multi-screen system
US20220253492A1 (en) Method, an apparatus, an electronic device and a storage medium for multimedia information processing
WO2022078039A1 (en) Display method and apparatus, electronic device and storage medium
US11349976B2 (en) Information processing method, file transmission method, electronic apparatus, and computing apparatus
KR20110074039A (en) Display apparatus and control method of contents thereof
WO2022078065A1 (en) Display device resource playing method and display device
JP2018503281A (en) Image display method, user terminal, and video receiving device
CN110752999B (en) Screen broadcasting method, device, system, electronic equipment and storage medium
US10091458B2 (en) Communication system
CN112637957A (en) Display device and communication method of display device and wireless sound box
WO2022242628A1 (en) Screen casting method, apparatus, and device, and storage medium
US20170127120A1 (en) User terminal and control method therefor
US20190132398A1 (en) Networked User Interface Back Channel Discovery Via Wired Video Connection
CN115278332A (en) Display device, playing device and data transmission method
KR102011834B1 (en) display device
JP6500366B2 (en) Management device, terminal device, transmission system, transmission method and program
WO2023143318A1 (en) Data display method and apparatus, and electronic device and storage medium
WO2022206772A1 (en) Connection establishment method, storage meduim and related device
WO2023108468A1 (en) Streaming media processing method, system and device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21879103

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21879103

Country of ref document: EP

Kind code of ref document: A1