Audio processing method and device, storage medium and server

CN115695392BActive Publication Date: 2026-10-30HUNAN HAPPLY SUNSHINE INTERACTIVE ENTERTAINMENT MEDIA CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211346620.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-31
Publication Date
2026-10-30
Estimated Expiration
2042-10-31

AI Technical Summary

Technical Problem

[0003]然而,利用WebRTC将背景音乐和游戏声音下发到终端,背景音乐与游戏声音需要分别传输,从而会占用终端的网络带宽,并且,终端在接收到背景音乐和游戏声音后还需进行混音处理,还会额外占用终端的系统资源,如此一来,终端就需要增加大量资源成本(包括带宽和系统资源),实现云游戏的背景音乐和游戏声音的混合播放

Benefits of technology

[0047]本申请提供的技术方案,对用户选定的背景音乐进行解析,得到字节流以及字节流信息。基于字节流以及字节流信息,获得解码数据。使用重采样器对解码数据进行重采样,得到目标背景音频。对正在运行的云游戏进行录音,得到游戏音频。对游戏音频进行降噪优化,得到目标游戏音频。基于目标背景音频和目标游戏音频,生成目标音源。将目标音源发送给终端,以使终端播放目标音源。本申请基于目标背景音频以及目标游戏音频,生成目标音源,再将目标音源发送给终端进行播放,相较于现有技术,无需为背景音乐和游戏声音额外增加新的数据传输通道,终端也无需参与混音处理流程,从而能够在不增加终端的资源成本的情况下,实现背景音乐与游戏声的混合播放。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115695392B_ABST
    Figure CN115695392B_ABST
Patent Text Reader

Abstract

The application discloses an audio processing method and device, a storage medium and a server. The method comprises the following steps: analyzing user-selected background music to obtain a byte stream and byte stream information; obtaining decoding data based on the byte stream and the byte stream information; using a resampler to resample the decoding data to obtain target background audio; recording a running cloud game to obtain game audio; performing noise reduction optimization on the game audio to obtain target game audio; generating a target sound source based on the target background audio and the target game audio; and sending the target sound source to a terminal to enable the terminal to play the target sound source. Compared with the prior art, the method does not need to additionally increase a new data transmission channel for the background music and the game sound, and the terminal also does not need to participate in the sound mixing process, so that the mixed playing of the background music and the game sound can be realized without increasing the resource cost of the terminal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of streaming media technology, and in particular to an audio processing method, apparatus, storage medium, and server. Background Technology

[0002] Cloud gaming involves running games on cloud servers, where the rendered game footage is compressed, encoded, and then transmitted to mobile users over the network. This method frees users' mobile devices from reliance on high-end hardware, significantly reducing the cost of playing games. However, most users want background music to play while gaming. Current mobile operating systems do not support simultaneous playback of multiple audio sources in mono mode, nor can they provide intelligent background music playback (i.e., intelligently selecting, switching, and adjusting tracks based on the current game progress). Therefore, game developers typically utilize Web Real-Time Communications (WebRTC) to send background music and game audio to the terminal, where the audio is mixed before being played back.

[0003] However, using WebRTC to send background music and game sounds to the terminal requires transmitting them separately, which consumes the terminal's network bandwidth. Furthermore, the terminal needs to perform mixing processing after receiving the background music and game sounds, which also consumes additional system resources. As a result, the terminal needs to increase its resource costs (including bandwidth and system resources) to achieve the mixed playback of background music and game sounds in cloud gaming. Summary of the Invention

[0004] This application provides an audio processing method, apparatus, storage medium, and server for achieving mixed playback of background music and game sounds without increasing the resource cost of the terminal.

[0005] To achieve the above objectives, this application provides the following technical solution:

[0006] An audio processing method, applied to a server, includes:

[0007] The background music selected by the user is parsed to obtain a byte stream and byte stream information;

[0008] Based on the byte stream and the byte stream information, decoded data is obtained;

[0009] The decoded data is resampled using a resampler to obtain the target background audio; the resampler is generated based on the audio parameters preset by the user.

[0010] Record the audio of a running cloud game to obtain the game audio;

[0011] The game audio is denoised and optimized to obtain the target game audio;

[0012] Based on the target background audio and the target game audio, a target sound source is generated;

[0013] The target audio source is sent to the terminal so that the terminal plays the target audio source.

[0014] Optionally, the byte stream includes multiple audio data packets and the transmission order of each audio data packet;

[0015] The process of obtaining decoded data based on the byte stream and the byte stream information includes:

[0016] Read the byte stream information to obtain the stream ID and decoding method of the byte stream;

[0017] Initialize the decoder based on the stream ID and the decoding method;

[0018] The audio data packets are sent to the decoder in the order of transmission from first to last, so that the decoder can decode each audio data packet to obtain each audio frame;

[0019] Based on each of the audio frames, decoded data is obtained.

[0020] Optionally, obtaining decoded data based on each of the audio frames includes:

[0021] Each audio frame is written into a preset queue in the order of decoding from first to last.

[0022] According to the order in which each audio frame is in the preset queue, each audio frame is read sequentially to obtain decoded data.

[0023] Optionally, after resampling the decoded data using a resampler to obtain the target background audio, the method further includes:

[0024] Delete the resampler.

[0025] Optionally, generating the target sound source based on the target background audio and the target game audio includes:

[0026] Obtain the bandwidth used by the cloud game, as well as the network bandwidth of the terminal;

[0027] If the bandwidth occupied by the cloud game is less than the network bandwidth of the terminal, the memory size with the larger value between the memory size of the target background audio and the memory size of the target game audio is selected as the target data length.

[0028] An array is generated based on the target data length and the preset number of audio tracks;

[0029] Using a preset sampling point size as the unit, the target background audio and the target game audio are added to the array to obtain the target array;

[0030] The target array is parsed to obtain a multi-channel audio source, and the multi-channel audio source is encoded to obtain the target audio source.

[0031] Optionally, after obtaining the bandwidth occupied by the cloud game and the network bandwidth of the terminal, the method further includes:

[0032] When the bandwidth occupied by the cloud game is not less than the network bandwidth of the terminal, the target background audio and the target game audio are linearly superimposed to obtain mixed audio.

[0033] The average value of the mixed audio is written into a mono track to obtain a mono audio source, and the mono audio source is encoded to obtain the target audio source.

[0034] An audio processing device, comprising:

[0035] The parsing unit is used to parse the background music selected by the user to obtain the byte stream and byte stream information;

[0036] A decoding unit is used to obtain decoded data based on the byte stream and the byte stream information;

[0037] A resampling unit is used to resample the decoded data using a resampler to obtain the target background audio; the resampler is generated based on the audio parameters preset by the user.

[0038] The recording unit is used to record the running cloud game to obtain the game audio;

[0039] The optimization unit is used to perform noise reduction optimization on the game audio to obtain the target game audio;

[0040] A mixing unit is used to generate a target sound source based on the target background audio and the target game audio;

[0041] A sending unit is used to send the target audio source to a terminal so that the terminal can play the target audio source.

[0042] Optional, also includes:

[0043] The deletion unit is used to delete the resampler.

[0044] A computer-readable storage medium comprising a stored program, wherein the program is executed by a processor to perform the audio processing method.

[0045] A server includes: a processor, a memory, and a bus; the processor and the memory are connected via the bus.

[0046] The memory is used to store a program, and the processor is used to run the program, wherein the program is executed by the processor to perform the audio processing method.

[0047] The technical solution provided in this application parses the background music selected by the user to obtain a byte stream and byte stream information. Based on the byte stream and byte stream information, decoded data is obtained. The decoded data is resampled using a resampler to obtain the target background audio. A running cloud game is recorded to obtain game audio. The game audio is denoised and optimized to obtain the target game audio. A target sound source is generated based on the target background audio and the target game audio. The target sound source is sent to the terminal so that the terminal can play the target sound source. This application generates a target sound source based on the target background audio and the target game audio, and then sends the target sound source to the terminal for playback. Compared with existing technologies, this method does not require adding a new data transmission channel for background music and game sounds, and the terminal does not need to participate in the mixing process. Therefore, it can achieve mixed playback of background music and game sounds without increasing the terminal's resource costs. Attached Figure Description

[0048] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0049] Figure 1a A flowchart illustrating an audio processing method provided in an embodiment of this application;

[0050] Figure 1b A flowchart illustrating an audio processing method provided in an embodiment of this application;

[0051] Figure 2 A flowchart illustrating another audio processing method provided in an embodiment of this application;

[0052] Figure 3 This is a schematic diagram of the architecture of an audio processing device provided in an embodiment of this application. Detailed Implementation

[0053] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0054] like Figure 1a and Figure 1b The diagram shown is a flowchart of an audio processing method provided in an embodiment of this application, applied in a server (e.g., a cloud server), and includes the following steps.

[0055] S101: Parse the background music selected by the user to obtain the byte stream and byte stream information.

[0056] In cloud gaming, the background music selected by the user is usually an audio file. This audio file is typically transmitted from the server to the user's terminal using WebRTC. To facilitate data transmission, the audio file is usually transmitted in the form of a byte stream, which includes multiple audio data packets and the transmission order of each audio data packet.

[0057] It should be noted that byte streams occupy a large amount of memory. When using WebRTC to transmit byte streams, servers usually split the byte stream and package it into multiple audio data packets for transmission to avoid data loss.

[0058] S102: Read byte stream information to obtain the stream ID and decoding method of the byte stream.

[0059] S103: Initialize the decoder based on the stream ID and decoding method.

[0060] The decoder includes, but is not limited to, FFmpeg.

[0061] S104: Generates a resampler based on user-defined audio parameters.

[0062] The audio parameters include, but are not limited to, sampling rate, sample size, number of channels, and sample format.

[0063] S105: In the order of transmission from first to last, send each audio data packet to the decoder so that the decoder can decode each audio data packet to obtain each audio frame.

[0064] The reason for sending each audio data packet to the decoder in the order of transmission is to avoid the decoder losing audio data packets.

[0065] S106: Write each audio frame into a preset queue in the order of decoding from first to last.

[0066] S107: Read each audio frame sequentially according to its position in the preset queue to obtain the decoded data.

[0067] S108: Use a resampler to resample the decoded data to obtain the target background audio.

[0068] The audio parameters of the target background audio are consistent with the audio parameters preset by the user.

[0069] It's important to note that decoding individual audio data packets using a decoder essentially means decoding the audio file itself. However, different audio files have different audio formats (different audio formats result in different audio parameters), leading to different decoded data and discrepancies between the decoded data and the original audio file's audio parameters. Furthermore, subsequent operations using the decoded data will incur additional work due to these differences in audio parameters (e.g., standardizing the audio format). Therefore, using a resampler to resample the decoded data yields target background audio with audio parameters consistent with the user's preset parameters, effectively reducing subsequent workload.

[0070] S109: Remove decoder and resampler.

[0071] In this process, after obtaining the target background audio, the decoder and resampler are deleted to avoid memory usage (the decoder and resampler consume memory).

[0072] S110: Records the audio of a running cloud game to obtain game audio.

[0073] One method is to use a recording tool to record audio of the running cloud game. Specifically, if the cloud game's operating system is Android, the built-in Audio Recorder in Android can be used to record the game audio.

[0074] S111: Perform noise reduction and optimization on the game audio to obtain the target game audio.

[0075] One aspect of noise reduction and optimization for game audio is to achieve high-quality game audio. Generally speaking,

[0076] S112: Determine whether the bandwidth used by cloud gaming is less than the network bandwidth of the terminal.

[0077] If the bandwidth used by the cloud game is less than the network bandwidth of the terminal, then the cloud game is in a good network environment and S113 can be executed; otherwise, the cloud game is in a poor network environment and S117 should be executed.

[0078] The bandwidth used by cloud gaming includes the bandwidth occupied by the video stream bitrate, the bandwidth occupied by redundant information in cloud gaming, and the bandwidth occupied by the target background audio (usually the sum of sampling rate × sampling point size × dual audio tracks).

[0079] It should be noted that the bandwidth occupied by the video stream bitrate, the bandwidth occupied by the cloud gaming redundancy information, the bandwidth occupied by the target background audio, and the network bandwidth of the terminal are all information collected by the server in real time.

[0080] S113: Select the memory size with the largest value from the memory size of the target background audio and the memory size of the target game audio, and use it as the target data length.

[0081] S114: Generate an array based on the target data length and the preset number of audio tracks.

[0082] The number of preset audio tracks can be set to 2.

[0083] S115: Using the preset sampling point size as the unit, add the target background audio and the target game audio to the array to obtain the target array.

[0084] S116: Parse the target array to obtain a multi-channel audio source, and encode the multi-channel audio source to obtain the target audio source.

[0085] After executing S116, continue executing S119.

[0086] The target array is parsed to obtain a multi-channel audio source, whose audio track is a stereo surround sound track.

[0087] S117: Linearly superimpose the target background audio and the target game audio to obtain a mixed audio.

[0088] The linear superposition of two audio files is common knowledge familiar to those skilled in the art, and will not be elaborated upon here.

[0089] S118: Write the average value of the mixed audio to a mono track to obtain a mono audio source, and encode the mono audio source to obtain the target audio source.

[0090] After executing S118, continue executing S119.

[0091] S119: Send the target audio source to the terminal so that the terminal can play the target audio source.

[0092] Among them, multi-channel audio sources do not suffer from audio data loss compared to mono audio sources and can perfectly present sound. However, due to the addition of an extra channel, the amount of data that needs to be transmitted will also increase accordingly.

[0093] In summary, this embodiment generates a target sound source based on the target background audio and the target game audio, and then sends the target sound source to the terminal for playback. Compared with the prior art, there is no need to add a new data transmission channel for the background music and game sound, and the terminal does not need to participate in the mixing process. Thus, the mixed playback of background music and game sound can be achieved without increasing the terminal's resource costs.

[0094] It should be noted that S102 mentioned in the above embodiments is an optional implementation of the audio processing method shown in the embodiments of this application. Furthermore, S110 mentioned in the above embodiments is also an optional implementation of the audio processing method shown in the embodiments of this application. Therefore, the process mentioned in the above embodiments can be summarized as follows: Figure 2 The method shown.

[0095] like Figure 2 The diagram shown is a flowchart of another audio processing method provided in an embodiment of this application, including the following steps.

[0096] S201: Parse the background music selected by the user to obtain the byte stream and byte stream information.

[0097] S202: Obtain decoded data based on the byte stream and byte stream information.

[0098] S203: Use a resampler to resample the decoded data to obtain the target background audio.

[0099] The resampler is generated based on user-defined audio parameters.

[0100] S204: Record the audio of a running cloud game to obtain the game audio.

[0101] S205: Perform noise reduction and optimization on the game audio to obtain the target game audio.

[0102] S206: Generate the target sound source based on the target background audio and the target game audio.

[0103] S207: Send the target audio source to the terminal so that the terminal can play the target audio source.

[0104] In summary, this embodiment generates a target sound source based on the target background audio and the target game audio, and then sends the target sound source to the terminal for playback. Compared with the prior art, there is no need to add a new data transmission channel for the background music and game sound, and the terminal does not need to participate in the mixing process. Thus, the mixed playback of background music and game sound can be achieved without increasing the terminal's resource costs.

[0105] Corresponding to the audio processing method provided in the above embodiments of this application, the embodiments of this application also provide an audio processing device.

[0106] like Figure 3 The diagram shown is an architectural schematic of an audio processing device provided in an embodiment of this application, including the following units.

[0107] The parsing unit 100 is used to parse the background music selected by the user to obtain the byte stream and byte stream information.

[0108] Decoding unit 200 is used to obtain decoded data based on byte stream and byte stream information.

[0109] Optionally, the byte stream includes multiple audio data packets and the transmission order of each audio data packet.

[0110] The decoding unit 200 is specifically used for: reading byte stream information to obtain the stream ID and decoding method of the byte stream; initializing the decoder based on the stream ID and decoding method; sending each audio data packet to the decoder in the order of transmission from first to last, so that the decoder can decode each audio data packet to obtain each audio frame; and obtaining the decoded data based on each audio frame.

[0111] The decoding unit 200 is specifically used to: write each audio frame into a preset queue in the order of decoding from first to last; and read each audio frame in sequence according to the order in which each audio frame is in the preset queue to obtain the decoded data.

[0112] The resampling unit 300 is used to resample the decoded data using a resampler to obtain the target background audio; the resampler is generated based on audio parameters preset by the user.

[0113] Deletion unit 400 is used to delete the resampler.

[0114] The recording unit 500 is used to record the running cloud game to obtain the game audio.

[0115] The optimization unit 600 is used to perform noise reduction optimization on the game audio to obtain the target game audio.

[0116] Mixing unit 700 is used to generate a target sound source based on the target background audio and the target game audio.

[0117] Optionally, the mixing unit 700 is specifically used for: obtaining the bandwidth occupied by the cloud game and the network bandwidth of the terminal; when the bandwidth occupied by the cloud game is less than the network bandwidth of the terminal, selecting the memory size with the larger value from the memory size of the target background audio and the memory size of the target game audio as the target data length; generating an array based on the target data length and the preset number of audio tracks; adding the target background audio and the target game audio to the array using a preset sampling point size as the unit to obtain the target array; parsing the target array to obtain the multi-channel audio source, and encoding the multi-channel audio source to obtain the target audio source.

[0118] The mixing unit 700 is also used to: linearly superimpose the target background audio and the target game audio to obtain a mixed audio, provided that the bandwidth occupied by the cloud game is not less than the network bandwidth of the terminal; write the average value of the mixed audio into a mono track to obtain a mono audio source, and encode the mono audio source to obtain the target audio source.

[0119] The sending unit 800 is used to send the target audio source to the terminal so that the terminal can play the target audio source.

[0120] In summary, this embodiment generates a target sound source based on the target background audio and the target game audio, and then sends the target sound source to the terminal for playback. Compared with the prior art, there is no need to add a new data transmission channel for the background music and game sound, and the terminal does not need to participate in the mixing process. Thus, the mixed playback of background music and game sound can be achieved without increasing the terminal's resource costs.

[0121] This application also provides a computer-readable storage medium including a stored program, wherein the program executes the audio processing method provided in this application.

[0122] This application also provides a server, including a processor, a memory, and a bus. The processor and the memory are connected via the bus. The memory is used to store a program, and the processor is used to run the program. When the program runs, it executes the audio processing method provided in this application, including the following steps:

[0123] The background music selected by the user is parsed to obtain a byte stream and byte stream information;

[0124] Based on the byte stream and the byte stream information, decoded data is obtained;

[0125] The decoded data is resampled using a resampler to obtain the target background audio; the resampler is generated based on the audio parameters preset by the user.

[0126] Record the audio of a running cloud game to obtain the game audio;

[0127] The game audio is denoised and optimized to obtain the target game audio;

[0128] Based on the target background audio and the target game audio, a target sound source is generated;

[0129] The target audio source is sent to the terminal so that the terminal plays the target audio source.

[0130] Optionally, the byte stream includes multiple audio data packets and the transmission order of each audio data packet;

[0131] The process of obtaining decoded data based on the byte stream and the byte stream information includes:

[0132] Read the byte stream information to obtain the stream ID and decoding method of the byte stream;

[0133] Initialize the decoder based on the stream ID and the decoding method;

[0134] The audio data packets are sent to the decoder in the order of transmission from first to last, so that the decoder can decode each audio data packet to obtain each audio frame;

[0135] Based on each of the audio frames, decoded data is obtained.

[0136] Optionally, obtaining decoded data based on each of the audio frames includes:

[0137] Each audio frame is written into a preset queue in the order of decoding from first to last.

[0138] According to the order in which each audio frame is in the preset queue, each audio frame is read sequentially to obtain decoded data.

[0139] Optionally, after resampling the decoded data using a resampler to obtain the target background audio, the method further includes:

[0140] Delete the resampler.

[0141] Optionally, generating the target sound source based on the target background audio and the target game audio includes:

[0142] Obtain the bandwidth used by the cloud game, as well as the network bandwidth of the terminal;

[0143] If the bandwidth occupied by the cloud game is less than the network bandwidth of the terminal, the memory size with the larger value between the memory size of the target background audio and the memory size of the target game audio is selected as the target data length.

[0144] An array is generated based on the target data length and the preset number of audio tracks;

[0145] Using a preset sampling point size as the unit, the target background audio and the target game audio are added to the array to obtain the target array;

[0146] The target array is parsed to obtain a multi-channel audio source, and the multi-channel audio source is encoded to obtain the target audio source.

[0147] Optionally, after obtaining the bandwidth occupied by the cloud game and the network bandwidth of the terminal, the method further includes:

[0148] When the bandwidth occupied by the cloud game is not less than the network bandwidth of the terminal, the target background audio and the target game audio are linearly superimposed to obtain mixed audio.

[0149] The average value of the mixed audio is written into a mono track to obtain a mono audio source, and the mono audio source is encoded to obtain the target audio source.

[0150] If the functions described in the embodiments of this application are implemented as software functional units and sold or used as independent products, they can be stored in a computing device readable storage medium. Based on this understanding, the parts of the embodiments of this application that contribute to the prior art or the technical solutions can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a computing device (which may be a personal computer, server, mobile computing device, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory, random access memory, magnetic disks, or optical disks.

[0151] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0152] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. An audio processing method, characterized in that, Applied to servers, including: The background music selected by the user is parsed to obtain a byte stream and byte stream information; Based on the byte stream and the byte stream information, decoded data is obtained; The decoded data is resampled using a resampler to obtain the target background audio; the resampler is generated based on the audio parameters preset by the user. Record audio of a running cloud game to obtain the game audio generated internally during the cloud game's operation; The game audio is denoised and optimized to obtain the target game audio; The bandwidth used by the cloud game and the network bandwidth of the terminal are obtained in real time. If the bandwidth occupied by the cloud game is less than the network bandwidth of the terminal, the memory size with the larger value between the memory size of the target background audio and the memory size of the target game audio is selected as the target data length. An array is generated based on the target data length and the preset number of audio tracks; Using a preset sampling point size as the unit, the target background audio and the target game audio are added to the array to obtain the target array; The target array is parsed to obtain a multi-channel audio source, and the multi-channel audio source is encoded to obtain the target audio source; The target audio source is sent to the terminal so that the terminal can play the target audio source.

2. The method according to claim 1, characterized in that, The byte stream includes multiple audio data packets and the transmission order of each audio data packet; The process of obtaining decoded data based on the byte stream and the byte stream information includes: Read the byte stream information to obtain the stream ID and decoding method of the byte stream; Initialize the decoder based on the stream ID and the decoding method; The audio data packets are sent to the decoder in the order of transmission from first to last, so that the decoder can decode each audio data packet to obtain each audio frame; Based on each of the audio frames, decoded data is obtained.

3. The method according to claim 2, characterized in that, The process of obtaining decoded data based on each of the audio frames includes: Each audio frame is written into a preset queue in the order of decoding from first to last. According to the order in which each audio frame is in the preset queue, each audio frame is read sequentially to obtain decoded data.

4. The method according to claim 1, characterized in that, After resampling the decoded data using a resampler to obtain the target background audio, the process further includes: Delete the resampler.

5. The method according to claim 1, characterized in that, After obtaining the bandwidth used by the cloud game and the network bandwidth of the terminal, the method further includes: When the bandwidth occupied by the cloud game is not less than the network bandwidth of the terminal, the target background audio and the target game audio are linearly superimposed to obtain mixed audio. The average value of the mixed audio is written into a mono track to obtain a mono audio source, and the mono audio source is encoded to obtain the target audio source.

6. An audio processing apparatus, characterized in that, include: The parsing unit is used to parse the background music selected by the user to obtain the byte stream and byte stream information; A decoding unit is used to obtain decoded data based on the byte stream and the byte stream information; A resampling unit is used to resample the decoded data using a resampler to obtain the target background audio; The resampler is generated based on the user-preset audio parameters; The recording unit is used to record the running cloud game to obtain the game audio generated internally by the cloud game during its operation. The optimization unit is used to perform noise reduction optimization on the game audio to obtain the target game audio; A mixing unit is used to generate a target sound source based on the target background audio and the target game audio; A sending unit is configured to send the target audio source to a terminal so that the terminal plays the target audio source; The mixing unit is specifically used to: acquire the bandwidth occupied by the cloud game and the network bandwidth of the terminal in real time; when the bandwidth occupied by the cloud game is less than the network bandwidth of the terminal, select the memory size with the largest value from the memory size of the target background audio and the memory size of the target game audio as the target data length. An array is generated based on the target data length and the preset number of audio tracks; Using a preset sampling point size as the unit, the target background audio and the target game audio are added to the array to obtain the target array; The target array is parsed to obtain a multi-channel audio source, and the multi-channel audio source is encoded to obtain the target audio source.

7. The apparatus according to claim 6, characterized in that, Also includes: A deletion unit is used to delete the resampler.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program is executed by a processor to perform the audio processing method according to any one of claims 1-5.

9. A server, characterized in that, include: Processor, memory, and bus; The processor and the memory are connected via the bus; The memory is used to store a program, and the processor is used to run the program, wherein the program is executed by the processor to perform the audio processing method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Voice transmission method and device, medium and electronic equipment

    CN110025958A

  • Audio data processing method, server and storage medium

    CN111596885A

  • Method and system for dynamically switching single channel and double channels and computer readable storage medium

    CN114040130A