Vehicle-mounted multi-sound-area sound mixing method and device
By initializing the sound zone in the vehicle system, calculating and outputting the target output volume of each sound zone, the problem of uneven mixing effects in the existing technology is solved, and the unification of multi-audio stream types in the multi-audio segment is achieved. Manage and efficient mixing.
Patent Information
- Application Number
- CN202411484308.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-02-18
AI Technical Summary
In the prior art, the multi-sound zone mixing strategy is processed by the APP ends, resulting in uneven mixing effects and cannot meet the mixing needs of multi-sound zone multi-audio streams of the vehicle system.
Provide a vehicle-mounted multi-tone zone mixing method, which divides the sound zones through the initialization system, obtains the target audio stream type and attribute information, calculates the target output volume of each sound zone, and outputs the mixed sound through the sound output channel of the corresponding sound zone. Audio streaming data.
It realizes unified management of multi-audio stream types in multi-sound zones, reduces APP applications' dependence on mixing needs, reduces application development volume, improves program reliability, and solves the problem of inaccurate mixing strategies.
Smart Images

Figure CN119485113A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of audio processing, and in particular to a vehicle-mounted multi-zone audio mixing method and device. Background Art
[0002] At present, Android system is gradually becoming the main operating system for in-vehicle infotainment devices. In-vehicle systems often need to support the simultaneous playback of multiple audio stream types in multiple audio zones, such as the warning sound broadcast to passengers at the station in the outer area of the bus when the bus leaves the station and the announcement sound to passengers in the passenger area inside the bus.
[0003] The existing multi-zone mixing strategies are all handled by the APP end. The different processing methods of each APP lead to uneven multi-zone mixing effects, and the audio mixing of other zones cannot be processed, which cannot meet the mixing requirements of the vehicle system. Therefore, there is an urgent need for a mixing technology solution that can handle multi-zone and multi-audio stream types for unified management. Summary of the invention
[0004] The present invention provides a vehicle-mounted multi-zone mixing method and device, aiming to solve the defects in the prior art, reduce the dependence of mixing requirements on various APP application programs, thereby reducing the application development workload and improving program reliability.
[0005] In order to achieve the above object, the technical solution adopted by the present invention is:
[0006] In one aspect, the present invention provides a vehicle-mounted multi-zone audio mixing method, comprising:
[0007] Step S0, initializing the system, dividing the vehicle system into a preset number of audio zones, configuring a main channel and / or a secondary channel for each audio zone, and setting the output volume of the secondary channel of each audio zone according to the pre-amplifier volume of each audio zone in the framework layer;
[0008] Step S1, obtaining the target audio stream type and corresponding attribute information;
[0009] Step S2, calculating the target output volume of each target audio stream type in each audio zone according to the mixing instruction and the attribute information;
[0010] Step S3: outputting the mixed audio stream data of each audio zone through the sound output channel of the corresponding audio zone.
[0011] Specifically, the step S2 includes:
[0012] Step S21, judging the audio zone and channel of the current audio stream type according to the attribute information, if the channel is a primary channel, proceeding to step S22, if the channel is a secondary channel, proceeding to step S23;
[0013] Step S22, determining whether the current audio stream type has the highest priority among the audio stream types being played in all audio zones, if yes, setting the main channel output volume of the current audio zone to the front volume of the current audio stream type, otherwise executing the first multi-zone mixing strategy;
[0014] Step S23, traversing all audio stream types in the current audio zone whose audio priority is lower than the current audio stream type, and executing a second multi-audio zone mixing strategy;
[0015] Step S24, traverse all the audio zones whose audio zone priorities are lower than the current audio zone, and execute the third multi-audio zone mixing strategy.
[0016] Specifically, the first multi-zone mixing strategy includes:
[0017] Step A1, obtaining a first audio stream type set, determining the smallest of the depression ratios of all audio stream types in the first audio stream type set to the current audio stream type as a first minimum depression ratio, determining the audio stream type corresponding to the first minimum depression ratio as a first characteristic audio stream element, and the first audio stream type set is a set of all audio stream types being played in the current audio zone and having a higher priority than the current audio stream type;
[0018] Step A2, obtaining a preset number of second audio stream type sets, determining the smallest of the suppression ratios of all audio stream types in each second audio stream type set to the current audio stream type as the corresponding second minimum suppression ratio, determining the audio stream type corresponding to the second minimum suppression ratio as the second characteristic audio stream element, and the second audio stream type set is a set of all audio stream types being played in each audio zone except the current audio zone;
[0019] Step A3, obtaining the suppression ratio coefficient of each other sound zone to the current sound zone;
[0020] Step A4, determining a final compression ratio for the current audio stream type and a minimum audio stream type corresponding to the final compression ratio according to the first minimum compression ratio, the second minimum compression ratio, and the compression ratio coefficient;
[0021] Step A5, determine whether the final compression ratio is 100%, if so, set the main channel output volume of the current sound zone to the pre-volume of the current audio stream type, otherwise determine the main channel output volume of the current sound zone according to the final compression ratio and the current volume of the lowest ratio audio stream type.
[0022] Specifically, the final compression ratio is determined according to a first preset relationship, which is:
[0023] final_ratio1=min(OtherZoneRatio(1)*min_ratio_zone_1,
[0024] OtherZoneRatio(2)*min_ratio_zone_2,
[0025] OtherZoneRatio(3)*min_ratio_zone_3,
[0026] …
[0027] OtherZoneRatio(n)*min_ratio_zone_n,
[0028] min_ratio_my_zone_n);
[0029] Among them, OtherZoneRatio(k) (k=1,2,3...n) represents the suppression ratio of other zones with serial number k to the current zone. If the zone priority of other zone k is lower than that of the current zone, OtherZoneRatio(k) is 100%; min_ratio_zone_k (k=1,2,3...n) represents the second minimum suppression ratio corresponding to other zones with serial number k; min_ratio_my_zone_1 represents the first minimum suppression ratio; min() function represents the calculation of the minimum value of all parameters;
[0030] The output volume of the main channel of the current audio zone is determined according to the second preset relationship:
[0031] minSrcStreamVol=floor(final_ratio1*FinalTopStreamCurrentVol)
[0032] Among them, minSrcStreamVol represents the main channel output volume of the current sound zone, final_ratio1 represents the final compression ratio, FinalTopStreamCurrentVol represents the current volume of the lowest ratio audio stream type, and floor() represents the rounding down function.
[0033] Specifically, the second multi-zone mixing strategy includes:
[0034] Step B1, obtaining a third audio stream type set, where the third audio stream type set is a set of all audio stream types in the current audio zone whose priority is lower than the current audio stream type;
[0035] Step B2: Execute a corresponding mixing strategy according to the output channels corresponding to the third audio stream type set.
[0036] Specifically, when the channel where the third audio stream type set is located is the main channel, step B2 includes:
[0037] Step B201, determining whether an audio stream type in the third audio stream type set is being played, if yes, determining the smallest depression ratio of the current audio stream type to all audio stream types in the third audio stream type set as a third minimum depression ratio and executing the next step, otherwise executing step B205;
[0038] Step B202, determining whether the third minimum compression ratio is 100%, if yes, exiting the current volume adjustment, otherwise calculating the first multi-zone mixing strategy volume according to the third minimum compression ratio and the current volume of the third audio stream type;
[0039] Step B203, determining whether the volume of the first multi-zone mixing strategy is lower than the rear volume of the main channel of the current zone, if yes, setting the output volume of the main channel of the current zone to the first multi-zone mixing strategy volume, otherwise exiting the current volume adjustment;
[0040] Step B204, determining whether only the third audio stream type is in a playing state in the main channel of the current audio zone, if yes, obtaining the media audio reduction ratio and proceeding to the next step, otherwise exiting the current volume adjustment; the media audio reduction ratio is the reduction ratio of the current audio stream type to the media audio stream type;
[0041] Step B205, calculating the mixing strategy volume of the main channel after mixing according to the media audio compression ratio and the current volume of the current audio stream type and executing the next step, otherwise directly exiting;
[0042] Step B206, determining whether the main channel mixing strategy volume in the current audio zone is less than the current volume of the media audio stream type and the media audio compression ratio is not 100%, if yes, setting the main channel output volume to the main channel mixing strategy volume, otherwise exiting this volume adjustment;
[0043] The volume of the first multi-zone mixing strategy is determined according to a third preset relationship:
[0044] minMyZoneMainChannelVol=floor(min_ratio_my_zone_2*destMyZoneStreamCurrentVol)
[0045] Wherein, minMyZoneMainChannelVol represents the volume of the first multi-zone mixing strategy, min_ratio_my_zone_2 represents the third minimum suppression ratio, destMyZoneStreamCurrentVol represents the current volume of the third audio stream type, and floor() represents the rounding down function;
[0046] The main channel mixing strategy volume is calculated according to the fourth preset relationship:
[0047] minMyZoneMusicVol=floor(musicRatio*srcMyZoneStreamCurVol)
[0048] Among them, minMyZoneMusicVol represents the main channel mixing strategy volume, musicRatio represents the media audio compression ratio, srcMyZoneStreamCurVol represents the current volume of the current audio stream type, and floor() represents the rounding down function.
[0049] Specifically, when the channel where the third audio stream type is located is a secondary channel, step B2 includes:
[0050] Step B211, obtaining a fourth compression ratio, where the fourth compression ratio is a compression ratio of the current audio stream type to the third audio stream type;
[0051] Step B212: Calculate the volume of the second multi-zone mixing strategy after mixing according to the fourth compression ratio and the current volume of the current audio stream type.
[0052] Step B213, determining whether the second multi-zone mixing strategy volume is less than the current front volume of the third audio stream type, if yes, setting the second multi-zone mixing strategy volume to the front volume of the third audio stream type, otherwise exiting the current volume adjustment;
[0053] The volume of the second multi-zone mixing strategy is calculated according to the fifth preset relationship:
[0054] minMyZoneDestStreamVol=
[0055] floor(destMyZoneStreamRatio*srcMyZoneStreamCurVol)
[0056] Among them, minMyZoneDestStreamVol represents the volume of the second multi-zone mixing strategy, destMyZoneStreamRatio represents the fourth compression ratio, srcMyZoneStreamCurVol represents the current volume of the current audio stream type, and floor() represents the rounding down function.
[0057] Specifically, the third multi-zone mixing strategy includes:
[0058] Step C1, obtaining a preset number of fourth audio stream type sets, where the fourth audio stream type set is a set of all audio stream types of other audio zones whose audio zone priority is lower than that of the current audio zone;
[0059] Step C2, obtaining the ratio coefficient of each audio zone having a lower priority than the current audio zone to suppress the current audio zone;
[0060] Step C3, judging whether the depression ratio coefficient is 100%, if yes, exiting the current volume adjustment, otherwise proceeding to the next step;
[0061] Step C4, mixing the volumes of all audio stream types in the fourth audio stream type set according to the reduction ratio coefficient;
[0062] The step C4 comprises: calculating the volume of all audio stream types in the fourth audio stream type set after mixing according to a sixth preset relationship:
[0063] OtherZoneDestStreamVol(k)=floor(SrcStreamVol*OtherZoneRatio(k))
[0064] Among them, OtherZoneDestStreamVol(k) (k=1,2,3…n) represents the volume of the sound zone with a lower priority than the current sound zone and a sequence number k after mixing processing, SrcStreamVol is the volume of the currently playing audio stream type, OtherZoneRatio(k) represents the compression ratio of other sound zones with a sequence number k to the current sound zone, and floor() represents the rounding down function.
[0065] Another aspect of the present invention provides a vehicle-mounted multi-zone audio mixing device, comprising:
[0066] Application layer, framework layer, driver layer and hardware layer;
[0067] The application layer includes a number of APP applications set in multiple audio zones, which are used to initiate the action of playing audio and video, and also includes a setting APP for setting the volume of the audio stream of each audio zone;
[0068] The framework layer is used to obtain and manage multiple audio streams from the APP applications in each audio zone according to the preset mixing strategy, and determine the target output volume of each audio zone;
[0069] The driver layer includes an audio driver module, which is used to respond to the target volume output by the framework layer and complete the playback and / or volume control of the audio stream;
[0070] The hardware layer includes the main and sub-channel output channels of each audio zone and the DSP module, which is used to process and output multiple mixed audio streams.
[0071] Specifically, the framework layer includes a Java layer media player, a Native layer media player, a multi-zone audio stream management module, and a multi-zone mixing strategy module which are connected in sequence;
[0072] The Java layer media player is used to perform software decoding on the audio stream of the Java layer;
[0073] The Native layer media player is used to perform software decoding on the audio stream of the Native layer;
[0074] The multi-zone audio stream management module is used to encapsulate the decoded audio stream and the corresponding attribute information and send them to the multi-zone mixing strategy module, and is also used to save the playback volume of each audio stream;
[0075] The multi-zone mixing strategy module is used to manage and calculate the target output volume of each type of audio stream in each zone according to a preset mixing strategy, and update it to the audio stream management module.
[0076] The beneficial effects of the present invention are as follows: the present invention uniformly processes the audio stream data played by all audio zone applications by a multi-audio zone mixing strategy module, thereby achieving the goal that each APP application program does not need to process the mixing work, reducing the dependence of the mixing demand on each APP application program, thereby reducing the application development amount and improving the program reliability. Moreover, since the mixing strategy processing flow is located at the bottom layer of the framework, the time for processing the mixing strategy is the actual playback time of the audio stream, thereby solving the problem of inaccurate mixing strategy timing in the prior art and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0077] Figure 1 It is a schematic flow chart of the vehicle-mounted multi-zone audio mixing method of the present invention;
[0078] Figure 2 It is a structural schematic diagram of the vehicle-mounted multi-zone audio mixing device of the present invention. DETAILED DESCRIPTION
[0079] The following specifically describes the embodiments of the present invention in conjunction with the accompanying drawings, which are only for reference and illustration and do not constitute a limitation on the scope of patent protection of the present invention.
[0080] In the process described in the specification, claims or drawings of the present invention, the serial numbers of each step (such as step 10, 20, etc.) are included. The serial numbers are only used to distinguish the steps, and the serial numbers themselves do not represent any execution order. It should be noted that the descriptions such as "first" and "second" in this article are only used to distinguish the description objects, etc., and do not represent the order of precedence, nor do they mean that "first", "second", etc. are different types.
[0081] Example 1
[0082] like Figure 1 As shown, this embodiment provides a vehicle-mounted multi-zone mixing method, including:
[0083] Step S0, initialize the system, divide the vehicle system into a preset number of audio zones, configure a main channel and / or a secondary channel for each audio zone, and set the output volume of the secondary channel of each audio zone according to the pre-amplifier volume of each audio zone in the framework layer.
[0084] As an example of an embodiment, the preset number of sound zones may include a driver zone, a passenger zone, an exterior zone, and other zones.
[0085] It is easy to understand that if there is no sub-channel in the audio zone, there is no need to set the output volume of the sub-channel of the audio zone.
[0086] In this embodiment, the front volume is a volume value obtained by the system calling the audio management (AudioZoneManager) API to set the volume of each audio zone audio stream type.
[0087] The rear volume is the volume of the main channel of each audio zone saved after adjustment by the user and the pre-set volume of the corresponding audio zone's secondary channel; for audio zones without secondary channels, the rear volume is the main channel volume.
[0088] The current volume of the multi-zone audio stream type refers to the volume of the audio stream type of the zone set by the user and saved by the system.
[0089] For example, after the user adjusts the volume of a certain audio stream type (such as the volume of a voice call in the outside car area), the system will automatically save it, and the saved volume is the current volume of the audio stream type in the outside car area.
[0090] Step S1, obtaining the target audio stream type and corresponding attribute information.
[0091] In this embodiment, the target audio stream type includes the audio stream type (such as PCM data stream) decoded by the Java layer media player and the Native layer media player software, including but not limited to USB music, navigation broadcast, VR voice, shouting sound, and broadcast sound.
[0092] The attribute information includes an audio stream type identifier, an audio priority, an output channel, a sound zone type, and a compression ratio of other audio stream types, as shown in Table 1 below.
[0093] In this embodiment, the smaller the number of the audio priority is, the higher the priority is. The reduction ratio is preset and can be set according to different user needs (such as usage scenarios), and the present invention does not limit this.
[0094] Table 1:
[0095]
[0096] Step S2: Calculate the target output volume of each target audio stream type in each audio zone according to the mixing instruction and the attribute information.
[0097] In this embodiment, step S2 includes:
[0098] Step S21, judging the audio zone and channel of the current audio stream type according to the attribute information, if the channel is the main channel, proceeding to step S22, if the channel is the secondary channel, proceeding to step S23.
[0099] For example, the exterior area and other areas are only configured with the main channel, and the driver area or the passenger area are configured with the main and sub channels. Then, if the sound zone to which the current audio stream type belongs is the exterior area or other areas, or the driver area or the passenger area and the output channel is the main channel, step S22 should be executed.
[0100] For example, the user starts the passenger area media APP and clicks the media playback function. At this time, the output audio stream type SrcStream is MUSIC_2. According to the system settings, it will be output from the main channel of the passenger area, so MUSIC_2 is the current audio stream type.
[0101] Step S22, determine whether the current audio stream type has the highest priority among the audio stream types being played in all audio zones, if so, set the main channel output volume of the current audio zone to the front volume of the current audio stream type, otherwise execute the first multi-zone mixing strategy.
[0102] In this embodiment, the current audio zone (MyZone) is the audio zone where the current audio stream type is located.
[0103] The output volume of the main channel (or sub-channel) of a sound zone refers to the final volume of the audio playback in that sound zone.
[0104] For example, the priority of the current audio stream type MUSIC_2 is 5. If the audio stream types being played in all audio zones include CLUSTER, BROADCAST, VR, NAVI, and WARNING, whose priorities are 0, 1, 2, 3, and 3 respectively, and the audio zones and channels being played are the driver zone sub-channel, the exterior zone main channel, the passenger zone sub-channel, the driver zone sub-channel, and the passenger zone main channel respectively, then the priority of the current audio stream type MUSIC_2 is not the highest, and the first mixing strategy needs to be executed at this time.
[0105] In this embodiment, setting the main channel output volume of the current audio zone as the front volume of the current audio stream type includes: calling a function interface of the driver layer to set the main channel output volume of the current audio zone as the front volume of the current audio stream type.
[0106] Step S23: traverse all audio stream types in the current audio zone whose audio priority is lower than the current audio stream type, and execute a second multi-audio zone mixing strategy.
[0107] Step S24, traverse all the audio zones whose audio zone priorities are lower than the current audio zone, and execute the third multi-audio zone mixing strategy.
[0108] Step S3: outputting the mixed audio stream data of each audio zone through the sound output channel of the corresponding audio zone.
[0109] In this embodiment, the first multi-zone mixing strategy includes:
[0110] Step A1, obtain a first audio stream type set, determine the smallest of the suppression ratios of all audio stream types in the first audio stream type set to the current audio stream type as the first minimum suppression ratio, determine the audio stream type corresponding to the first minimum suppression ratio as the first characteristic audio stream element, and the first audio stream type set is a set of all audio stream types being played in the current sound zone and having a higher priority than the current audio stream type.
[0111] For example, the audio stream being played in the current audio zone (passenger zone) has a higher priority than the current audio stream type MUSIC_2 in the audio stream type set MyZoneTopStreams (i.e., the first audio stream type set) including two audio stream types, VR and WARNING. Among them, the compression ratio of VR to the current audio stream type MUSIC_2 is 60%, and the compression ratio of WARNING to the current audio stream type MUSIC_2 is 80%. The first minimum compression ratio min_ratio_my_zone_1 is 60%, and the corresponding first characteristic audio stream element MyZoneTopStream is VR.
[0112] Step A2, obtaining a preset number of second audio stream type sets, determining the smallest of the suppression ratios of all audio stream types in each second audio stream type set to the current audio stream type as the corresponding second minimum suppression ratio, determining the audio stream type corresponding to the second minimum suppression ratio as the second characteristic audio stream element, and the second audio stream type set is a set of all audio stream types being played in each audio zone except the current audio zone.
[0113] It is easy to understand that when there are multiple audio zones other than the current audio zone, there are also multiple second audio stream type sets, and the corresponding second minimum compression ratio and second characteristic audio stream elements are also multiple.
[0114] For example, there are three audio zones other than the current audio zone MyZone, named OtherZone1, OtherZone2, and OtherZone3 respectively. Then there are three second audio stream type sets, named audio stream type sets OtherZoneTopStreams1, OtherZoneTopStreams2, and OtherZoneTopStreams3 respectively. The second minimum compression ratios corresponding to these three audio stream type sets are also three, namely min_ratio_zone_1, min_ratio_zone_2, and min_ratio_zone_3 respectively, and the corresponding second characteristic audio stream elements are also three, namely TopStreamZone_1, TopStreamZone_2, and TopStreamZone_3 respectively.
[0115] For example, in the audio stream being played in the driver zone, the audio stream type set OtherZoneTopStreams1 with a higher priority than the current audio stream type MUSIC_2 has two audio stream types, CLUSTER and NAVI. Among them, the compression ratio of CLUSTER to the current audio stream type MUSIC_2 is 30%, and the compression ratio of NAVI to the current audio stream type MUSIC_2 is 50%. Then the second minimum compression ratio min_ratio_zone_1 corresponding to the audio stream type set OtherZoneTopStreams1 is 30%, and the second characteristic audio stream element TopStreamZone_1 is CLUSTER; similarly, the second minimum compression ratio min_ratio_zone_2 corresponding to the audio stream type set OtherZoneTopStreams2 outside the current audio zone is 60%, and the second characteristic audio stream element TopStreamZone_2 is BROADCAST; the second minimum compression ratio min_ratio_zone_3 corresponding to the audio stream type set OtherZoneTopStreams3 outside the current audio zone is 100%, and the second characteristic audio stream element TopStreamZone_3 is empty.
[0116] Step A3: Obtain the proportional coefficient of the suppression of the current sound zone by each other sound zone.
[0117] For example, if there are three other sound zones, namely OtherZone1, OtherZone2, and OtherZone3, the suppression ratio coefficient of other sound zone OtherZone1 to the current sound zone is OtherZoneRatio(1), the suppression ratio coefficient of other sound zone OtherZone2 to the current sound zone is OtherZoneRatio(2), and the suppression ratio coefficient of other sound zone OtherZone3 to the current sound zone is OtherZoneRatio(3).
[0118] Step A4: Determine the final compression ratio for the current audio stream type and the lowest ratio audio stream type corresponding to the final compression ratio according to the first minimum compression ratio, the second minimum compression ratio, and the compression ratio coefficient.
[0119] In this embodiment, the final compression ratio is determined according to a first preset relationship, which is:
[0120] final_ratio1=min(OtherZoneRatio(1)*min_ratio_zone_1,
[0121] OtherZoneRatio(2)*min_ratio_zone_2,
[0122] OtherZoneRatio(3)*min_ratio_zone_3,
[0123] …
[0124] OtherZoneRatio(n)*min_ratio_zone_n,
[0125] min_ratio_my_zone_n);
[0126] Among them, OtherZoneRatio(k) (k=1,2,3...n) represents the suppression ratio of other zones with sequence number k to the current zone. If the zone priority of other zone k is lower than that of the current zone, OtherZoneRatio(k) is 100%;
[0127] min_ratio_zone_k (k=1, 2, 3…n) represents the second minimum depression ratio corresponding to other sound zones with sequence number k;
[0128] min_ratio_my_zone_1 represents the first minimum depression ratio;
[0129] The min() function calculates the minimum value of all parameters.
[0130] For example, the driver zone is higher than the current zone in the currently playing audio zone, and the driver zone suppresses the current zone by 80%, so OtherZoneRatio(1) is 80%; since the priority of the outside zone and other zones is lower than the current zone, OtherZoneRatio(2) and OtherZoneRatio(3) are both 100%; min_ratio_zone_1 is 30%, and the corresponding second feature audio stream element TopStreamZone_1 is CLUSTER; min_ratio_zone_2 is 60%, and the corresponding second feature audio stream element TopStreamZone_2 is BROADCAST; min_ratio_zone_3 is 100%, min_ratio_my_zone_1 is 60%, and the corresponding second feature audio stream element TopStreamZone_3 is empty; the first feature audio stream element MyZoneTopStream is VR, then:
[0131] final_ratio1=min(80%*30%, 100%*60%, 100%*100%, 60%)
[0132] =24%
[0133] The lowest-ratio audio stream type FinalTopStream is the CLUSTER of the second characteristic audio stream element TopStreamZone_1;
[0134] Step A5, determine whether the final compression ratio is 100%, if so, set the main channel output volume of the current sound zone to the pre-volume of the current audio stream type, otherwise determine the main channel output volume of the current sound zone according to the final compression ratio and the current volume of the lowest ratio audio stream type.
[0135] In this embodiment, the output volume of the main channel of the current sound zone is determined according to a second preset relationship:
[0136] minSrcStreamVol=floor(final_ratio1*FinalTopStreamCurrentVol)
[0137] Among them, minSrcStreamVol represents the main channel output volume of the current sound zone, final_ratio1 represents the final compression ratio, FinalTopStreamCurrentVol represents the current volume of the lowest ratio audio stream type, and floor() represents the rounding down function.
[0138] For example, if the lowest-ratio audio stream type FinalTopStream is CLUSTER, and the current volume FinalTopStreamCurrentVol of CLUSTER is 20, then minSrcStreamVol=floor(24%*20)=4.
[0139] In this embodiment, a compression ratio of 100% means that no compression processing is performed and a multi-zone mixing operation is performed directly.
[0140] In this embodiment, the second multi-zone mixing strategy includes:
[0141] Step B1: Obtain a third audio stream type set, where the third audio stream type set is a set of all audio stream types in the current audio zone whose priority is lower than the current audio stream type.
[0142] In this embodiment, the third audio stream type set MyZoneDestStreams may be an audio stream type that is being played, or an audio stream type that is not being played.
[0143] Step B2: Execute a corresponding mixing strategy according to the output channels corresponding to the third audio stream type set.
[0144] When the channel where the third audio stream type set is located is the main channel, step B2 includes:
[0145] Step B201, determine whether an audio stream type in the third audio stream type set is being played, if so, determine the smallest depression ratio of the current audio stream type to all audio stream types in the third audio stream type set as the third minimum depression ratio and execute the next step, otherwise execute step B205.
[0146] For example, the third audio stream type MyZoneDestStream of the main channel in the driver zone with a lower priority than the current audio stream type CLUSTER is a RING audio stream type, and the compression ratio of CLUSTER to the RING audio stream type is 50%, then the third minimum compression ratio min_ratio_my_zone_2 is 50%.
[0147] Step B202, determine whether the third minimum depression ratio is 100%, if yes, exit the current volume adjustment, otherwise calculate the first multi-zone mixing strategy volume according to the third minimum depression ratio and the current volume of the third audio stream type.
[0148] In this embodiment, the volume of the first multi-zone mixing strategy is determined according to a third preset relationship:
[0149] minMyZoneMainChannelVol=floor(min_ratio_my_zone_2*destMyZoneStreamCurrentVol)
[0150] Among them, minMyZoneMainChannelVol represents the volume of the first multi-zone mixing strategy, min_ratio_my_zone_2 represents the third minimum compression ratio, destMyZoneStreamCurrentVol represents the current volume of the third audio stream type, and floor() represents the rounding down function.
[0151] For example, the current volume of RING in the driver zone is 30, that is, the current volume of the third audio stream type destMyZoneStreamCurrentVo=30, then the first multi-zone mixing strategy volume minMyZoneMainChannelVol=floor(50%*30)=15.
[0152] Step B203, determining whether the volume of the first multi-zone mixing strategy is lower than the rear volume of the main channel of the current zone, if yes, setting the output volume of the main channel of the current zone to the first multi-zone mixing strategy volume, otherwise exiting the current volume adjustment.
[0153] Step B204: determine whether only the third audio stream type is in the playing state in the main channel of the current audio zone, if yes, obtain the media audio reduction ratio and proceed to the next step, otherwise exit the current volume adjustment. The media audio reduction ratio is the reduction ratio of the current audio stream type to the media audio stream type.
[0154] Step B205: Calculate the mixing strategy volume of the main channel after mixing according to the media audio compression ratio and the current volume of the current audio stream type and execute the next step, otherwise exit directly.
[0155] In this embodiment, the main channel mixing strategy volume is calculated according to the fourth preset relationship:
[0156] minMyZoneMusicVol=floor(musicRatio*srcMyZoneStreamCurVol)
[0157] Among them, minMyZoneMusicVol represents the main channel mixing strategy volume, musicRatio represents the media audio compression ratio, srcMyZoneStreamCurVol represents the current volume of the current audio stream type, and floor() represents the rounding down function.
[0158] Step B206, determine whether the main channel mixing strategy volume in the current audio zone is less than the current volume of the media audio stream type and the media audio compression ratio is not 100%, if so, set the main channel output volume to the main channel mixing strategy volume, otherwise exit this volume adjustment.
[0159] For example, if the media audio compression ratio musicRatio is 30% and the current volume of CLUSTER is 20, then minMyZoneMusicVol=floor(30%*20)=6. If the current media audio volume MUSIC_1 is 10, which is greater than minMyZoneMusicVol, then the main channel output volume is set to minMyZoneMusicVol=6.
[0160] When the channel where the third audio stream type is located is a secondary channel, the step B2 includes:
[0161] Step B211: Obtain a fourth compression ratio, where the fourth compression ratio is a compression ratio of the current audio stream type to the third audio stream type.
[0162] Step B212: Calculate the volume of the second multi-zone mixing strategy after mixing according to the fourth compression ratio and the current volume of the current audio stream type.
[0163] In this embodiment, the volume of the second multi-zone mixing strategy is calculated according to the fifth preset relationship:
[0164] minMyZoneDestStreamVol=
[0165] floor(destMyZoneStreamRatio*srcMyZoneStreamCurVol)
[0166] Among them, minMyZoneDestStreamVol represents the volume of the second multi-zone mixing strategy, destMyZoneStreamRatio represents the fourth compression ratio, srcMyZoneStreamCurVol represents the current volume of the current audio stream type, and floor() represents the rounding down function.
[0167] For example 12, the fourth depression ratio destMyZoneStreamRatio of CLUSTER to NAVI in the driver zone is 20%, and the current volume of CLUSTER is 25, then minMyZoneDestStreamVol=floor(20%*25)=5.
[0168] Step B213: determine whether the second multi-zone mixing strategy volume is less than the current front volume of the third audio stream type. If so, set the second multi-zone mixing strategy volume to the front volume of the third audio stream type; otherwise, exit this volume adjustment.
[0169] For example, the current pre-volume of the driver zone NAVI is 10, and the second multi-zone mixing strategy volume minMyZoneDestStreamVol=5, which is less than the current pre-volume of NAVI 10, then the pre-volume of the driver zone NAVI is set to 5.
[0170] In this embodiment, the third multi-zone mixing strategy includes:
[0171] Step C1: Obtain a preset number of fourth audio stream type sets, where the fourth audio stream type set is a set of all audio stream types of other audio zones whose audio zone priority is lower than that of the current audio zone.
[0172] For example, if there are three audio zones with lower priority than the current audio zone, named OtherZone1, OtherZone2, and OtherZone3 respectively, then the fourth audio stream type set is three, named audio stream type set OtherZoneDestStreams1, OtherZoneDestStreams2, and OtherZoneDestStreams3 respectively.
[0173] For example, OtherZoneDestStreams1 is the VR voice broadcast type, shouting sound type, and media playback audio stream type in the passenger area; OtherZoneDestStreams2 is the broadcast audio stream type in the outside area; OtherZoneDestStreams3 is the radio audio stream type in other areas.
[0174] Step C2: Obtain the proportional coefficient of each audio zone having a lower priority level than the current audio zone to suppress the current audio zone.
[0175] For example, if there are three audio zones with lower priority than the current audio zone, the reduction ratio coefficients are OtherZoneRatio(1), OtherZoneRatio(2), and OtherZoneRatio(3) respectively.
[0176] Step C3, determine whether the reduction ratio coefficient is 100%, if yes, exit the current volume adjustment, otherwise proceed to the next step.
[0177] Step C4: Mixing the volumes of all audio stream types in the fourth audio stream type set according to the reduction ratio coefficient.
[0178] In this embodiment, the step C4 includes: calculating the volume of all audio stream types in the fourth audio stream type set after mixing according to a sixth preset relationship:
[0179] OtherZoneDestStreamVol(k)=floor(SrcStreamVol*OtherZoneRatio(k))
[0180] Among them, OtherZoneDestStreamVol(k) (k=1,2,3…n) represents the volume of the sound zone with a lower priority than the current sound zone and a sequence number k after mixing processing, SrcStreamVol is the volume of the currently playing audio stream type, OtherZoneRatio(k) represents the compression ratio of other sound zones with a sequence number k to the current sound zone, and floor() represents the rounding down function.
[0181] For example, the volume of the CLUSTER type played in the driver's zone, SrcStreamVol, is 20, and the driver's zone's suppression ratio to the passenger zone, OtherZoneRatio(1), is 80%. The priority of the outside zone and other zones is lower than that of the passenger zone, so the suppression ratios of the passenger zone, OtherZoneRatio(2) and OtherZoneRatio(3), are 100%. Then OtherZoneDestStreamVol1=floor(20*80%)=16 is calculated, that is, the volume of VR voice, shouting sound, and media sound in the passenger zone are all set to 16, and the volume of the outside zone and other zones is not processed.
[0182] Example 2
[0183] like Figure 2 As shown, this embodiment provides a vehicle-mounted multi-zone audio mixing device, including: an application layer, a framework layer, a driver layer and a hardware layer;
[0184] The application layer includes a number of APP applications set in multiple audio zones, which are used to initiate the action of playing audio and video, and also includes a setting APP for setting the volume of the audio stream of each audio zone;
[0185] The framework layer is used to obtain and manage multiple audio streams from the APP applications in each audio zone according to the preset mixing strategy, and determine the target output volume of each audio zone;
[0186] The driver layer includes an audio driver module, which is used to respond to the target volume output by the framework layer and complete the playback and / or volume control of the audio stream;
[0187] The hardware layer includes the main and sub-channel output channels of each audio zone and the DSP module, which is used to process and output multiple mixed audio streams.
[0188] Wherein, the main and sub-channel output channels are I2S buses.
[0189] In this embodiment, the framework layer includes a Java layer media player, a Native layer media player, a multi-zone audio stream management module, and a multi-zone mixing strategy module which are connected in sequence;
[0190] The Java layer media player is used to perform software decoding on the audio stream of the Java layer;
[0191] The Native layer media player is used to perform software decoding on the audio stream of the Native layer;
[0192] The multi-zone audio stream management module is used to encapsulate the decoded audio stream and the corresponding attribute information and send them to the multi-zone mixing strategy module, and is also used to save the playback volume of each audio stream;
[0193] After receiving the audio stream (such as PCM data stream) decoded by the Java layer media player and the Native layer media player software, the multi-zone audio stream management module calls the corresponding attribute information according to the audio stream type of the audio stream, encapsulates the audio stream with these attribute information, and sends the encapsulated audio stream to the multi-zone mixing strategy module.
[0194] The multi-zone mixing strategy module is used to manage and calculate the target output volume of each type of audio stream in each zone according to a preset mixing strategy, and update it to the audio stream management module.
[0195] In this embodiment, the audio generated by the multimedia APP, broadcast APP, and VR APP belongs to the Java layer audio, the telephone audio generated by the telephone APP belongs to the Native layer audio, and the audio generated by the radio APP is directly input into the hardware layer.
[0196] The vehicle-mounted multi-zone audio mixing device described in this embodiment is used to run the vehicle-mounted multi-zone audio mixing method described in Example 1, so its working process is not repeated here.
[0197] The above disclosure is only a preferred embodiment of the present invention, which cannot be used to limit the scope of protection of the present invention. Therefore, equivalent changes made according to the scope of the patent application of the present invention are still within the scope covered by the present invention.
Claims
1. A vehicle-mounted multi-zone mixing method, characterized in that: include: Step S0, initializing the system, dividing the vehicle system into a preset number of audio zones, configuring a main channel and / or a secondary channel for each audio zone, and setting the output volume of the secondary channel of each audio zone according to the pre-amplifier volume of each audio zone in the framework layer; Step S1, obtaining the target audio stream type and corresponding attribute information; Step S2, calculating the target output volume of each target audio stream type in each audio zone according to the mixing instruction and the attribute information; Step S3: outputting the mixed audio stream data of each audio zone through the sound output channel of the corresponding audio zone.
2. The vehicle-mounted multi-zone mixing method according to claim 1, characterized in that: The step S2 comprises: Step S21, judging the audio zone and channel of the current audio stream type according to the attribute information, if the channel is a primary channel, proceeding to step S22, if the channel is a secondary channel, proceeding to step S23; Step S22, determining whether the current audio stream type has the highest priority among the audio stream types being played in all audio zones, if yes, setting the main channel output volume of the current audio zone to the front volume of the current audio stream type, otherwise executing the first multi-zone mixing strategy; Step S23, traversing all audio stream types in the current audio zone whose audio priority is lower than the current audio stream type, and executing a second multi-audio zone mixing strategy; Step S24, traverse all the audio zones whose audio zone priorities are lower than the current audio zone, and execute the third multi-audio zone mixing strategy.
3. The vehicle-mounted multi-zone mixing method according to claim 2, characterized in that: The first multi-zone mixing strategy includes: Step A1, obtaining a first audio stream type set, determining the smallest of the depression ratios of all audio stream types in the first audio stream type set to the current audio stream type as a first minimum depression ratio, determining the audio stream type corresponding to the first minimum depression ratio as a first characteristic audio stream element, and the first audio stream type set is a set of all audio stream types being played in the current audio zone and having a higher priority than the current audio stream type; Step A2, obtaining a preset number of second audio stream type sets, determining the smallest of the suppression ratios of all audio stream types in each second audio stream type set to the current audio stream type as the corresponding second minimum suppression ratio, determining the audio stream type corresponding to the second minimum suppression ratio as the second characteristic audio stream element, and the second audio stream type set is a set of all audio stream types being played in each audio zone except the current audio zone; Step A3, obtaining the suppression ratio coefficient of each other sound zone to the current sound zone; Step A4, determining a final compression ratio for the current audio stream type and a minimum audio stream type corresponding to the final compression ratio according to the first minimum compression ratio, the second minimum compression ratio, and the compression ratio coefficient; Step A5, determine whether the final compression ratio is 100%, if so, set the main channel output volume of the current sound zone to the pre-volume of the current audio stream type, otherwise determine the main channel output volume of the current sound zone according to the final compression ratio and the current volume of the lowest ratio audio stream type.
4. The vehicle-mounted multi-zone mixing method according to claim 3, characterized in that: The final depression ratio is determined according to a first preset relationship, which is: final_ratio1=min(OtherZoneRatio(1)*min_ratio_zone_1, OtherZoneRatio(2)*min_ratio_zone_2, OtherZoneRatio(3)*min_ratio_zone_3, …… OtherZoneRatio(n)*min_ratio_zone_n, min_ratio_my_zone_n); Among them, OtherZoneRatio(k) (k=1,2,3...n) represents the suppression ratio of other zones with serial number k to the current zone. If the zone priority of other zone k is lower than that of the current zone, OtherZoneRatio(k) is 100%; min_ratio_zone_k (k=1,2,3...n) represents the second minimum suppression ratio corresponding to other zones with serial number k; min_ratio_my_zone_1 represents the first minimum suppression ratio; min() function represents the calculation of the minimum value of all parameters; The output volume of the main channel of the current audio zone is determined according to the second preset relationship: minSrcStreamVol=floor(final_ratio1*FinalTopStreamCurrentVol) Among them, minSrcStreamVol represents the main channel output volume of the current sound zone, final_ratio1 represents the final compression ratio, FinalTopStreamCurrentVol represents the current volume of the lowest ratio audio stream type, and floor() represents the rounding down function.
5. The vehicle-mounted multi-zone mixing method according to claim 2, characterized in that: The second multi-zone mixing strategy includes: Step B1, obtaining a third audio stream type set, where the third audio stream type set is a set of all audio stream types in the current audio zone whose priority is lower than the current audio stream type; Step B2: Execute a corresponding mixing strategy according to the output channels corresponding to the third audio stream type set.
6. The vehicle-mounted multi-zone mixing method according to claim 5, characterized in that: When the channel where the third audio stream type set is located is the main channel, step B2 includes: Step B201, determining whether an audio stream type in the third audio stream type set is being played, if yes, determining the smallest depression ratio of the current audio stream type to all audio stream types in the third audio stream type set as a third minimum depression ratio and executing the next step, otherwise executing step B205; Step B202, determining whether the third minimum compression ratio is 100%, if yes, exiting the current volume adjustment, otherwise calculating the first multi-zone mixing strategy volume according to the third minimum compression ratio and the current volume of the third audio stream type; Step B203, determining whether the volume of the first multi-zone mixing strategy is lower than the rear volume of the main channel of the current zone, if yes, setting the output volume of the main channel of the current zone to the first multi-zone mixing strategy volume, otherwise exiting the current volume adjustment; Step B204, determining whether only the third audio stream type is in a playing state in the main channel of the current audio zone, if yes, obtaining the media audio reduction ratio and proceeding to the next step, otherwise exiting the current volume adjustment; the media audio reduction ratio is the reduction ratio of the current audio stream type to the media audio stream type; Step B205, calculating the mixing strategy volume of the main channel after mixing according to the media audio compression ratio and the current volume of the current audio stream type and executing the next step, otherwise directly exiting; Step B206, determining whether the main channel mixing strategy volume in the current audio zone is less than the current volume of the media audio stream type and the media audio compression ratio is not 100%, if yes, setting the main channel output volume to the main channel mixing strategy volume, otherwise exiting this volume adjustment; The volume of the first multi-zone mixing strategy is determined according to a third preset relationship: minMyZoneMainChannelVol=floor(min_ratio_my_zone_2*destMyZoneStreamCurrentVol) Wherein, minMyZoneMainChannelVol represents the volume of the first multi-zone mixing strategy, min_ratio_my_zone_2 represents the third minimum suppression ratio, destMyZoneStreamCurrentVol represents the current volume of the third audio stream type, and floor() represents the rounding down function; The main channel mixing strategy volume is calculated according to the fourth preset relationship: minMyZoneMusicVol=floor(musicRatio*srcMyZoneStreamCurVol) Among them, minMyZoneMusicVol represents the main channel mixing strategy volume, musicRatio represents the media audio compression ratio, srcMyZoneStreamCurVol represents the current volume of the current audio stream type, and floor() represents the rounding down function.
7. The vehicle-mounted multi-zone mixing method according to claim 5, characterized in that: When the channel where the third audio stream type is located is a secondary channel, the step B2 includes: Step B211, obtaining a fourth compression ratio, where the fourth compression ratio is a compression ratio of the current audio stream type to the third audio stream type; Step B212: Calculate the volume of the second multi-zone mixing strategy after mixing according to the fourth compression ratio and the current volume of the current audio stream type. Step B213, determining whether the second multi-zone mixing strategy volume is less than the current front volume of the third audio stream type, if yes, setting the second multi-zone mixing strategy volume to the front volume of the third audio stream type, otherwise exiting the current volume adjustment; The volume of the second multi-zone mixing strategy is calculated according to the fifth preset relationship: minMyZoneDestStreamVol= floor(destMyZoneStreamRatio*srcMyZoneStreamCurVol) Among them, minMyZoneDestStreamVol represents the volume of the second multi-zone mixing strategy, destMyZoneStreamRatio represents the fourth compression ratio, srcMyZoneStreamCurVol represents the current volume of the current audio stream type, and floor() represents the rounding down function.
8. The vehicle-mounted multi-zone mixing method according to claim 2, characterized in that: The third multi-zone mixing strategy includes: Step C1, obtaining a preset number of fourth audio stream type sets, where the fourth audio stream type set is a set of all audio stream types of other audio zones whose audio zone priority is lower than that of the current audio zone; Step C2, obtaining the ratio coefficient of each audio zone having a lower priority than the current audio zone to suppress the current audio zone; Step C3, judging whether the depression ratio coefficient is 100%, if yes, exiting the current volume adjustment, otherwise proceeding to the next step; Step C4, mixing the volumes of all audio stream types in the fourth audio stream type set according to the reduction ratio coefficient; The step C4 comprises: calculating the volume of all audio stream types in the fourth audio stream type set after mixing according to a sixth preset relationship: OtherZoneDestStreamVol(k)=floor(SrcStreamVol*OtherZoneRatio(k)) Among them, OtherZoneDestStreamVol(k) (k=1,2,3…n) represents the volume of the sound zone with a lower priority than the current sound zone and a sequence number k after mixing processing, SrcStreamVol is the volume of the currently playing audio stream type, OtherZoneRatio(k) represents the compression ratio of other sound zones with a sequence number k to the current sound zone, and floor() represents the rounding down function.
9. A vehicle-mounted multi-zone audio mixing device, characterized in that: include: Application layer, framework layer, driver layer and hardware layer; The application layer includes a number of APP applications set in multiple audio zones, which are used to initiate the action of playing audio and video, and also includes a setting APP for setting the volume of the audio stream of each audio zone; The framework layer is used to obtain and manage multiple audio streams from the APP applications in each audio zone according to the preset mixing strategy, and determine the target output volume of each audio zone; The driver layer includes an audio driver module, which is used to respond to the target volume output by the framework layer and complete the playback and / or volume control of the audio stream; The hardware layer includes the main and sub-channel output channels of each audio zone and the DSP module, which is used to process and output multiple mixed audio streams.
10. The vehicle-mounted multi-zone audio mixing device according to claim 9, characterized in that: The framework layer includes a Java layer media player, a Native layer media player, a multi-zone audio stream management module, and a multi-zone mixing strategy module which are connected in sequence; The Java layer media player is used to perform software decoding on the audio stream of the Java layer; The Native layer media player is used to perform software decoding on the audio stream of the Native layer; The multi-zone audio stream management module is used to encapsulate the decoded audio stream and the corresponding attribute information and send them to the multi-zone mixing strategy module, and is also used to save the playback volume of each audio stream; The multi-zone mixing strategy module is used to manage and calculate the target output volume of each type of audio stream in each zone according to a preset mixing strategy, and update it to the audio stream management module.