Sound gradual change control method and device in video playing, equipment and medium

The sound output of the video player is controlled through attribute animation, which realizes a smooth transition of volume during video playback, solves the problem of sudden change in volume during video playback, and improves the user experience.

CN119629410APending Publication Date: 2025-03-14CHENGDU CELIS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411771339.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

As the video returns from pause to playback, a sudden change in volume may have an unpleasant effect on the user's hearing, especially in an on-board environment.

Method used

By obtaining the video information of the target video to be played, analyzing and verifying this information, generating a video playback signal, and using attribute animation to control the sound output of the video player, gradually changing from the initial volume to the target volume, or gradually changing from the target volume to the initial volume.

Benefits of technology

It realizes a smooth transition of volume within the preset time period, avoids the discomfort caused by sudden change in volume, and significantly improves the user's experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119629410A_ABST
    Figure CN119629410A_ABST
Patent Text Reader

Abstract

The invention provides a sound gradual change control method and device in video playing, equipment and a medium, and the method comprises the steps: obtaining video information corresponding to a to-be-played target video, carrying out the analysis of the video information, obtaining the target video, playing the target video according to an attribute animation, and enabling the target video to achieve the gradual change when the target video is played. The volume of the attribute animation is gradually increased or decreased within a preset duration, the attribute animation is created based on a pre-configured local variable, and the local variable comprises the preset duration and a linear change value of the volume within the preset duration; according to the method, the sound output of the video is linearly adjusted through the attribute animation, so that transition between the low volume and the volume level preset by the user is smoothly realized, the abrupt volume harsh phenomenon caused by sound abrupt change is effectively avoided, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of intelligent control technology, and in particular to a method, device, equipment and medium for controlling sound gradient in video playback. Background Art

[0002] With the advancement of technology, modern in-vehicle systems generally integrate online video or local video playback functions, which allow users to enjoy multimedia content in the vehicle. Usually, video playback has basic play and pause operations. However, in actual use, when the video resumes from the paused state to the play state, if the volume is set high and the user is not aware of this in advance, then this sudden change in sound may have an uncomfortable effect on the user's hearing.

[0003] Specifically, when the video resumes playing, if the volume is high and the user is not given enough time to adapt, it may cause auditory discomfort or even fright. This problem is particularly prominent in the car environment, because the car environment is relatively closed, the volume change is more obvious, and it may affect the experience of the driver and other passengers. Summary of the invention

[0004] In view of the above-mentioned shortcomings of the prior art, the present application provides a method, device, equipment and medium for controlling sound gradient in video playback to solve the above-mentioned technical problems.

[0005] The present application provides a method for controlling sound gradient in video playback, the method comprising: obtaining video information corresponding to a target video to be played; parsing the video information to obtain a target video; playing the target video according to an attribute animation, so that when the target video is played, its volume gradually increases or decreases within a preset duration; wherein the attribute animation is created based on pre-configured local variables, the local variables comprising the preset duration and a linear change value of the volume within the preset duration.

[0006] In one embodiment of the present application, before playing the target video according to the attribute animation, it also includes: identifying the creation status of the attribute animation according to the attribute variable; wherein, when the value of the attribute variable is empty, the creation status of the attribute animation is determined to be uncreated, and when the value of the attribute variable is not empty, the creation status of the attribute animation is determined to be created; if the creation status of the attribute animation is created, identifying the playback status of the created attribute animation, the playback status includes playing and playback ended; if the playback status of the attribute animation is playing, stopping the attribute animation and clearing the animation record that has been played, the played includes playback stopped and playback ended.

[0007] In one embodiment of the present application, a property animation is created based on preconfigured local variables, including: creating a property animation from an initial value to a final value, and setting the duration of the property animation based on the local variables so that the property value of the property animation changes from the initial value to the final value within the duration; adding an update listener to the created property animation, and the update listener is valid during the execution of the property animation.

[0008] In one embodiment of the present application, after obtaining the video information corresponding to the target video to be played, it also includes: transmitting the video information to a video playback interface, so as to forward the video to be played to a video player based on the video playback interface, and the video player is encapsulated in the video playback interface.

[0009] In one embodiment of the present application, if the content to be played is audio information, it is transmitted to the audio player through the playback interface, specifically including: parsing the audio information to obtain the target audio; playing the target audio according to the attribute animation, so that when the audio video is played, its volume gradually increases or decreases within a preset duration; wherein the attribute animation is created based on a pre-configured local variable, and the local variable includes the preset duration and the linear change value of the volume within the preset duration. In one embodiment of the present application, obtaining the target video to be played includes: obtaining the video information of the video to be played; transmitting the video information to the video playback interface, so as to forward the video to be played to the video player based on the video playback interface, and the video player is encapsulated in the video playback interface.

[0010] In one embodiment of the present application, if the content to be played is audio, it is transmitted to the audio player through the audio interface, which specifically includes: parsing the audio information to obtain the target audio; playing the target audio according to the attribute animation, so that when the phonetic symbol video is played, its volume gradually increases or decreases within a preset duration; wherein the attribute animation is created based on pre-configured local variables, and the local variables include the preset duration and the linear change value of the volume within the preset duration.

[0011] In one embodiment of the present application, after parsing the video information, it also includes: verifying the video information, generating a video playback signal if the verification is successful, and feeding back the video playback signal to the video playback interface; the information verification includes at least one of the following: checking whether the playback address in the video information is valid, if so, it is deemed to have been verified; verifying whether the format in the video information complies with a preset media format standard, if so, it is deemed to have been verified; checking whether the video length in the video information meets a preset duration range, if so, it is deemed to have been verified.

[0012] The present application provides a device for controlling sound gradual change in video playback, the device comprising: a video user interface, for acquiring a target video and transmitting the target video to a video player; a video player, for playing the target video, the video player being encapsulated in the video playback interface; a property animator, for controlling the sound output of the video player to gradually change from an initial volume to a target volume; an update listener, for monitoring changes in volume values ​​within an animation cycle, and transmitting the changed volume values ​​to the video player; wherein the property animator is configured to change the volume value at a predetermined rate within its animation cycle; the video player adjusts its sound output according to the volume value provided by the property animator.

[0013] The present application provides an electronic device, including a processor, a memory and a communication bus; the communication bus is used to connect the processor and the memory; the processor is used to execute a computer program stored in the memory to implement the sound gradient control method in video playback as described above.

[0014] The present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is used to enable a computer to execute the method for controlling sound gradient in video playback as described above.

[0015] Beneficial effects of the present application: The sound gradient control method in video playback proposed in the present application uses attribute animation to linearly adjust the volume output of the video, which can make the volume smoothly transition between a lower volume level and a target volume set by the user, effectively solving the problem of auditory discomfort caused by sudden changes in volume and significantly enhancing the user experience; in addition, the method also allows users to set the specific duration of the gradient process and the volume change rate according to their own preferences, thereby creating a more personalized volume adjustment solution to meet the diverse needs of users.

[0016] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0018] Figure 1 is a schematic diagram of an implementation environment of a method for controlling gradual sound change in video playback shown in an exemplary embodiment of the present application;

[0019] Figure 2 is a flowchart of a method for controlling gradual sound change in video playback shown in an exemplary embodiment of the present application;

[0020] Figure 3 is a schematic diagram of the entire video playback process according to an exemplary embodiment of the present application;

[0021] Figure 4 is a block diagram of a sound gradient control device in video control shown in an exemplary embodiment of the present application;

[0022] Figure 5 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION

[0023] The following will describe the implementation methods of the present application with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific implementation methods, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be understood that the preferred embodiments are only for illustrating the present application, not for limiting the scope of protection of the present application.

[0024] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.

[0025] In the following description, a large number of details are discussed to provide a more thorough explanation of the embodiments of the present application. However, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present application difficult to understand.

[0026] First of all, it should be noted that ValueAnimator: the attribute animation in Android development, it can realize attribute animation effects such as scaling, translation, rotation, etc. Here I use its attribute value change monitoring to continuously control the volume value from 0-1 (or 1-0). Here and below, 0 is equivalent to mute, and 1 is equivalent to the original volume set by the system for multimedia.

[0027] VideoPlayer: Android develops its own player, which can be ExoPlayer, IJKPlayer, or other customized MediaPlayer.

[0028] VideoUI: Video playback interface, including a video presentation interface and button controls on the video, such as play / pause, previous / next, progress bar and other button components.

[0029] Figure 1 It is a schematic diagram of an implementation environment of a method for controlling gradual sound change in video playback shown in an exemplary embodiment of the present application.

[0030] like Figure 1 As shown, the implementation environment diagram of the sound gradient control method in video playback includes a data acquisition device (or interface) 101 and a computer device 102. Among them, the data acquisition device or interface 101 is responsible for collecting original data related to video playback, which includes but is not limited to basic information of the video (such as playback address, title, duration, etc.), user preference information and status information of the playback device. The data acquisition device can be a sensor or interface integrated in the playback device (such as a touch screen, remote control, etc.), or it can be data collected by an external device after being connected to the playback device wirelessly or wired. This application does not impose any restrictions on the specific implementation form of the data acquisition device or interface.

[0031] The computer device 102 is used to process the raw data collected by the data acquisition device or the interface 101, and control the audio output of the video according to the attribute animation, specifically including setting the local variables of the attribute animation, i.e., the preset duration of the attribute animation and the linear change value of the volume within the preset duration, and then controlling the target video to be played according to the attribute animation, so that when the target video is played, its volume is gradually increased or reduced within the preset duration. The computer device 102 can be a high-performance processor, a dedicated video playback computing platform, or an embedded system integrated on a playback device. The present application does not impose any restrictions on the specific type of the computer device either. In this way, the system can provide users with a smooth and comfortable volume transition experience in different playback environments, improve the quality of video playback and user satisfaction.

[0032] Figure 2 It is a flowchart of a method for controlling gradual sound change in video playback, shown as an exemplary embodiment of the present application.

[0033] like Figure 2 As shown, in an exemplary embodiment, the method for controlling the gradual change of sound in video playback includes at least steps S210 to S230, which are described in detail as follows:

[0034] Step S210, obtaining video information corresponding to the target video to be played.

[0035] In one embodiment of the present application, after obtaining the video information corresponding to the target video to be played, it also includes: transmitting the video information to the video playback interface, so as to forward the video to be played to the video player based on the video playback interface, and the video player is encapsulated in the video playback interface.

[0036] In a specific embodiment of the present application, when implementing video playback in an Android application, it is first necessary to obtain the target video information selected by the user from a video list. When the user clicks on a video item in the video list, the application captures key information such as the playback address, title, and duration of the video, which is then encapsulated and passed to a new activity VideoUI, i.e., the video playback interface, through an intent. Once the VideoUI activity is started, it will extract the relevant data of the video from the received intent. Next, VideoUI will initialize a custom video player component VideoPlayer and pass all the previously acquired video information to this player. VideoPlayer is responsible for handling the actual video playback tasks, including setting the media source, preparing the player, and starting to play the video.

[0037] Step S220, parsing the video information to obtain the target video.

[0038] In one embodiment of the present application, after parsing the video information, it also includes: verifying the video information, generating a video playback signal if the verification is successful, and feeding back the video playback signal to the video playback interface; the information verification includes at least one of the following: checking whether the playback address in the video information is valid, if so, it is deemed to have been verified; verifying whether the format in the video information complies with the preset media format standard, if so, it is deemed to have been verified; checking whether the video length in the video information meets the preset duration range, if so, it is deemed to have been verified.

[0039] In a specific embodiment of the present application, in an Android application, when a user selects a video from a video list to play, the system first parses the information of the selected video (such as the playback address, title, and duration). Subsequently, the system performs a series of verification steps on this information to ensure its validity. These verifications include checking whether the playback address of the video is accessible, confirming whether the video format meets the preset media format standard (such as MP4 or AVI), and verifying whether the video duration is within a reasonable range. If all verifications are passed, a video playback signal is generated and the signal is fed back to the video playback interface VideoUI.

[0040] After receiving the video playback signal, VideoUI starts the VideoPlayer component encapsulated inside it and passes the verified video information to it. VideoPlayer configures itself based on this information and starts loading and playing the video content. During the whole process, in order to provide a better user experience, some additional features can be added, such as displaying a loading progress bar or implementing a volume fade-in effect, so that users can perceive that the video is preparing to play and is about to start.

[0041] It can be understood that through strict verification of video information, only valid and standard-compliant videos can be played, reducing playback failures caused by invalid links or incompatible formats; effective information verification avoids unnecessary data processing and network requests, thereby saving computing resources and bandwidth; and it can effectively prevent malicious or damaged video files from entering the playback process, protecting user devices from potential security threats.

[0042] Step S230, playing the target video according to the attribute animation, so that when the target video is played, its volume gradually increases or decreases within a preset duration; wherein the attribute animation is created based on pre-configured local variables, and the local variables include a preset duration and a linear change value of the volume within the preset duration.

[0043] In one embodiment of the present application, a property animation is created based on preconfigured local variables, including: creating a property animation from an initial value to a final value, and setting the duration of the property animation based on the local variables, so that the property value of the property animation changes from the initial value to the final value within the duration; adding an update listener to the created property animation, and the update listener is valid during the execution of the property animation.

[0044] In a specific embodiment of the present application, in an Android application, in order to achieve a smooth fade-in effect of the volume during video playback, a property animation (ValueAnimator) can be created based on a pre-configured local variable. First, use this local variable to create a property animation from an initial value to a final value, for example, from 0 to 1, indicating that the volume gradually increases from silent to maximum. At the same time, set the duration of the animation, such as 500 milliseconds (0.5 seconds), to ensure that the animation completes the change from the initial value to the final value within this period of time. Next, add an update listener to this property animation, which will be continuously called during the execution of the animation. Whenever the current value of the animation changes, the listener will receive the new value and adjust the volume or other related properties in real time accordingly.

[0045] It can be understood that, first of all, by changing the property value linearly or nonlinearly within a certain period of time, property animation can provide a very natural and smooth transition effect, which significantly improves the user experience. Secondly, developers can flexibly set the start value, end value and duration of the animation according to specific needs, and even customize the interpolator to control the change curve of the animation, so as to achieve richer visual effects. In addition, ValueAnimator provides an efficient animation mechanism, which triggers callbacks only when the interface needs to be updated, reducing unnecessary computing overhead and ensuring the smooth operation of the application. This method also makes the code more modular, which is convenient for later maintenance and function expansion. Finally, since ValueAnimator is one of the standard animation APIs provided by the Android system, it has good backward compatibility and can work stably on different versions of Android devices, ensuring the consistency and reliability of the application. In summary, creating and managing property animations based on pre-configured local variables can not only improve the interactive experience of the user interface, but also improve development efficiency and application performance.

[0046] In one embodiment of the present application, before playing the target video according to the attribute animation, it also includes: identifying the creation status of the attribute animation according to the attribute variable; wherein, when the value of the attribute variable is empty, the creation status of the attribute animation is determined to be uncreated, and when the value of the attribute variable is not empty, the creation status of the attribute animation is determined to be created; if the creation status of the attribute animation is created, then identifying the playback status of the created attribute animation, the playback status includes playing and playback ended; if the playback status of the attribute animation is playing, then stopping the attribute animation, and clearing the animation record that has been played, and played includes playback stopped and playback ended.

[0047] In a specific embodiment of the present application, in an Android application, in order to ensure that attribute animations (such as volume fade-in effects) can be correctly created and managed, a series of status checks are required before playing the target video. First, a local variable is defined to store an instance of the attribute animation. When preparing to play the video, the creation status of the attribute animation is identified by checking the value of this local variable: if the variable is empty, it means that the attribute animation has not been created; if the variable is not empty, it means that the attribute animation has been created.

[0048] Once it is confirmed that the property animation has been created, the next step is to further identify the current playback state of the animation. The playback state can be divided into "playing" and "end of playback". By calling a specific method to determine whether the animation is playing. If the animation is found to be playing, the system will immediately stop the current animation and clear the played animation record. Specifically, the operation of stopping the animation includes calling the cancel method to interrupt the execution of the animation, and setting the local variable to null to release memory resources and clear the reference to the old animation.

[0049] Subsequently, the system creates a new property animation. This new animation changes from the initial value to the final value, for example, from 0 to 1, indicating that the volume gradually increases from silent to maximum. The duration of the animation is also set to a fixed value, such as 500 milliseconds (0.5 seconds). Next, add an update listener to the newly created animation, which will be called continuously during the execution of the animation. Whenever the current value of the animation changes, the listener will receive the new value and adjust the volume or other related properties in real time accordingly.

[0050] Finally, the newly created property animation is started and the video begins to play. It is understandable that in this way, it is ensured that each time the video is played, the property animation is a new animation that starts from the beginning, avoiding problems caused by repeated starts or uncleaned animations. This practice not only prevents memory leaks, but also ensures that users can experience a consistent and expected volume fade-in effect every time, thereby improving the user's audio-visual experience and the overall performance of the application. In addition, this approach also enhances the maintainability of the code, making the development and debugging process more efficient.

[0051] In one embodiment of the present application, playing a target video according to an attribute animation includes creating an attribute animation, configuring local variables of the attribute animation, and then synchronously starting the attribute animation when the target video is displayed.

[0052] In a specific embodiment of the present application, playing a target video according to an attribute animation also includes: during the execution of the animation, dynamically obtaining a linear change value from an initial value to a final value; and setting the linear change value as a volume value in an audio player to adjust the volume of the player.

[0053] In a specific embodiment of the present application, in an Android application, in order to achieve a smooth fade-in effect of the volume when playing a video, a property animation (ValueAnimator) can be used to dynamically adjust the volume of the audio player. The specific process is as follows:

[0054] Before preparing to play the target video, first check and process the status of the existing property animation. If there is already a property animation created and playing, stop the animation and clear the record to avoid problems caused by repeated starts or uncleaned animations.

[0055] Next, create a new property animation that changes from an initial value of 0 to a final value of 1, indicating that the volume gradually increases from silent to maximum. Set the duration of the animation to 500 milliseconds (0.5 seconds) to ensure that the change from the initial value to the final value is completed within this time.

[0056] Add an update listener to the newly created property animation. This listener will be called continuously during the animation, and each time the current value of the animation changes, the listener will receive new values. These values ​​are linearly changing between 0 and 1, reflecting the gradual increase in volume.

[0057] In the listener, the received linear change value is set as the volume value in the audio player. The audio player usually provides a setVolume method. By calling this method and passing the linear change value, the volume of the player can be adjusted in real time, thereby achieving a smooth transition of the volume.

[0058] Finally, start the property animation, start playing the video, and gradually increase the volume from silent to maximum. In this way, you can ensure that every time you play a video, the volume can smoothly transition from silent to maximum, providing a natural and smooth audio-visual experience.

[0059] It can be understood that the method proposed based on this implementation not only improves the performance and stability of the application, but also significantly enhances the user experience. Through clear state management and resource release, the code is more robust and easy to maintain; in addition, the smooth volume transition effect makes the video playback more natural and smooth, improving user satisfaction.

[0060] Figure 3 This is a schematic diagram of an exemplary embodiment of the present application showing the entire process of video playback.

[0061] In a specific embodiment of the present application, Figure 3 As shown, when the user clicks on a video as the target video from the video list, the video information of the target video is sent to the video playback interface and the target video player, so that the video information is verified based on the target video player, and after the verification is passed, the video screen is played based on the video playback interface player, and the target animation controller is started at the same time, so as to control the output of the audio information of the target video based on the animation control parameters of the target animation controller, and finally the video screen and the controlled output audio are fed back to the user.

[0062] In a specific embodiment of the present application, when a user clicks a video from a video list as a target video, the system captures the relevant information of the video, including the playback address, title, and duration, and passes this information to the video playback interface VideoUI through an intent. After receiving the video information, VideoUI forwards it to the target video player VideoPlayer encapsulated inside.

[0063] VideoPlayer first verifies the video information, including checking the validity of the playback address to ensure that it can be loaded; verifying whether the video format conforms to the preset media format standard (such as MP4, AVI, etc.); and verifying whether the video length is within a reasonable range (for example, between 10 seconds and 60 minutes). If all verifications pass, VideoPlayer starts preparing to play the video and displays the video screen in VideoUI.

[0064] At the same time, the system creates a property animation (ValueAnimator) and sets it to change from an initial value of 0 to a final value of 1 with a duration of 500 milliseconds. An update listener is added to this property animation, and the listener will continuously receive new linear change values ​​during the animation execution. In the update listener, the received linear change value is set as the volume value to the audio player, thereby achieving a smooth transition of the volume.

[0065] Then, the attribute animation is started and the video screen is played at the same time. As the attribute animation is executed, the volume gradually increases from silent to maximum, and the user can see the video screen and hear the audio with smooth transition processing. Finally, the user can get a natural and smooth audio-visual experience.

[0066] It can be understood that the method proposed in this embodiment not only ensures the validity and compatibility of video information, but also provides a smooth volume fade-in effect, improving the user's audio-visual experience. Therefore, not only the performance and stability of the application are improved, but also the user experience is significantly enhanced, making the video playback more natural and smooth, and improving user satisfaction. In addition, clear state management and resource release also make the code more robust and easy to maintain.

[0067] In addition, if the content to be played is audio information, it is transmitted to the audio player through the audio playback interface, which specifically includes: parsing the audio information to obtain the target audio; playing the target audio according to the attribute animation, so that when the phonetic video is played, its volume gradually increases or decreases within a preset duration; wherein the attribute animation is created based on pre-configured local variables, and the local variables include a preset duration and a linear change value of the volume within the preset duration.

[0068] In a specific embodiment of the present application, when a user clicks an audio file from the audio list, the system captures the relevant information of the audio, including the playback address, title, and duration, and passes this information to the audio playback interface AudioUI through an intent. After receiving the audio information, AudioUI forwards it to the audio player AudioPlayer encapsulated inside.

[0069] AudioPlayer parses the audio information to obtain the specific data of the target audio file. Next, the system creates a property animation (ValueAnimator) to control the gradual increase or decrease of the volume. First, define a local variable mVolumeAnimator to store the instance of the property animation, and set the preset duration to 500 milliseconds (0.5 seconds), indicating the duration of the volume change. Based on this local variable, create a property animation that changes from an initial value of 0 to a final value of 1, with a duration of 500 milliseconds.

[0070] Add an update listener to this property animation. The listener will be called continuously during the animation execution. Whenever the current value of the animation changes, the listener will receive the new linear change value. In the update listener, the received linear change value is set as the volume value to the audio player to achieve a smooth transition of the volume.

[0071] Then, the property animation is started and the target audio is played at the same time. As the property animation is executed, the volume gradually increases from silent to maximum (or gradually decreases from maximum to silent), and the user can hear the effect of smooth volume transition. Ultimately, the user can get a natural and smooth listening experience.

[0072] It can be understood that the method proposed in this example not only ensures the validity and compatibility of audio information, but also provides a smooth volume fade-in or fade-out effect, which improves the user's auditory experience. It not only improves the performance and stability of the application, but also significantly enhances the user experience, making audio playback more natural and smooth, and improving user satisfaction. In addition, clear state management and resource release also make the code more robust and easy to maintain.

[0073] Finally, it should be emphasized that the sound gradient control method in video playback proposed in this application has many beneficial effects, especially in improving user experience and enhancing application performance. Specifically, the method controls the sound gradient of video or audio during playback through attribute animation (ValueAnimator), including the gradual increase of sound when starting to play and the gradual decrease of sound when pausing / stopping playback, and can accurately control the specific duration and change rate of its sound change. The following are the main beneficial effects of the method: First, the volume gradient effect achieved by attribute animation enables users to hear the volume gradually increase from mute to maximum when the video or audio starts to play, and the volume gradually decreases from maximum to mute when pausing or stopping playback. Its smooth transition effect avoids abrupt sound changes and provides a more natural and smooth auditory experience. Second, this method allows developers to set the duration of volume change according to specific needs, such as 500 milliseconds, 1 second, etc. This allows the speed of volume change to be adjusted according to different scenarios to meet different user experience requirements. Third, by checking and clearing old animation instances before creating new attribute animations, memory leaks are prevented. This not only improves the performance of the application, but also extends the battery life of the device. Fourth, the volume gradient logic is encapsulated in the attribute animation, making the code more modular and easy to maintain. If you need to modify or expand the function in the future, you only need to adjust the relevant parts without affecting the overall architecture. In summary, the method proposed in this application controls the sound gradient of video or audio during playback through attribute animation, which not only improves the user experience, but also enhances the performance and stability of the application. By accurately controlling the specific duration and change rate of the volume change, the volume gradient effect is more natural and smooth, thus providing users with a more comfortable and immersive audio-visual experience.

[0074] Figure 4 is a block diagram of a device for controlling the gradual change of sound in video playback, shown in an exemplary embodiment of the present application. The device can be applied to Figure 1 The device may also be applicable to other exemplary implementation environments and specifically configured in other devices, and this embodiment does not limit the implementation environment to which the device is applicable.

[0075] like Figure 4 As shown, the exemplary sound gradient control device in the video control includes: a video user interface 410, a video player 420, a property animator 430, and an update listener 440.

[0076] Among them, the video user interface 410 is used to obtain the target video and transmit the target video to the video player; the video player 420 is used to play the target video, and the video player is encapsulated in the video playback interface; the attribute animator 430 is used to control the sound output of the video player to gradually change from an initial volume to a target volume; the update listener 440 is used to monitor the change of the volume value within the animation cycle and pass the changed volume value to the video player; in addition, the attribute animator is configured to change the volume value at a predetermined rate within its animation cycle; the video player adjusts its sound output according to the volume value provided by the attribute animator.

[0077] It should be noted that the sound gradient control device in video control provided in the above embodiment and the sound gradient control method in video playback provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment, and will not be repeated here. In actual application, the sound gradient control device in video control provided in the above embodiment can allocate the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.

[0078] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the electronic device implements the sound gradient control method in video playback provided in the above-mentioned embodiments.

[0079] Figure 5 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Figure 5 The computer system 500 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0080] like Figure 5As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 502 or the program loaded from the storage part 508 to the random access memory (RAM) 503, such as executing the method described in the above embodiment. In the RAM 503, various programs and data required for system operation are also stored. The CPU 501, the ROM 502 and the RAM 503 are connected to each other through the bus 504. The input / output (I / O) interface 505 is also connected to the bus 504.

[0081] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed so that a computer program read therefrom is installed into the storage section 508 as needed.

[0082] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 509, and / or installed from a removable medium 511. When the computer program is executed by a central processing unit (CPU) 501, various functions defined in the system of the present application are executed.

[0083] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal can take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0084] The flowchart and block diagram in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0085] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0086] Another aspect of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor of a computer, the computer executes the method for controlling the gradual change of sound in video playback as described above. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.

[0087] Another aspect of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the sound gradient control method in video playback provided in the above-mentioned embodiments.

[0088] The above embodiments are merely illustrative of the principles and effects of the present application, and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.

Claims

1. A method for controlling sound gradient in video playback, characterized in that: The method comprises: Obtain video information corresponding to the target video to be played; Parsing the video information to obtain a target video; The target video is played according to the attribute animation so that the volume of the target video gradually increases or decreases within a preset duration when it is played; wherein the attribute animation is created based on preconfigured local variables, and the local variables include the preset duration and a linear change value of the volume within the preset duration.

2. The method for controlling the gradual change of sound in video playback according to claim 1, characterized in that: Before playing the target video according to the attribute animation, the method further includes: Identifying a creation state of the attribute animation according to the attribute variable; Wherein, when the value of the attribute variable is empty, the creation state of the attribute animation is determined to be uncreated, and when the value of the attribute variable is not empty, the creation state of the attribute animation is determined to be created; If the creation state of the attribute animation is created, identifying the play state of the created attribute animation, where the play state includes playing and finished playing; If the playing state of the attribute animation is playing, the attribute animation is stopped, and the played animation record is cleared, where the played includes playing stopped and playing ended.

3. The method for controlling the gradual change of sound in video playback according to claim 2, characterized in that: Create property animations based on pre-configured local variables, including: Creating a property animation from an initial value to a final value, and setting a duration of the property animation based on the local variable, so that the property value of the property animation changes from the initial value to the final value within the duration; Add an update listener to the created property animation. The update listener is valid during the execution of the property animation.

4. The method for controlling the gradual change of sound in video playback according to claim 3, characterized in that: Playing the target video according to the attribute animation includes: During the animation execution, dynamically obtain a linear change value from the initial value to the final value; The linear variation value is set as a volume value in the audio player to adjust the volume of the player.

5. The method for controlling the gradual change of sound in video playback according to claim 1, characterized in that: After obtaining the video information corresponding to the target video to be played, the following steps are also included: The video information is transmitted to a video playback interface, so that the video to be played is forwarded to a video player based on the video playback interface, and the video player is encapsulated in the video playback interface.

6. The method for controlling the gradual change of sound in video playback according to claim 5, characterized in that: If the content to be played is audio information, it is transmitted to the audio player through the audio playback interface, specifically including: Parsing the audio information to obtain target audio; The target audio is played according to the attribute animation so that the volume of the phonetic symbol video gradually increases or decreases within a preset duration when the phonetic symbol video is played; wherein the attribute animation is created based on pre-configured local variables, and the local variables include the preset duration and a linear change value of the volume within the preset duration.

7. The method for controlling the gradual change of sound in video playback according to any one of claims 1 to 6, characterized in that: After parsing the video information, the method further includes: Performing information verification on the video information, generating a video play signal if the verification passes, and feeding back the video play signal to the video play interface; The information verification includes at least one of the following: Check whether the playback address in the video information is valid, if so, the verification is deemed to be successful; Verify whether the format of the video information meets the preset media format standard, and if so, the verification is deemed to be passed; Check whether the video duration in the video information meets the preset duration range, and if so, it is deemed to be verified.

8. A device for controlling gradual change of sound in video playback, characterized in that: The device comprises: A video user interface, used to obtain a target video and transmit the target video to a video player; A video player, used to play the target video, wherein the video player is encapsulated in the video playing interface; Property animator, used to control the sound output of the video player to gradually change from the initial volume to the target volume; An update listener is used to monitor the volume value changes during the animation cycle and pass the changed volume value to the video player; The property animator is configured to change the volume value at a predetermined rate during its animation cycle; and the video player adjusts its sound output according to the volume value provided by the property animator.

9. An electronic device, characterized in that: It comprises a processor, a memory and a communication bus; the communication bus is used to connect the processor and the memory; the processor is used to execute the computer program stored in the memory to implement the sound gradual change control method in video playback as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is used to enable a computer to execute the method for controlling sound gradual change in video playback as described in any one of claims 1-7.