Music playing method and device, medium and computing equipment
The dual-player mechanism in music playback systems allows simultaneous main and background music streams, addressing the limitations of single-stream playback by enhancing flexibility and personalization, particularly for sleep aid and relaxation.
Patent Information
- Application Number
- CN202411210744.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2024-12-17
AI Technical Summary
Current music playback programs only support a single audio stream playback mode, limiting the user's listening experience to a single song at a time, lacking hierarchy and flexibility, and failing to meet the demand for diversified audio content in specific scenarios like relaxation or sleep aid.
A dual-player mechanism is introduced, allowing simultaneous playback of main music and background music through separate threads, enabling users to select and control both streams independently, with features like volume adjustment, background music lists, and synchronization with main music playback.
This enriches the listening experience by providing a more personalized and flexible audio environment, enhancing user satisfaction and improving effective playback time, especially in scenarios like night-time relaxation.
Smart Images

Figure CN119148967A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of information processing technology, and more specifically, embodiments of the present invention relate to a music playing method, apparatus, medium and computing device. Background Art
[0002] This section is intended to provide a background or context to embodiments of the invention that are recited in the claims. No description herein is admitted to be prior art by inclusion in this section.
[0003] Currently, music playback programs usually only support a single audio stream playback mode, that is, when a user uses the music playback program to listen to music, only one song can be played at the same time, resulting in a single listening experience for the user, lacking in hierarchy and flexibility. Summary of the invention
[0004] In view of this, in order to solve the above problems, the embodiments of the present invention hope to provide a music playing method, apparatus, medium and computing device to enrich the user's listening experience.
[0005] In a first aspect of an embodiment of the present invention, a music playing method is provided, which is applied to a music playing program, and the method comprises:
[0006] In response to the music playing program entering a set playing mode, displaying a background music control interface;
[0007] In response to the background music playback trigger event, maintain the life cycle state of the main music playback thread and create a background music playback thread;
[0008] The background music playing thread is used to play the background music, and the background music control interface is updated.
[0009] Optionally, the set play mode is entered when the main music in the music play program is in play or paused state;
[0010] Alternatively, the set play mode is entered when no main music is being played or paused in the music play program; the method also includes: responding to a play trigger event of the main music, using the main music play thread to play the corresponding main music.
[0011] Optionally, the background music control interface includes a main music list control; the method further includes: in response to a first interaction event with respect to the main music list control, displaying a main music list associated with a user music account;
[0012] In response to a first selection event for the main music list, the main music selected by the first selection event is played using the main music playing thread.
[0013] Optionally, when the main music is in the playing or paused state and enters the set playback mode, the method also includes: based on the style matching method, selecting background music that matches the music style of the main music from multiple preset background music, and using the background music playback thread to play the matching background music.
[0014] Optionally, before playing the background music, the method further includes:
[0015] Obtaining a global system volume; the global system volume refers to the audio output volume of a user terminal running the music player program; determining the playback volume of the main music and the background music according to a preset initial volume balance ratio and the global system volume.
[0016] Optionally, the method further comprises:
[0017] In response to a volume adjustment request event, obtaining a current volume balance ratio currently applied by the music player program, and displaying a volume balance adjustment interface;
[0018] In response to a second interaction event for the volume adjustment area in the volume balance adjustment interface, calculating a new volume balance ratio according to an operation position of the second interaction event;
[0019] In response to a confirmation trigger event of the volume adjustment, the playback volumes of the main music and the background music are re-determined according to the new volume balance ratio.
[0020] Optionally, the volume adjustment request event includes: a third interaction event for the volume control on the background music control interface; or a fourth interaction event generated by performing a first specified interaction operation on a non-control area on the background music control interface.
[0021] Optionally, the volume adjustment area is provided with a volume ratio adjustment component, including a sliding portion and a sliding area; a first boundary and a second boundary of the volume ratio are correspondingly provided on both sides of the sliding area; the sliding portion is slidably provided between the first boundary and the second boundary;
[0022] In response to the sliding portion sliding toward the side close to the first boundary, reducing the volume balance ratio of the background music and increasing the volume balance ratio of the main music;
[0023] In response to the sliding portion sliding toward the side close to the second boundary, the volume balance ratio of the background music is increased and the volume balance ratio of the main music is decreased.
[0024] Optionally, the second interaction event for the volume adjustment area in the volume balance adjustment interface includes: a sliding operation event for the sliding part, and the sliding operation event is used to control the sliding part to slide within the sliding area.
[0025] Optionally, the volume balance adjustment interface includes a confirmation control for determining to modify the volume balance ratio, and the confirmation triggering event of the volume adjustment includes: a fifth interaction event for the confirmation control; the method further includes:
[0026] In the case where the fifth interaction event for the confirmation control is not detected, in response to the exit event of the volume balance adjustment interface, the playback volume of the main music and the background music is determined according to the acquired current volume balance ratio.
[0027] Optionally, no confirmation control for determining to modify the volume balance ratio is provided on the volume balance section interface, and the confirmation triggering event of the volume adjustment includes: an exit event of the volume balance adjustment interface; or the operation of the second interactive event ends.
[0028] Optionally, the volume balance adjustment interface further includes a volume recovery control; the method further includes: in response to a sixth interaction event for the volume recovery control, determining the playback volume of the main music and the background music according to the acquired current volume balance ratio; or,
[0029] In response to a sixth interaction event for the volume recovery control, the playback volumes of the main music and the background music are determined according to an initial volume balance ratio preset by the music playback program.
[0030] Optionally, the background music control interface includes a background music list, and the method further includes:
[0031] In response to a second selection event for the background music list, the background music selected by the second selection event is played using the background music playing thread.
[0032] Optionally, the background music list is displayed in any of the following ways: controlling the display of the background music list on the background music control interface; or, in response to the seventh interaction event of the list display control set in the background music control interface, displaying the background music list associated with the user's music account.
[0033] Optionally, the method further comprises:
[0034] In response to a customized request for background music, a background music transmission interface is displayed; an audio file uploaded by a user through the background music transmission interface is received; the audio file is stored and updated to the background music list.
[0035] Optionally, the method further comprises:
[0036] In response to a music retrieval event, determining that the music retrieval event has retrieved target music; in response to a music collection event for the target music, displaying a user music list selection page; the user music list selection page includes at least a background music option and a main music option; in response to an eighth interaction event for the background music option, adding the target music to the background music list.
[0037] Optionally, the method further comprises:
[0038] Display a timing interaction interface for setting the timed playback of background music; respond to a setting event through the timing interaction interface, set the timing parameters of the background music playback, so that the background music is automatically played within the set timed playback time period.
[0039] Optionally, the method further comprises:
[0040] In response to a ninth interaction event for a preset mode control, the music player program is controlled to enter the set play mode; or, in response to a preset system button event, the music player program is controlled to enter the set play mode; or, in response to a tenth interaction event generated by performing a second specified interaction operation on a non-control interface area in the music player program, the music player program is controlled to enter the set play mode; wherein the tenth interaction event includes at least one of a double-click operation event and a long press operation event.
[0041] Optionally, a synchronization mechanism is provided between the main music playing thread and the background sound playing thread, and the method further comprises:
[0042] In response to a change in the playing state of the main music played by the main music playing thread, the changed playing state of the main music is synchronized to the background music playing thread through the synchronization mechanism; the playing state of the main music includes any one of a playing state and a paused state;
[0043] The background music playing thread is utilized to set the playing state of the background music to be consistent with the changed main music playing state.
[0044] Optionally, the method further comprises:
[0045] Display the main music playback interface;
[0046] The display background music control interface includes:
[0047] Control to display the background music control interface superimposed on the layer of the main music playing interface.
[0048] Optionally, the method further comprises:
[0049] In response to a closing event for the background music control interface, maintaining the life cycle state of the background music playing thread, and removing the background music control interface from the interface layer of the main music playing interface;
[0050] In response to an exit event for the background music control interface, the resources of the background music playing thread are released, and the background music control interface is removed from the interface layer of the main music playing interface.
[0051] Optionally, for each preset background music, the resource library of the music player program stores a theme image and a control style matching the background music;
[0052] The updating of the background music control interface includes:
[0053] Get the theme image and control style that matches the background music being played by the background music playing thread;
[0054] The theme image is displayed on the background music control interface, and the acquired control style is applied to each control on the background music control interface.
[0055] Optionally, the method further comprises:
[0056] In response to a sliding operation event on the background music control interface, switching the background music played by the background music playing thread;
[0057] Displays the animation effect of transitioning from the theme image of the currently playing background music to the theme image of the next background music.
[0058] Optionally, the animation effect of displaying a transition from a theme picture of the currently playing background music to a theme picture of the next background music includes:
[0059] Detecting in real time the sliding position of the sliding operation event on the background music control interface;
[0060] According to the sliding position, the display ratio of the theme pictures of the two background music pieces is calculated, and the corresponding transition images are synthesized;
[0061] The transition image is rendered to a theme picture display area on the background music control interface.
[0062] In a second aspect of the embodiments of the present invention, a music playing device is provided, which is applied to a music playing program, and the device comprises:
[0063] An interface display module, for displaying a background music control interface in response to the music playing program entering a set playing mode;
[0064] The background music playing module is used to respond to the background music playing trigger event, maintain the life cycle state of the main music playing thread and create a background music playing thread; use the background music playing thread to play background music and update the background music control interface.
[0065] In a third aspect of the embodiments of the present invention, a readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the above method is implemented.
[0066] In a fourth aspect of the embodiments of the present invention, a computing device is provided, comprising: a processor and a memory; the memory is used to store a computer program; the processor is used to execute the above method by calling the computer program.
[0067] According to the implementation mode of the present invention, a dual-player mechanism is introduced by adding a set playback mode that supports background music playback, allowing users to use two players to play music in parallel at the same time. One player is used to play the main music selected by the user, and the other player can be used to play the background music selected by the user. This meets the user's demand for superimposed playback of diversified audio content, greatly enriches the user's listening experience, and provides users with a more personalized and comfortable sleep-aiding listening environment for specific scenarios such as night time, thereby effectively improving the effective playback rate of songs listened to by users at night and the average effective playback time per person. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] The above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, in which:
[0069] Figure 1-1 A flowchart schematically shows a method for playing music according to an embodiment of the present invention;
[0070] Figure 1-2 A schematic diagram of an interface layout including a preset mode control and a non-control interface area according to an embodiment of the present invention is schematically shown;
[0071] Figure 2A schematic diagram of a volume ratio adjustment component according to an embodiment of the present invention is schematically shown;
[0072] Figure 3 A schematic diagram of an interface interaction for user-defined uploading of background music according to an embodiment of the present invention is shown schematically;
[0073] Figure 4 A schematic diagram of a timing interaction interface for setting the timing of background music playing according to an embodiment of the present invention is schematically shown;
[0074] Figure 5 A schematic diagram of a logic diagram of entering a set play mode through an interface interaction according to an embodiment of the present invention is shown;
[0075] Figure 6 A schematic diagram of an exemplary background music control interface for setting a close control and an exit control according to an embodiment of the present invention is schematically shown;
[0076] Figure 7 A schematic diagram of a background music control interface using a theme image and a control style that match the background music according to an embodiment of the present invention is schematically shown;
[0077] Figure 8 A schematic diagram of an animation effect of theme picture transition when background music is switched according to an embodiment of the present invention is schematically shown;
[0078] Fig. 9 The following schematically shows an interactive logic flow chart of a music playing method according to an embodiment of the present invention;
[0079] Fig.10 A block diagram of a music playing device according to an embodiment of the present invention is schematically shown;
[0080] Fig.11 A schematic diagram of a medium according to an embodiment of the present invention is schematically shown;
[0081] Fig.12 A schematic diagram of a computing device according to an embodiment of the present invention is schematically shown.
[0082] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts. DETAILED DESCRIPTION
[0083] The principles and spirit of the present invention will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present invention, and are not intended to limit the scope of the present invention in any way. On the contrary, these embodiments are provided to make the present invention more thorough and complete, and to fully convey the scope of the present invention to those skilled in the art.
[0084] Those skilled in the art know that the embodiments of the present invention can be implemented as a system, device, apparatus, method or computer program product. Therefore, the present invention can be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.
[0085] According to an embodiment of the present invention, a music playing method, apparatus, medium and computing device are proposed.
[0086] It should be understood herein that any number of elements in the drawings is for illustration rather than limitation, and any naming is only for distinction rather than having any limiting meaning.
[0087] The principle and spirit of the present invention are explained in detail below with reference to several representative embodiments of the present invention.
[0088] With the rapid development of digital music technology and the increasing diversification of user needs, music playback programs have become an indispensable part of people's daily lives, playing an important role in leisure, entertainment, sleep aid and relaxation.
[0089] However, the music playback programs or platforms currently on the market still have limitations in meeting the personalized needs of users for specific scenarios. Specifically, existing music playback programs usually only support the playback mode of a single audio stream, that is, users can only select and play one song at the same time. This mode limits the user's listening experience, making the user's listening experience single, lacking in hierarchy and flexibility, and unable to meet the user's needs for a diversified listening experience in a specific time period. For example, at night, many users hope to be able to superimpose background sound effects such as natural sound effects (such as rain, cicadas) or white noise while enjoying their favorite songs to relax and assist sleep, but current music playback services are difficult to meet this listening demand.
[0090] In view of this, the present invention proposes a music playing method, which supports users to play background music while playing their favorite music. In the present invention, when the music playing program starts the playing mode, the main music playing thread is maintained and an independent background sound playing thread is created immediately, and the background music is played by the newly added background sound playing thread, so that the main music and the background sound are processed in parallel, thereby providing users with a richer and more flexible music playing experience.
[0091] After introducing the basic principles of the present invention, various non-limiting embodiments of the present invention are described in detail below.
[0092] Exemplary Methods
[0093] Reference below Figure 1-1 to Figure 12 The music playing method according to the exemplary embodiment of the present invention is described. The method can be widely applied to various music playing programs, such as music playing software or online platforms, and can be performed by various devices running the music playing program, such as smart phones, tablet computers, personal computers, smart TVs, professional audio systems, car entertainment systems, and various portable music players.
[0094] refer to Figure 1-1 , Figure 1-1 A music playing method according to an embodiment of the present invention is schematically shown, and the method may at least include the following steps:
[0095] S101, in response to the music playing program entering a set playing mode, displaying a background music control interface;
[0096] The music playing program includes software or application programs that can play audio files, such as a music APP on a mobile phone, a music player on a computer, or an online music playing platform.
[0097] The set play mode is used to indicate the preset mode of starting dual players to play music in the music player program, allowing the music player program to process multiple audio streams at the same time, and is used to process the main music and background music at the same time during the music playback process, so as to realize the function of superimposing and playing background music without interfering with the main music playback, and being able to independently control and adjust the background music. In this embodiment, the set play mode can be named according to the actual situation, such as "sleep mode", "background music playback mode", "dual playback mode", etc., and this application does not impose specific restrictions on the naming of the set play mode.
[0098] Regarding triggering the music player to enter the set play mode, it can be triggered by a plurality of preset interaction modes, which may include but are not limited to the control direct interaction mode and the non-control area ubiquitous interaction mode. Among them, the control direct interaction mode means that the user can select the preset mode control by touch or external device input to trigger the music player to enter the set play mode; the non-control area ubiquitous interaction mode means that regardless of whether the preset mode control is set, the user can trigger the music player to enter the set play mode by executing the pre-defined input operation in the program in the blank interface area that does not contain the interactive controls without touching any interactive controls. The user can choose a convenient triggering method to open the set play mode according to the habits of the use environment of the music player program.
[0099] The background music control interface is a user interface in the music player program, which is used to adjust and control the playing of background music in the set playing mode. It may include but is not limited to switching background music, pausing / playing, timed playing, pictures or covers associated with the currently playing background music, and other interface functions. Through the interaction between the interface and the user, it provides the user with flexible control over the background music in the set playing mode.
[0100] In UI design, layers are used to organize and distinguish the display order of different elements. The upper layers will block or cover the lower layers, thereby affecting the user's visual perception. In this embodiment, the display method of the background music control interface can be determined according to the hierarchical relationship and display logic in the user interface design. For example, the background music control interface can be displayed above the layer of the user interface before entering the set play mode, that is, the background music control interface can appear in the top layer of the current page in the form of a floating layer, a pop-up window or a full-screen mode, so that the user can clearly see and operate; or, the background music control interface can be embedded in the user interface before entering the set play mode in the form of a toolbar.
[0101] In this step, when it is detected that the music player program has switched modes, that is, the set play mode is turned on, in response to the mode state switching of turning on the set play mode, the music player program triggers a UI (UserInterface, i.e., user interface) update event, which is used to display the background music control interface on the music player program. The background music control interface can be realized by loading a specific interface template from the UI component library and rendering it on the user terminal screen.
[0102] For example, suppose there is a mobile phone APP called "XX Music" that supports multiple playback modes, including "Set Play Mode". The user opens the "XX Music" APP and plays a main music such as "Song A"; the user selects "Set Play Mode" through the setting interface of "XX Music", and the "XX Music" APP detects that the user has selected "Set Play Mode" and immediately loads the background music control interface set for "Set Play Mode" from the resource library. After loading, the "XX Music" APP automatically switches the currently displayed interface to the newly loaded background music control interface. From the user's perspective, the user clicks "Set Play Mode" and the "XX Music" APP switches to display the background music control interface.
[0103] S102, in response to a background music playback triggering event, maintaining the life cycle state of the main music playback thread and creating a background music playback thread;
[0104] The background music playback triggering event includes a specific condition or user operation that can trigger the background music to start playing, and different triggering events may be included in different background music playback mechanisms. In the scenario of supporting automatic playback of background music, the background music playback triggering event may be: after the music playback program enters the set playback mode, the music playback program automatically selects the first playback request of the background music, that is, when the music playback program enters the set playback mode, the action of the music playback program entering the set playback mode triggers the music playback program to automatically select the background music, and generates the first playback request of the corresponding background music based on the selected background music, and the first playback request will be used as the playback triggering event of the above-mentioned background music to start the creation of the background music playback thread and the background music playback process; in the scenario of manually selecting the background music to be played, the background music playback triggering event includes the second playback request of the background music manually selected by the user from the background music list after the music playback program enters the set playback mode, that is, the user manually selects the background music in the background music control interface, and generates the second playback request of the corresponding background music based on the background music selected by the user, and the second playback request will be used as the playback triggering event of the above-mentioned background music to trigger the creation of the background music playback thread.
[0105] In the scenario where automatic background music playback is supported, the music playback program automatically selects background music and starts playing the background music, which can be achieved in any of the following ways:
[0106] Randomly select a background music from multiple preset background music for playing; or, obtain the last background music played when the user last entered the set playback mode before the current time, and continue playing the background music; or, based on the user's preference characteristics for playing background music in different time periods, select background music that matches the current time and meets the user's preference characteristics for playing; or, when the main music is in a paused or playing state in the main music playback thread, that is, the set playback mode is entered when the main music is in a playing or paused state in the music playback program, it is also possible to select background music that matches the music style of the main music from multiple preset background music based on a style matching method for playing.
[0107] In this embodiment, main music and background music are two relative concepts, which coexist in the context of the music playing program. Main music refers to the music that the user actively selects in the current music playing program and hopes to use as the main auditory experience. In a music playing program that supports a single video stream, the main music is the song currently being played in the program, which occupies the focus of the audio playing and is the object of direct operation and attention of the user. Background music, as an auxiliary audio content, is used to provide users with additional auditory atmosphere or emotional supplement without affecting the main music playing, and plays a role of foil or enhancement. For example, background sound can include but is not limited to white noise (such as rain, streams, waves, wind, birdsong, etc.), instrumental music, environmental sound effects, synthetic sound effects, etc.
[0108] For example, taking the aforementioned "XX Music" APP as an example, the user opens the "XX Music" APP and plays a piece of music such as "Song A", which is the main music; the user selects "Set Play Mode" through the setting interface of the "XX Music", and the "XX Music" APP automatically switches the currently displayed setting interface to the newly loaded background music control interface, and the music played in this background music control interface is the background music.
[0109] Based on this, the above-mentioned main music playback thread is responsible for processing the main music playback logic such as decoding, playing, pausing, stopping, etc., ensuring that the main music can be played according to the user's wishes; the background music playback thread is independent of the main music playback thread, and is responsible for processing the background music playback logic, ensuring that it can run independently without affecting the main music playback, and providing continuous background music playback.
[0110] The life cycle state refers to the state of a thread during its life cycle, including thread states such as creation, ready, running, suspended, blocked, and death. In this step, maintaining the life cycle state of the main music playback thread means not changing the state of the main music playback thread in the music playback program, and creating another background music playback thread at the same time. For example, when entering the set playback mode, assuming that there is a main music in the music playback program that is in a paused state, and the main music playback thread that processes the main music playback logic accordingly is in a suspended state, then the suspended state of the main music playback thread is maintained, and a background music playback thread is created, that is, the paused state of the main music is not changed, and a background music playback thread is created to play the background music, so as to achieve not affecting the main music playback and superimposing the background music playback.
[0111] When creating a background music playback thread, you need to consider thread security and resource efficiency. You can use multithreaded libraries such as Java's Thread class and Android's HandlerThread to create and manage threads. The background music playback thread is used to implement the logic of music decoding, playback, and control, including interaction with audio devices, audio data processing, and playback status updates. For example, in an Android application, you can use HandlerThread to create a thread specifically for playing background music. In this thread, you can create and start a MediaPlayer instance to load and play background music. At the same time, you can use Handler and Looper to pass messages between the UI thread and the background music playback thread and update UI elements, such as the playback progress bar.
[0112] S103, using the background music playing thread to play background music, and updating the background music control interface.
[0113] In response to the above-mentioned background music playback triggering event, a background music playback thread is created in the music playback program, and the background music playback thread is used to play the background music indicated by the playback triggering event. After the background music playback thread is created, the background music information to be played is determined based on the above-mentioned background music playback triggering event, such as the background music automatically selected by the music playback program or the background music manually selected by the user, and the background music playback thread reads the music file from the database, decodes the audio data, and sends the decoded audio data to the audio output device of the user terminal running the music playback program for playback.
[0114] At the same time, the music player updates the background music control interface to reflect the current background music playback status, which may include but is not limited to displaying the current background music information such as the background music name, source, theme cover, displaying the playback progress bar, the status of the play / pause button, etc. during the background music playback process. If there are status changes such as song switching, playback pause, etc., the control interface will be updated accordingly so that the user can understand the background music playback status in real time.
[0115] For example, a user opens a music player and plays a favorite main music B. In a scenario that supports automatic background music playback, the user selects "Set Play Mode" to trigger the music player to enter the set play mode. The music player randomly selects background music - raindrop sound from multiple preset background music, generates a play request for the raindrop sound as a background music playback trigger event, triggers the music player to create a background music playback thread, and uses the background music playback thread to play the raindrop sound. At the same time, the relevant song information of the raindrop sound displayed on the background music control interface is updated, and the pause / play button is switched to the playing state. At this time, the music player uses the main music playback thread to play the main music B, and at the same time, uses the background music playback thread to play the background music - raindrop sound, realizing the listening experience of main music B superimposed with raindrop sound.
[0116] In the disclosed embodiment, a dual player mechanism is introduced by adding a set play mode that supports background music playback, allowing users to use two different play threads to play music in parallel at the same time, so that both the main music selected by the user and the background music for atmosphere enhancement can be played at the same time, meeting the user's demand for the superposition of playback of diversified audio content. While enjoying the auditory enjoyment brought by the main music, the user can obtain additional emotional resonance or atmosphere creation through background music, which greatly enriches the user's listening experience and improves the overall listening level and flexibility. At the same time, for specific scenes such as the night period, it provides users with a more personalized and comfortable sleep-aiding listening environment, thereby effectively improving the effective playback rate of songs and the average effective playback time per person for users listening to songs at night.
[0117] Moreover, the dual player mechanism allows users to freely combine user-selected music and background music according to their needs, which promotes the personalized development of music playback experience and meets the differentiated needs of different user groups. In addition, the above method is widely applicable to various listening scenarios such as learning, working, meditation, and sleep aid, which can help users achieve a better mental state and efficiency in different scenarios and enhance the user's listening experience.
[0118] In the above embodiment, a variety of preset methods for triggering the music playback program to enter the set playback mode are outlined. In order to further enrich the user experience and demonstrate the implementation process of different preset triggering methods, this embodiment provides exemplary explanations for several specific triggering mechanisms. It can be clearly stated that the "ninth" and "tenth" in the "ninth interactive event" and "tenth interactive event" in this embodiment are only used to distinguish the same type of information from other interactive events in this application, and have no specific indicative meaning. Based on this, the above music playback method can be triggered to enter the set playback mode by at least one of the following triggering methods:
[0119] In response to detecting a ninth interaction event for a preset mode control, the music player program is controlled to enter the set play mode; or, in response to detecting a preset system key event, the music player program is controlled to enter the set play mode; or, in response to a tenth interaction event generated by performing a second specified interaction operation on a non-control interface area in the music player program, the music player program is controlled to enter the set play mode, wherein the tenth interaction event includes at least one of a double-click operation event and a long press operation event.
[0120] As for the "ninth interactive event for the preset mode control", the preset mode control refers to an interactive element set on the user interface of the music player program, which is used to trigger the music player program to enter the set play mode. The interactive element can be in the form of a button or an icon. The user generates the ninth interactive event through the interactive operation with the preset mode control. The ninth interactive event can be triggered by a variety of user operations to adapt to the operating environment of different user terminals, which may include but are not limited to: the user touches the preset mode control through a touch screen, and the user selects or clicks the preset mode control through an external device such as (mouse, keyboard).
[0121] When the user has the ninth interaction event with the preset mode control (such as clicking the control), the music player program will detect the interaction event and determine whether the interaction event meets the conditions for entering the set playback mode based on the preset logic. If so, the music player program will control itself to enter the set playback mode.
[0122] For the "preset system key event", the system key refers to the response event triggered by the user through a physical key such as the volume key of the mobile phone, the designated shortcut key of the keyboard, or a key combination. In the context of the music player program, the preset system key event includes a predefined system key event that can trigger the entry into the set play mode. When the user presses the preset system key or key combination, the operating system of the user terminal will generate a corresponding system key event and broadcast it to all applications monitoring the event; the music player program detects that the user has triggered the preset key operation by monitoring the system key event, and then controls itself to enter the set play mode.
[0123] Regarding "the tenth interactive event generated by performing the second designated interactive operation on the non-control interface area of the music player", the non-control interface area includes the areas in the various user interfaces displayed when the user opens the music player program that are not occupied by specific interactive controls such as buttons and lists. The application predefines a specific interactive operation for triggering entry into the set play mode, namely the second designated interactive operation, which is applicable to the interaction between the user and the non-control interface area. When the interactive operation performed by the user on the non-control area meets the second designated interactive operation, the tenth interactive event is triggered to control the music player program to enter the set play mode. The second designated interactive operation may include but is not limited to double-click operations, long press operations, multi-touch point sliding operations such as two-finger sliding, multi-touch point gathering operations, letter drawing gesture operations, etc., which can be defined according to actual needs.
[0124] For a better understanding of the ninth and tenth interaction events, see Figure 1-2 A schematic diagram of an interface layout including preset mode controls and non-control interface areas is schematically shown. Assuming that the interface layout is that of a main music playback interface, the user can open the main music playback interface through interaction after opening the music playback program. The user can select the illustrated preset mode control through touch or mouse selection, and a ninth interaction event is generated based on the selection action, triggering the music playback program to enter the set playback mode. Alternatively, the user can also perform a two-finger swipe up operation on the illustrated non-control interface area through touch or mouse input, and based on the two-finger swipe up operation belonging to the second designated interaction operation, a tenth interaction event is generated, triggering the music playback program to enter the set playback mode.
[0125] The various triggering methods for entering the set play mode provided in this embodiment can be used alone or in combination to provide users with a more flexible operation method. By providing a variety of preset triggering methods, users can choose the most convenient and most suitable method for the current scene to trigger the music player to enter the set play mode according to their usage habits and needs, so that the music player can better adapt to various usage scenarios, meet the diverse needs of users, improve the convenience of user operation, and enhance the user's satisfaction and comfort during use.
[0126] In some embodiments, the music player program may include two states about the main music: the main music is already playing or temporarily in a paused state, or there is no main music currently playing or pausing. From the user UI perspective, the main music is playing or pausing, which is manifested by the display of relevant information of the main music on the main music playback interface, including but not limited to the music name, artist, album cover, playback progress bar, and the state of the play / pause button, etc. The corresponding state of the main music playback thread includes: for the playing state, the main music playback thread is in an active running state, constantly processing the audio data of the main music and sending it to the audio output device; for the paused state, the play / pause button on the main music playback interface will be displayed as a pause icon accordingly, and the playback progress bar will stay at the position when it was paused, and the main music playback thread is in a suspended or waiting state, waiting for the command to resume playback. Accordingly, when the user initializes the login, or the playlist is played and the user does not select a new main music, there is no main music currently playing or pausing in the music player program, which is manifested by the fact that no relevant information of the main music is displayed on the main music playback interface, and at this time the main music playback thread has not been created or the created main music playback thread is in a dormant or stopped state, and there is no audio playback task in progress.
[0127] Based on the above two states, in this embodiment, the above set play mode can be entered when the main music is in the playing or paused state in the music playback program. The program retains the current state of the main music and starts to execute the processing logic of the set play mode. In the case of entering the set play mode when the main music is in the playing or paused state, if the music playback program supports automatic playback of background music when entering the set play mode, the background music for automatic playback can be selected through the style matching method, that is: obtaining the music style of the main music that is currently in the playing or paused state; based on the style matching method, selecting background music that matches the music style of the main music from multiple preset background music; and using the created background music playback thread to play the matching background music.
[0128] For example, a user opens the "XX Music" APP and plays a main music in classical style. After the "XX Music" APP enters the set play mode, the program recognizes that the current main music is in classical style, retrieves background music with classical style, or background music that is emotionally coordinated with classical music from the preset background music library, and plays the retrieved background music through the background music playback thread. The style matching and automatic playback functions improve the user's interaction efficiency and convenience, and provide users with a richer and more personalized listening experience.
[0129] Alternatively, the above-mentioned setting play mode can also be entered when there is no main music in the playing or paused state in the music playing program. In the process of starting to execute the processing logic of setting the play mode, it can also include a main music playing step, that is, responding to the main music playing trigger event, using the main music playing thread to play the corresponding main music. Among them, if the main music playing thread is not created, in response to the main music playing trigger event, the main music playing thread is created, and the corresponding main music is played by the thread; if the main music playing thread is in a dormant or stopped state, in response to the main music playing trigger event, the main music playing thread is reactivated, and the corresponding main music is played by the thread.
[0130] The main music playback trigger event can be generated in different ways after the music playback program enters the set playback mode. In the case where a main music list is provided on the user interface in the set playback mode, the playback trigger event can be generated by a selection operation on the main music list; or, in the case where the program interface before entering the set playback mode is returned to in the set playback mode, the playback trigger event can also be generated by a selection operation on the main music list displayed on the program interface before entering the set playback mode.
[0131] For example, the user opens the "Favorite Playlist" of the "XX Music" APP, and the music player program displays the program interface of the "Favorite Playlist". The user triggers the entry into the set play mode through the program interface and displays the background music control interface. If there is a display control for the main music list on the background music control interface, the main music list can be displayed by interacting with the display control, and the main music can be selected to generate a playback trigger event for the main music. While remaining in the set play mode and closing the background music control interface to return to the program interface of the "Favorite Playlist", the user can generate a playback trigger event for the main music by selecting the main music on the "Favorite Playlist", or can further switch to other main music lists / playlists through interaction to select the main music.
[0132] In some embodiments, in order to optimize the user's operating experience after entering the set playback mode, enable the main music and background music to be managed synchronously, and improve the interaction efficiency and convenience, this embodiment provides the user with an innovative background music control interface. A main music list control is provided on the background music control interface. The main music list control, as an element on the background music control interface, can be implemented in the form of a button, icon, or menu item. The user can access the main music list by interacting with it.
[0133] Based on the main music list control, the aforementioned music playback method may also include the following steps for triggering the main music playback: in response to a first interaction event with the main music list control, displaying the main music list associated with the user's music account; in response to a first selection event with the main music list, using the main music playback thread to play the main music selected by the first selection event.
[0134] The first interaction event for the main music list control refers to an event generated by the interaction between the user and the main music list control, which can be generated by a touch operation on the main music list control, or an external input device such as a keyboard or a mouse selecting the main music list control. Similarly, the first selection event for the main music list can also be generated by a touch operation or an external input device selecting a main music on the main music list.
[0135] In response to the first interactive event, the main music list associated with the user's music account is displayed. If the set play mode is entered when there is main music in the playing or paused state, the music list where the current main music is located can be directly displayed; if the set play mode is entered when no main music is in the playing or paused state, if the user has multiple main music lists, the list used by the user to collect various favorite music can be directly displayed by default, or the list containing the largest number of music can be selected for display.
[0136] Regarding playing the main music selected by the first selection event in response to the first selection event, the main music playback thread obtains the audio data of the main music from the resource library based on the main music information selected by the first selection event, such as the unique music identifier, and sends the audio data to the audio output device after decoding, so that the user can hear the played main music.
[0137] In the disclosed embodiment, a main music list control is set on the background music control interface, allowing the user to directly access and select the main music on the background music control interface, and can manage background music and main music at the same time without frequently switching between multiple interfaces. The user can select background music and main music that are coordinated with each other, thereby enhancing the smoothness of the interaction. Compared with the cumbersome process of first exiting the background music control interface and then entering another interface to select the main music, the user's operation steps are reduced, and the efficiency and convenience of the operation are improved.
[0138] In some embodiments, based on the need to improve user operation experience and music management convenience, in order to further optimize the user's auditory experience when enjoying background music and main music at the same time, this embodiment introduces a volume balancing mechanism for background music and main music, and dynamically adjusts the playback volume of main music and background music by comprehensively considering the global system volume and volume balancing ratio to obtain clear and harmonious audio output. Before playing the background music in the aforementioned step S103, the volume setting of background music and main music can be implemented in the following way:
[0139] Obtaining a global system volume; the global system volume refers to the audio output volume of a user terminal running the music player program; determining the playback volume of the main music and the background music according to a preset initial volume balance ratio and the global system volume.
[0140] The global system volume refers to the system-level audio output volume level set by user terminals such as smartphones, tablets, computers, etc., which controls the volume of all audio played through the summary segment, such as music, videos, game sound effects, etc. For example, when listening to music on a mobile phone, the volume adjusted by the volume button or system settings is the global system volume.
[0141] The volume balance ratio indicates the volume distribution relationship between the main music and the background music in the output audio of the user terminal. It is used to set the volume ratio of the main music and the background music relative to each other, and adjust the volume distribution ratio between different audios in the audio mixing stage, and determine how different audios are mixed and output according to the ratio under the global system volume. When the user plays background music and main music at the same time, the two audios are mixed according to the volume balance ratio and output with the global system volume as the upper limit, so that the volume actually heard by the user is the audio result of the two audios mixed, and its volume does not exceed the global system volume as a whole.
[0142] The preset initial volume balance ratio is a specified ratio set inside the music player program, and the user can adjust the initial volume balance ratio through the provided interface interaction function. For example, the initial volume balance ratio can be set to background music: main music = 50%: 50%.
[0143] The above process of determining the playback volume of the main music and background music includes the music playback program adjusting the gains of the main music and background music according to the global system volume and the volume balance ratio, which is actually changing the volume value of the two audio streams before mixing as the output audio of the user terminal, and the gain is the parameter used to adjust the volume value. Based on this, when the volume balance ratio includes the background music accounting for a first proportion and the main music accounting for a second proportion, and the sum of the first proportion and the second proportion is 1, the playback volume can be determined in the following way: according to the global system volume and the preset volume balance ratio, the first gain of the background music is calculated as the playback volume of the background music, so that its volume accounts for the first proportion of the global system volume after mixing, that is, the music playback program will calculate a first gain value, so that when the background music is played at the first gain value, its volume ratio in the mixed output audio is close to the preset first ratio; similarly, the second gain of the main music is calculated as the playback volume of the main music, so that its volume accounts for the second proportion of the global system volume after mixing.
[0144] For example, if the volume balance ratio is background music: main music = 30%:70%, the gain of the background music is set to a lower value so that its volume accounts for 30% of the global system volume after mixing; the gain of the main music is set to a higher value to ensure that it accounts for 70% of the global system volume in the mixed output.
[0145] The above-mentioned process of adjusting the gain can be completed in an audio processing unit such as a digital signal processor before the audio signal is sent to the speaker of the user terminal. By adjusting the gain, the music playing program can ensure that in the mixed output, the volume of the main music and the background music can be distributed according to a preset ratio, and the overall volume does not exceed the global system volume limit set by the user.
[0146] In the embodiment of the present disclosure, by introducing a volume balancing mechanism for background music and main music, and dynamically adjusting the playback volume of the two based on the global system volume and a preset initial volume balancing ratio, the main music and background music in the output audio are made more harmonious and unified, which is suitable for users' volume setting requirements for main music and background music in different scenarios, and provides personalized interaction for users.
[0147] In some embodiments, the user can also trigger manual adjustment of the above volume balance ratio through a preset interactive method to meet personalized needs or adapt to different auditory preferences. Based on this, this embodiment provides a volume balance ratio adjustment method, which may at least include the following steps a1-a3:
[0148] a1, in response to a volume adjustment request event, obtaining the current volume balance ratio of the music player currently applied, and displaying a volume balance adjustment interface;
[0149] The volume adjustment request event includes a trigger event that is triggered by any interactive operation set by the user and requires adjustment of the volume balance ratio. The volume adjustment request event triggers the processing logic for adjusting the volume balance ratio in the music playback program.
[0150] The volume adjustment request event may include at least one of the following types of events: a third interaction event for the volume control on the background music control interface; or a fourth interaction event generated by performing a first specified interaction operation on the non-control area on the background music control interface, wherein the first specified interaction operation may include but is not limited to multi-touch point sliding operations such as two-finger sliding, multi-touch point clustering operations, letter drawing gesture operations, etc., which can be defined according to actual needs.
[0151] The volume control is an interactive control on the background music control interface, which can be implemented in the form of an icon, a menu item, etc. The user can trigger the display of the volume balance adjustment interface by interacting with it to adjust the volume balance ratio. The third interactive event is generated by the interactive operation between the user and the volume control, and the interactive operation may include: the user directly touches the volume control through the touch screen, or the user selects the volume control through an external input device such as a mouse or keyboard, and the third interactive event is generated based on the interactive operation, triggering the music player to obtain the current volume balance ratio currently applied by the music player, and displaying the volume balance adjustment interface.
[0152] For example, there is a speaker-shaped button on the background music control interface. When the user touches or selects the speaker-shaped button, the music player program will switch to the volume balance adjustment interface.
[0153] The non-control area on the background music control interface includes the area on the control interface that is not occupied by a specific interactive element. The music player program predefines a first specified interactive operation. When the interactive operation performed by the user in the non-control area meets the first specified interactive operation, the music player program generates a fourth interactive event. Different from the third interactive event, the fourth interactive event is not triggered by directly operating the volume control, but by performing a predefined interactive operation in the non-control area of the background music control interface. Not any interactive operation with the non-control area can generate the fourth interactive event.
[0154] For example, the display area on the background music control interface used to display a static theme picture can be regarded as a non-control area because there is no interactive element occupying it. The user long presses the display area. Because the long press operation meets the first specified interactive operation, the music playback program generates a fourth interactive event when detecting the long press operation on the non-control area, triggering the music playback program to switch to the volume balance adjustment interface.
[0155] The volume balance adjustment interface is used to display the current volume balance ratio and provide users with the function of adjusting the current volume balance ratio. On this adjustment interface, users can see the balance ratio settings of the main music and background music, and adjust the balance ratio through controls such as sliders, knobs, and digital input boxes.
[0156] In this step, when a volume adjustment request event is received, the music playback program first obtains the current volume balance ratio that the program is currently applying, and initializes the volume balance adjustment interface based on the current volume balance ratio, such as calculating the initial position of the slider, knob, or numeric input box, and setting the display status of other related elements on the interface, and rendering the initialized interface on the screen to make it visible and interactive to the user.
[0157] For example, when the user first enters the set play mode, the program uses a preset initial volume balance ratio. After a period of time, if a volume adjustment request event is received, the initial volume balance ratio is used as the current volume balance ratio, and the volume balance ratio displayed on the volume balance adjustment interface is the initial volume balance ratio. After adjustment by the user, the first volume balance ratio is obtained and applied; thereafter, if a volume adjustment request event is received again, the first volume balance ratio is used as the current volume balance ratio, and the first volume balance ratio is displayed on the volume balance adjustment interface as the starting point for adjustment.
[0158] a2, in response to a second interaction event on the volume adjustment area in the volume balance adjustment interface, calculating a new volume balance ratio according to an operation position of the second interaction event;
[0159] The volume adjustment area includes a portion of the volume balance adjustment interface that the user can directly operate to adjust the volume balance, which may be an area containing a slider, a knob, or other interactive elements. The second interactive event for the volume adjustment area is an interactive event triggered by a specific interactive operation between the user and the volume adjustment area. In this embodiment, the interactive event is related to the interactive elements of the volume adjustment area, and may include but is not limited to interactive events triggered by a click operation or a drag operation.
[0160] For example, assuming that a slider for adjusting the volume balance ratio is set in the volume adjustment area, when the user drags the slider by touching or using an external input device, the sliding operation will trigger the second interaction event.
[0161] The operation position of the second interaction event refers to the specific position when the interaction operation between the user and the volume adjustment area in the interaction event ends. Taking the slider as an example, the operation position is the position of the slider when the sliding operation ends.
[0162] In this step, an event listener can be set for the interactive element set in the volume adjustment area for adjusting the volume balance ratio to capture the second interactive event on the interactive element. Taking the slider as an example, a touch listener is set for the slider in the volume adjustment area so that the corresponding event is triggered when the user touches or selects the slider and drags the slider. When the second interactive event occurs, the specific position at the end of the interactive operation is obtained, and based on the specific position and the preset volume balance range, a new volume balance ratio is calculated.
[0163] a3, in response to a confirmation trigger event of volume adjustment, re-determining the playing volume of the main music and the background music according to the new volume balance ratio.
[0164] The volume adjustment confirmation trigger event is a user interaction event, indicating that the user has completed the volume balance ratio adjustment setting and hopes to apply the setting. Different confirmation trigger events can be set for different layouts of the volume balance adjustment interface with and without a confirmation control for determining the modification of the volume balance ratio.
[0165] In the case where no confirmation control for determining to modify the volume balance ratio is set on the volume balance section interface, the confirmation trigger event may include at least any one of the following: an exit event of the volume balance adjustment interface; or the end of the operation of the second interactive event.
[0166] Among them, the exit event of the volume balance adjustment interface, that is, the user closes or minimizes the volume balance adjustment interface, and the music playback program detects the exit event and interprets it as the user has completed the volume balance ratio adjustment setting and hopes to apply the setting. For example, the user opens the volume balance adjustment interface in a music playback application and adjusts the volume balance ratio of the main music and background music by dragging the slider; after completing the adjustment, the user clicks on the blank area outside the interface, or clicks on the "Back" button at the top of the application interface to exit the volume balance adjustment interface; the music playback application detects the user's behavior of exiting the interface, generates an exit event as a confirmation trigger event for the above volume adjustment, automatically uses the current volume balance ratio as the final adjusted volume balance ratio, and calculates the playback volume of the main music and the background music respectively.
[0167] The operation of the second interactive event ends, that is, the user's interactive operation on the volume adjustment area in the volume balance adjustment interface ends. When the user completes the adjustment of the interactive element set in the volume adjustment area and releases the interactive element (such as releasing the finger after dragging the slider), it can be regarded as the user has completed the setting of the volume balance ratio adjustment and hopes to apply the setting. For example, taking the setting of the slider in the volume adjustment area as an example, the user drags the slider to a new position with his finger, and then releases the finger, ending the adjustment operation of the slider; the music playback program detects the action of the user releasing his finger, generates a confirmation trigger event, and then applies the new volume balance ratio to the audio playback.
[0168] In the case where a confirmation control for determining and modifying the volume balance ratio is arranged on the volume balance adjustment interface, the confirmation trigger event of the above volume adjustment can be set as: the fifth interaction event for the confirmation control. That is, the fifth interaction event refers to the interaction event generated when the user interacts with the confirmation control, and the confirmation control can be any UI element that allows the user to clearly express the intention of "confirmation". Based on the different types of user terminals, the interaction between the user and the confirmation control may include but is not limited to the user touching the confirmation control on the interface through a touch screen device, and the user selecting and activating the confirmation control through a keyboard such as the enter key, a mouse, a game controller and other peripherals.
[0169] Based on the confirmation control, in the case where the fifth interaction event for the confirmation control is not detected, in response to detecting an exit event of the user exiting the volume balance adjustment interface, the playback volume of the main music and the background music is determined according to the current volume balance ratio obtained in the aforementioned step a1 before the current volume balance ratio adjustment. That is, the volume balance ratio before the current volume balance ratio adjustment is directly restored.
[0170] For example, in response to a volume adjustment request event, the current volume balance ratio is obtained as background music: main music = 30%: 70%, and a volume balance adjustment interface is displayed, on which there is a confirmation button. The user adjusts the volume balance ratio in the volume adjustment area, but the user directly exits the volume balance adjustment interface without clicking the confirmation button, and the volume balance ratio is directly set to the current volume balance ratio of background music: main music = 30%: 70%.
[0171] In this step, when the trigger event is confirmed to have occurred, the new volume balance ratio set by the user is obtained from the volume balance adjustment interface. According to the new volume balance ratio, the playback volume of the main music and background music is adjusted respectively, and the adjusted playback volume is applied to the audio playback engine to change the audio playback effect in real time. For example, if the new volume balance ratio is 80% for the main music and 20% for the background music, the current global system volume is obtained, and the gains of the main music and background music are recalculated according to the new volume balance ratio.
[0172] In the disclosed embodiment, by introducing a volume balance adjustment interface and a volume adjustment area, the playback of main music and background music is not limited to a preset, non-adjustable volume balance ratio, allowing the user to adjust the volume balance ratio in real time according to personal preferences and scene requirements, so that the playback of main music and background music is more harmonious, thereby enhancing the interactivity between the user and the music playback program and improving the user's comfort and satisfaction during the music appreciation process.
[0173] In some embodiments, in order to enable the user to intuitively adjust the volume balance ratio to achieve the auditory effect that meets the user's expectations, this embodiment provides a component setting method for implementing the volume balance ratio adjustment. Specifically, in the volume balance adjustment interface, a volume ratio adjustment component is designed so that the user can easily and accurately adjust the volume balance ratio of the main music and the background music.
[0174] A volume ratio adjustment component is provided in the volume adjustment area in the volume balance adjustment interface, and the component includes a sliding portion and a sliding area; a first boundary and a second boundary of the volume ratio are provided on both sides of the sliding area; the sliding portion is slidably provided between the first boundary and the second boundary;
[0175] In response to the sliding part sliding toward the side close to the first boundary, the volume balance ratio of the background music is reduced and the volume balance ratio of the main music is increased; in response to the sliding part sliding toward the side close to the second boundary, the volume balance ratio of the background music is increased and the volume balance ratio of the main music is reduced. During the sliding process of the sliding part, the sum of the volume balance ratios of the background music and the main music is always 1.
[0176] See also Figure 2The schematic diagram of the volume ratio adjustment component is shown as an example, and the sliding area is set as a horizontal area. The left area corresponds to the background music with a volume balance ratio of 0, and the right area corresponds to the main music with a volume balance ratio of 0. When the slider is located in the center area of the sliding area, the volume balance ratio of the background music and the main music is 50%. By sliding the slider to the left close to the background music side (as shown in the slider position), the volume balance ratio of the background music is reduced and the volume balance ratio of the main music is increased; by sliding the slider to the right close to the main music side, the volume balance ratio of the background music is increased and the volume balance ratio of the main music is reduced.
[0177] Based on the above-mentioned volume ratio adjustment component, the second interactive event for the volume adjustment area in the volume balance adjustment interface described in the above-mentioned step a2 may specifically include: a sliding operation event for the sliding part, and the sliding operation event is used to control the sliding part to slide within the sliding area.
[0178] In the embodiment of the present disclosure, through the intuitive sliding operation of the sliding part within the sliding area, the user can easily and quickly adjust the volume balance ratio of the main music and the background music without complicated settings or calculations, providing an intuitive and flexible volume balance ratio adjustment method, which greatly improves the user experience.
[0179] In some embodiments, in order to improve the convenience of interaction, a volume recovery control may also be provided on the aforementioned volume balance adjustment interface, and the volume recovery control may be implemented in the form of an icon, a button, etc. Based on the volume recovery control, the aforementioned volume balance ratio adjustment method may further include the following steps:
[0180] In response to a sixth interaction event for the volume recovery control, the playback volumes of the main music and the background music are determined according to the acquired current volume balance ratio.
[0181] Alternatively, in response to a sixth interaction event for the volume recovery control, the playback volumes of the main music and the background music are determined according to an initial volume balance ratio preset by the music playback program.
[0182] That is, the volume restoration control can be used to trigger the music playback program to set the volume balance ratio to the current volume balance ratio before the current volume balance adjustment, or can also be used to trigger the music playback program to directly set the volume balance ratio to the initialization volume balance ratio set within the program. In the specific setting process, when the user touches or selects the volume restoration control through an external input device, a sixth interactive event is generated to trigger the display of two restoration options, namely, restoration to the volume balance ratio before adjustment and restoration to the initialization volume balance ratio, so that the user can flexibly choose according to needs.
[0183] In the disclosed embodiment, by providing a volume recovery control, the user can quickly restore the volume balance ratio setting before adjustment after adjusting the volume balance ratio without having to manually adjust it again, which greatly improves the convenience and efficiency of operation and improves the overall user experience.
[0184] In some embodiments, based on the need to enhance user interaction experience and functional richness, the background music control interface includes a background music list, and the above-mentioned music playing method also includes the following steps: in response to a second selection event for the background music list, using the background music playing thread to play the background music selected by the second selection event.
[0185] The background music list can be displayed in the internal display area of the background music control interface, or above the interface layer, and can be triggered for display in any of the following ways: in response to the music playback program entering the setting mode, the background music control interface is displayed, wherein the background music list is displayed in the designated interface area of the background music control interface; or, in response to the seventh interactive event of the list display control set in the background music control interface, the background music list associated with the user's music account is displayed.
[0186] For the seventh interactive event of the list display control, that is, the interactive event generated by the user's interactive operation with the list display control through the background music control interface, it can be generated through touch operations such as the user directly touching the list display control, the user selecting the list display control through an external input device, and other protective operations.
[0187] The background music list provides optional background music that is obtained based on the user's music account, and may include background music preset by the music player program, and may also include background music added by the user. The user may select the background music that he or she wants to play in the background music list through external input device selection, finger touch, or other interactive methods, triggering a second selection event. When the music player program detects the second selection event, it calls the background music playback thread to process the background music playback request, that is, reads the audio data of the selected background music, and outputs it to the corresponding audio device for playback.
[0188] The background music list may include background music added by the user. This embodiment provides a method for users to upload their favorite background music. This method can be implemented through the following steps:
[0189] In response to a customized request for background music, a background music transmission interface is displayed; an audio file uploaded by a user through the background music transmission interface is received; the audio file is stored and updated to the background music list.
[0190] The custom request is used to indicate that the user adds an external audio file to the background music list. The request can be triggered by an interactive control or a specified interactive operation on the background music list or background music control interface. For example, a button, menu item or link of "Add background music" can be set, and the user selects "Add background music" to trigger the custom request.
[0191] The background music transmission interface is used to receive audio files uploaded by users. It can include interface elements such as file selection box and upload progress bar, allowing users to select the audio files they want to upload from the local device. The external audio files to be uploaded can be in common audio formats such as MP3 and WAV.
[0192] like Figure 3 An exemplary diagram of the user-defined interface interaction for uploading background music is shown. The background music transmission interface includes a file selection box and an upload button. After the user selects the audio file through the file selection box, he clicks the "Upload" option, and the system starts to receive the audio file uploaded by the user; after the audio file is successfully uploaded, the music player saves it to the preset background music storage database for subsequent use; the newly uploaded audio file information such as file name, path, etc. is added to the data structure of the background music list, and the display on the interface is updated so that the user can instantly see the newly added background music.
[0193] Suppose a user is using a music application that supports custom background music and finds that his favorite sound of ocean waves is missing from the background music list. The user clicks the "Add Background Music" button and the music application pops up a background music transfer interface. The user browses the local files in the file selection box and selects the audio file of ocean wave sound and clicks the "Upload" button, and the music application starts receiving and verifying the audio file. After the file is successfully uploaded, the music application automatically saves it to the music library of the server and updates the interface display of the background music list, so that the user can see the background music option of "Ocean Wave Sound" in the background music list and can choose to play it.
[0194] In the embodiments of the present disclosure, a user upload function is provided to allow users to upload their favorite background music, thereby greatly enhancing the user's personalized experience.
[0195] Next, in order to further improve the user experience and simplify the process of adding the user's favorite music to the background music list, this embodiment provides a more convenient way to add background music, which may include the following steps b1-b3:
[0196] b1, in response to a music retrieval event, determining that the music retrieval event retrieves target music;
[0197] A music search event is an event in which a user triggers the search function of a music player program to find specific music by inputting information such as keywords, song names, and singer names. In response to the music search event, the music player program retrieves one or more pieces of music that match the user's query intent from a database or online music service based on the keywords and other information input by the user.
[0198] For example, a user enters a keyword in the search bar of a music player program and clicks the search button, or triggers the search function through other interactive methods such as voice search, generating a music retrieval event; the program receives the search keyword entered by the user, and based on the keyword, executes a search query in the local database or online music service API. After the query results are returned, the program parses and displays a list or details related to the target music.
[0199] b2, in response to the music collection event for the target music, displaying a user music list selection page; the user music list selection page at least includes background music options and main music options;
[0200] The music collection event refers to an interactive event in which the user expresses interest in the retrieved target music and adds it to the music list associated with the music account. In response to the music collection event, a music list selection page is provided to provide multiple music list options, allowing the user to select which list to add the music to. In this embodiment, at least background music options and main music options are included to meet different classification requirements of users.
[0201] The music collection event can be generated by any user operation: when the display interface of the retrieved target music includes an interactive control representing "collection", a selection operation on the interactive control is detected, such as the user touching the interactive control or selecting the interactive control through an external input device, then a music collection event is generated; the preset "long press operation" is used to trigger the music collection operation, then a music collection event is generated when a user's long press operation on the target music is detected.
[0202] For example, when the user is viewing the details of song C, he clicks the "Favorites" button, and the application pops up a user music list selection page, which lists two options: "Background Music" and "Main Music".
[0203] b3, in response to the eighth interaction event for the background music option, adding the target music to the background music list of the music playing program.
[0204] The eighth interactive event for the background music option, in this context, refers to a specific interactive event performed by the user for the background music option on the user music list selection page, which can be triggered by interactive operations such as clicking and checking to confirm adding the target music to the list.
[0205] When the application detects an interaction event of the user with respect to a background music option, the application adds information of the target music such as ID, name, path, etc. to the background music list database of the user according to the user's selection.
[0206] For example, on the user music list selection page, the user selects the "background music" option by clicking or checking. After the application detects this interaction event, it adds the information of song C to the user's background music list database. Later, the user returns to the background music list page and can see that song C has been successfully added to the list.
[0207] In the disclosed embodiment, by directly selecting from the music search results and adding to the background music list, the entire adding process is smooth, and the intuitive operation method reduces the user's learning cost and greatly improves the convenience of operation and user experience satisfaction.
[0208] In some embodiments, in order to further enhance the user experience, this embodiment introduces a timed play function, so that users can set the background music to play automatically within a specific time period according to their personal preferences without manual operation, thereby providing users with a more intelligent and personalized music experience. The timed play function can be implemented in the following ways:
[0209] Display a timing interaction interface for setting the timed playback of background music; respond to a setting event through the timing interaction interface, set the timing parameters of the background music playback, so that the background music is automatically played within the set timed playback time period.
[0210] The timer interaction interface provides users with the function of setting parameters related to timed playback. The timer interaction interface may include, but is not limited to, time selectors, repetition mode settings (such as every day, a specific day of the week, etc.), and other parameter options, so that users can flexibly configure according to their needs. The timer interaction interface can be displayed through the following various interaction logics:
[0211] A timing control is set on the interactive interface related to the background music configured in the set playback mode (such as the background music control interface, the background music playback theme interface, etc.), and the timing interaction interface is displayed in response to an interaction event for the timing control; or, when entering the set playback mode and no timed playback is set, the timing interaction interface is displayed in response to the user's second selection event on the background music list, and further, the timing setting option of the timing interaction interface can be skipped to enable users who do not need to set timed playback to quickly enter the background music playback.
[0212] When the user sets the parameters for scheduled playback through the timer interactive interface, the music player program can respond to the user's operation in real time, receive and save the user's set timing parameters, which may include but are not limited to the start time and end time of playback, or the playback duration, etc. According to the user's set timing parameters, the music player program starts a timer task internally or uses the existing time scheduling mechanism to automatically run the background music playback thread and play the background music within the specified time period.
[0213] To better understand the above timing interaction interface, see Figure 4 A schematic diagram of a timed interactive interface for setting the timed playback of background music is shown schematically. The timed playback is used to achieve timed shutdown, that is, the background music automatically stops playing after a period of time. The time selector shown in the figure is used for the playback duration of the timed shutdown. Various playback durations are provided in advance for users to choose. Users can also set the playback duration of the timed shutdown by themselves through custom options, and complete the timing setting by interacting with the "OK" button. In addition, the timed interactive interface also includes an intelligent shutdown control for the sleep scene, which is used to detect the user's sleep state in real time and dynamically adjust the timed shutdown duration according to the sleep state during the process of falling asleep after the user sets the playback duration of the timed shutdown. For the sake of musicality and listening, the timed interactive interface also provides the option of "playing the whole song before stopping", that is, when the preset playback duration of the timed shutdown is reached, if the current background music has not been played, it will continue to play until the background music is played completely.
[0214] In the disclosed embodiment, by allowing the user to set the automatic playing time of music according to personal preferences and schedules, the convenience and comfort of the user when using background music are enhanced. The user can enjoy the pleasure brought by music at the desired time without frequent manual operations, thereby improving the overall user experience.
[0215] In some embodiments, based on the present application for realizing superimposing background music on main music to enrich the user's listening experience, in order to improve the coordination and coordination of audio playback, this embodiment introduces a playback status synchronization mechanism between the main music and background music playback threads, and a synchronization mechanism is pre-set between the main music playback thread and the background music playback thread, so that when the playback status of the main music played by the main music playback thread changes, the changed main music playback status is synchronized to the background music playback thread through the synchronization mechanism; wherein, the playback status of the main music includes any one of a playback status and a paused status; using the background music playback thread, the playback status of the background music is set to be consistent with the changed main music playback status.
[0216] For example, in a music player program, the main music and background music are playing simultaneously. When the user switches the main music from playing to paused state through the main music player interface, the main music player thread detects that the playing state has changed from "playing" to "paused", and notifies the background music player thread of the "pause" state through a pre-set synchronization mechanism; after receiving the synchronization signal, the background music player thread checks that the current playing state of the main music is "paused", and adjusts the playing state of the background music accordingly, so that it also enters the "pause" state. At this point, the playing states of the main music and the background music remain consistent, both in the "pause" state. If the user subsequently resumes the main music through the main music player interface again, the same synchronization mechanism processing process is adopted, and the background music player thread will also resume the playing of the background music accordingly.
[0217] In the embodiments of the present disclosure, by introducing a synchronization mechanism, the state changes of the main music playback thread can be monitored in real time, and the state changes can be immediately transmitted to the background sound playback thread. When the playback state of the main music changes from play to pause, or resumes from pause, the background sound playback thread can respond quickly and adjust its playback state to ensure the synchronization between the two, making audio playback more intelligent and automated, thereby meeting users' demand for high-quality audio experience.
[0218] In some embodiments, see Figure 5 A logical schematic diagram of an interface interaction entering a set play mode is shown. The preset mode control for entering the set play mode can be set on the main music play interface, and it can be embedded in the main music play interface in the form of a menu item. Under the setting method of the preset mode control, the music play program first displays the main music play interface, and responds to the interaction event of the preset mode control on the main music play interface. The music play program is controlled to enter the set play mode. When the background music control interface is displayed, the background music control interface can be controlled to be superimposed on the layer of the main music play interface.
[0219] The background music control interface is displayed on top of the main music playback interface, that is, a new layer is added to display the background music control interface on top of the existing main music playback interface, and the two interfaces maintain a certain hierarchical relationship visually. The user summary segment screen can be regarded as a two-dimensional plane. The Z axis perpendicular to the screen and pointing to the user's vision represents the depth of the layer. The main music playback interface is located in a lower layer (lower Z value), while the background music control interface is located in a higher layer (higher Z value). When both are displayed at the same time, the background music control interface will cover the main music playback interface. The superimposed interface can have different transparency settings so that users can vaguely see the interface elements of the lower layer.
[0220] In some embodiments, the interactive settings for the background music control interface may also include the following interactive operations:
[0221] In response to a closing event for the background music control interface, maintaining the life cycle state of the background music playing thread;
[0222] In response to an exit event for the background music control interface, releasing resources of the background music playing thread;
[0223] The background music control interface is removed from the interface layer of the music playing program.
[0224] That is, the close event is used to keep the music playback program in the set playback mode, hide or minimize the background music control interface without changing the background music playback thread to play the background music, so that the user can return to the upper interface of the background music control interface, such as the main music playback interface, to perform other interactive operations; the exit event is used to control the music playback program to exit the set playback mode, stop the background music playback, release the related resources of the background music playback thread, and destroy the scheduling resources related to the set playback mode.
[0225] Based on the control described in the above embodiment, the background music control interface is superimposed and displayed on the layer of the main music playback interface. In response to the close event or the exit event, the background music control interface is removed from the interface layer of the main music playback interface to continue to display the main music playback interface.
[0226] The closing event and exit event of the background music control interface can be triggered by interactive operations on the closing control and exit control set on the background music control interface to generate corresponding closing events and exit events. Figure 6 The schematic diagram of an exemplary background music control interface with a close control and an exit control is shown. The close control is set on the left side of the interface, and the exit control is set on the right side. When the user touches the close control, the close event is triggered, and when the user touches the exit control on the right side, the exit event is triggered. In addition, the close event and the exit event can also be triggered by other interactive methods, such as clicking on an area outside the background music control interface on the user's screen to trigger a close event, and performing a two-finger swipe on a blank area in the background music control interface to trigger an exit event, which is not limited in this application.
[0227] In some embodiments, in order to provide users with a more immersive music experience, for each preset background music in the music player program, a theme image and a control style matching the background music are pre-stored in a resource library of the music player program.
[0228] The theme picture matched to the background music refers to an image closely related to the style, emotion or theme of the currently playing background music. The image can intuitively convey the atmosphere or emotion of the music, allowing the user to visually feel the characteristics of the music.
[0229] The control style refers to the appearance of various control elements on the music playback interface (such as the play / pause button, the name icon of the background music, the next / previous button, etc.). The control style that matches the background music will be adjusted according to the style of the music to ensure that the visual style and user experience of the entire interface are consistent with the music.
[0230] For example, if the background music being played is white noise of burning flames, the image can be an orange-toned campfire picture, and the corresponding control style can be set to different styles of spark styles for different controls; for example, if the background music currently being played is the sound of waves, the image can be a blue-toned ocean picture, and the corresponding control style can be set to different styles of wave styles; if the background music currently being played is the sound of birds singing in the forest, the image can be a green-toned forest picture, and the corresponding control style can be set to different styles of flowers and plants.
[0231] Based on the above theme image and control style, when background music is played using the background music playing thread, the updating of the background music control interface described in the above step S103 may at least include the following content updates:
[0232] Obtain a theme image and a control style that matches the background music being played by the background music playback thread; control the display of the theme image on the background music control interface, and apply the obtained control style to each control on the background music control interface.
[0233] That is, the music playback program identifies the currently playing background music, retrieves the theme image and corresponding control style of the currently playing background music from the resource library, displays the retrieved theme image in the background area of the background music control interface, and applies the acquired control style to each control on the interface, so that the appearance of the control conforms to the matching control style and is consistent with the theme image style.
[0234] For example, see Figure 7 The application shown is a schematic diagram of the background music control interface that matches the theme picture and control style of the background music. The background music playback thread is playing white noise of burning flames. At this time, the background image displayed on the background music control interface is an orange-toned campfire picture, and the corresponding control style is changed from the ambient sound icon (i.e., the name icon of the background music) in the figure to a spark style, so that the played background music, theme picture, and control style match each other, allowing users to visually enjoy an immersive experience that matches the music style.
[0235] For background music added to the background music list by users, the resource library of the music player program also stores a large number of picture sets of different styles and various other control styles. When the background music player thread plays the background music added by the user, it can automatically match highly relevant pictures and control styles from the picture set according to the music style or emotional type of the background music added by the user, and apply and display them on the background music control interface.
[0236] In the disclosed embodiments, by displaying theme pictures and preset interactive controls that match the music style, users can feel the emotion and atmosphere of the music more deeply, thereby enhancing the emotional experience and user stickiness.
[0237] In some embodiments, when a theme picture matching the background picture is displayed on the background music control interface, the method may further include the step of implementing a theme picture switching animation when the background music is switched:
[0238] In response to a sliding operation event on the background music control interface, the background music played by the background music playing thread is switched; and an animation effect of transitioning from a theme picture of the currently playing background music to a theme picture of the next background music is displayed.
[0239] The sliding operation event refers to the sliding operation performed by the user on the background music control interface through the touch screen or external input device, such as sliding from left to right, sliding from top to bottom, or sliding in any direction. The sliding operation event is used to trigger the background music playback thread to switch the background music being played, that is, to switch the currently playing background music to the next music to be played in the background music list. The music to be played can be the previous or next music in the background music list. The specific mapping relationship between the sliding direction of the sliding operation and the background music sorting can be determined.
[0240] For example, it is pre-set that when the user swipes to the right, it automatically switches to the previous track of the current background music in the background music list. Conversely, if the user swipes to the left, it switches to the next track of the current background music. For another example, it is set that swiping upward switches to the next track of the current background music, and swiping downward switches to the previous track of the current background music. Or, for scenes where frequent switching to the previous background music is not required, it can also be defined that any sliding direction switches to the next track of the current background music to simplify the operation process.
[0241] When the music playing program captures a sliding operation event on the background music control interface, it determines whether the switching conditions for background music switching are met (sliding to a specified position or sliding continuously for a period of time) based on the sliding direction and sliding distance / time. If the switching conditions are met, an instruction is sent to the background music playing thread to make the background music playing thread stop playing the current music and start playing the next music to be played.
[0242] While switching the background music, the music playing program prepares a transition animation of the theme picture of the background music. By detecting the sliding position of the sliding operation event on the background music control interface in real time, and then calculating the display ratio of the theme pictures of the two background music according to the sliding position, the two pictures are synthesized into a corresponding transition image according to the calculated ratio using image processing technology (such as interpolation, mixing, etc.), and then the transition image is rendered to the theme picture display area on the background music control interface. As the sliding progresses, the transition image will change continuously until it is completely displayed as the theme picture of the new music, thereby achieving a transition animation effect of the theme picture.
[0243] For example, see Figure 8 The schematic diagram of the animation effect of the transition of the theme picture when the background music is switched is shown as an example. The background music currently being played by the user using the music player APP is the sound of rain, and the theme picture displayed is a picture of raindrops in a blue-green tone. When the user slides the screen from right to left with his finger, the music player APP detects the sliding operation, determines that the user intends to switch to the next background music such as white noise of burning flames, and obtains the theme picture of the next music as an orange-toned campfire picture. The figure shows the animation effect of the theme picture of the current background music and the theme picture of the next background music each occupying half of the transition image when sliding to the middle part of the screen. As the user's finger continues to slide from right to left, the display proportion of the blue-green-toned raindrop picture on the left will continue to decrease, while the display proportion of the orange-toned campfire picture on the right will continue to increase. When the sliding operation and the background music switching are completed, the entire screen only displays the theme picture of the next music, that is, the orange-toned campfire picture.
[0244] In the disclosed embodiments, by directly associating the user's sliding operation with the switching of theme pictures, and by detecting the sliding position in real time and calculating the display ratio of the theme pictures accordingly, a smooth transition from the theme picture of one piece of music to the theme picture of the next piece of music is achieved, so that the user can not only switch music by sliding, but also intuitively see the animation effect of the smooth transition of theme pictures related to the music, so that when the user switches background music, the visual experience is more continuous and smooth, the discomfort caused by sudden changes in the interface is reduced, the interactive fun between the user and the interface is increased, and the user is more easily immersed in the atmosphere of music playback, thereby improving the overall user experience.
[0245] Next, in order to enable those skilled in the art to better understand the music playing method provided by the present application, this embodiment combines Fig. 9 The interaction flow diagram shown, taking the interaction triggering method of setting UI interaction controls on various interaction interfaces of the music playback APP as an example, exemplifies the music playback method of the present application.
[0246] In this embodiment, an entry to the background music playback mode (i.e., set playback mode) is pre-set on at least one program interface such as the homepage interface, personal center interface, and main music playback interface of the music playback APP, such as setting a preset mode control. The user interacts with the preset mode control, such as touching or selecting the control through an external input device, thereby triggering the music playback APP to enter the background music playback mode.
[0247] After the user opens the music player app and enters the home page of the music player app, see Fig. 9 There are two ways to enter the background music playing mode:
[0248] 901a, first select the main music to play, then enter the background music playing mode: the user can first access the main music list through the home page interface or switch to the personal center interface, and in response to the main music selection operation on the main music list, a main music playing trigger event is generated, triggering the creation of the main music playing thread and the main music playing. Next, the music playing APP detects the user's interaction with the preset mode control, and controls the music playing APP to enter the background music playing mode;
[0249] 901b, directly enter the background music playback mode after opening the music playback APP: after opening the music playback APP, the user directly interacts with the preset mode control to trigger the music playback APP to enter the background music playback mode; in this way, the main music in the music playback APP has two states: based on the most recent historical playback, there is main music in the playing or paused state; based on the first login or the list is played and no new main music is selected, there is no main music in the playing or paused state.
[0250] In response to the music player APP entering the background music play mode, the music player APP displays the background music control interface, see Figure 8 Two layout display modes of the background music control interface are shown as examples:
[0251] 902a, the background music control interface may include a background music list display area and a confirmation control, directly displaying the background music list for the user to select, and indicating the completion of the background music selection through interaction with the confirmation control, thereby generating a background music playback trigger event.
[0252] 902b, or, the background music control interface may include a background music related information display area, a background music list list display control, and other optional controls such as a timing control, a main music list control, a volume control, etc. This layout may set two background music playing mechanisms, namely, an automatic playing mechanism triggered by entering a mode and a manual playing mechanism:
[0253] 9021, in a scenario where automatic background music playback is supported, the action of the music playback APP entering the background music playback mode triggers the music playback APP to automatically select a background music from multiple preset background musics, thereby generating a background music playback trigger event;
[0254] 9022, in the scenario of manually selecting to play background music, the user can access the background music list by interacting with the list display control of the background music list, select background music to generate a background music play trigger event.
[0255] 903, in response to the background music playback triggering event, maintain the lifecycle thread state of the main music playback thread, and create a background music playback thread, use the background music playback thread to play the background music indicated by the background music playback triggering event, and synchronously update the background music control interface.
[0256] Regarding the synchronous update of the background music control interface, in the layout mode in which the background music control interface described in 901b includes a background music related information display area, a background music list list display control, and other optional controls, the display content of the UI element can be updated, and the related information of the background music played by the background music playback thread is displayed in the related information display area, including but not limited to the music name, theme picture, source, play / pause status, etc. of the background music. For the layout mode in which the background music control interface described in 901a includes a background music list display area and a confirmation control, the UI elements of the background music control interface can be replaced and updated, and it can be updated to the updated interface under the above layout mode including the background music related information display area.
[0257] After the background music is played using the background music playing thread, the interaction process between the user and various UI interactive elements or controls on the background music control interface is described in the aforementioned embodiment, which will not be repeated in this embodiment.
[0258] In the disclosed embodiment, by maintaining the life cycle state of the main music playback thread and creating a background music playback thread, the user is allowed to flexibly add or adjust the background music without interrupting the main music playback, thereby achieving parallel playback of the main music and background music, thereby creating a richer and multi-layered auditory experience for the user, achieving a personalized music playback experience, and meeting the diverse needs of users.
[0259] Exemplary Devices
[0260] After introducing the method of the exemplary embodiment of the present invention, next, refer to Fig.10 A device according to an exemplary embodiment of the present invention is described.
[0261] The implementation process of the functions and effects of each module in the following device is specifically described in the implementation process of the corresponding steps in the above method, which will not be repeated here. For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can be referred to the partial description of the method embodiment.
[0262] Fig.10 A music playing device according to an embodiment of the present invention is schematically shown, which is applied to a music playing program, and the device comprises:
[0263] The interface display module 1001 is used to display the background music control interface in response to the music playing program entering the set playing mode;
[0264] The background music playing module 1002 is used to respond to the background music playing trigger event, maintain the life cycle state of the main music playing thread and create a background music playing thread; use the background music playing thread to play background music and update the background music control interface.
[0265] In some embodiments, the set play mode is entered when there is main music in the music playback program that is being played or paused; or, the set play mode is entered when there is no main music in the music playback program that is being played or paused; the device also includes: in response to a playback trigger event of the main music, using the main music playback thread to play the corresponding main music.
[0266] In some embodiments, the background music control interface includes a main music list control; the device also includes: in response to a first interaction event with the main music list control, displaying a main music list associated with a user's music account; in response to a first selection event with respect to the main music list, using the main music playback thread to play the main music selected by the first selection event.
[0267] In some embodiments, when the main music is in the playing or paused state and enters the set playback mode, the device also includes: based on the style matching method, selecting background music that matches the music style of the main music from multiple preset background music, and using the background music playback thread to play the matching background music.
[0268] In some embodiments, before playing the background music, the device also includes: obtaining the global system volume; the global system volume refers to the audio output volume of the user terminal running the music playback program; determining the playback volume of the main music and the background music based on a preset initial volume balance ratio and the global system volume.
[0269] In some embodiments, the device also includes: in response to a volume adjustment request event, obtaining a current volume balance ratio currently applied by the music playback program, and displaying a volume balance adjustment interface; in response to a second interaction event for a volume adjustment area in the volume balance adjustment interface, calculating a new volume balance ratio according to an operation position of the second interaction event; in response to a confirmation trigger event of a volume adjustment, redetermining the playback volume of the main music and the background music according to the new volume balance ratio.
[0270] In some embodiments, the volume adjustment request event includes: a third interaction event for the volume control on the background music control interface; or a fourth interaction event generated by performing a first specified interaction operation on a non-control area on the background music control interface.
[0271] In some embodiments, the volume adjustment area is provided with a volume ratio adjustment component, including a sliding portion and a sliding area; a first boundary and a second boundary of the volume ratio are correspondingly provided on both sides of the sliding area; the sliding portion is slidably provided between the first boundary and the second boundary; in response to the sliding portion sliding toward the side close to the first boundary, the volume balance ratio of the background music is reduced and the volume balance ratio of the main music is increased; in response to the sliding portion sliding toward the side close to the second boundary, the volume balance ratio of the background music is increased and the volume balance ratio of the main music is reduced.
[0272] In some embodiments, the second interaction event for the volume adjustment area in the volume balance adjustment interface includes: a sliding operation event for the sliding part, and the sliding operation event is used to control the sliding part to slide within the sliding area.
[0273] In some embodiments, the volume balance adjustment interface includes a confirmation control for determining to modify the volume balance ratio, and the confirmation triggering event of the volume adjustment includes: a fifth interaction event for the confirmation control;
[0274] The device also includes: in the case where the fifth interaction event for the confirmation control is not detected, in response to the exit event of the volume balance adjustment interface, determining the playback volume of the main music and the background music according to the acquired current volume balance ratio.
[0275] In some embodiments, no confirmation control for determining to modify the volume balance ratio is provided on the volume balance section interface, and the confirmation triggering event of the volume adjustment includes: an exit event of the volume balance adjustment interface; or, the operation of the second interactive event ends.
[0276] In some embodiments, the volume balance adjustment interface further includes a volume restoration control; the device further includes:
[0277] In response to a sixth interaction event for the volume recovery control, the playback volumes of the main music and the background music are determined according to the acquired current volume balance ratio.
[0278] Alternatively, in response to a sixth interaction event for the volume recovery control, the playback volumes of the main music and the background music are determined according to an initial volume balance ratio preset by the music playback program.
[0279] In some embodiments, the background music control interface includes a background music list, and the device further includes:
[0280] In response to a second selection event for the background music list, the background music selected by the second selection event is played using the background music playing thread.
[0281] In some embodiments, the background music list is displayed in any of the following ways:
[0282] Controlling the display of the background music list on the background music control interface; or, in response to the seventh interactive event of the list display control set in the background music control interface, displaying the background music list associated with the user's music account.
[0283] In some embodiments, the device also includes: displaying a background music transmission interface in response to a customized request for background music; receiving an audio file uploaded by a user through the background music transmission interface; storing the audio file and updating the audio file to the background music list.
[0284] In some embodiments, the device also includes: in response to a music retrieval event, determining that the music retrieval event has retrieved target music; in response to a music collection event for the target music, displaying a user music list selection page; the user music list selection page includes at least a background music option and a main music option; in response to an eighth interaction event for the background music option, adding the target music to the background music list.
[0285] In some embodiments, the apparatus further comprises:
[0286] In response to a ninth interaction event for a preset mode control, the music player program is controlled to enter the set play mode; or, in response to a preset system button event, the music player program is controlled to enter the set play mode; or, in response to a tenth interaction event generated by performing a second specified interaction operation on a non-control interface area in the music player program, the music player program is controlled to enter the set play mode; wherein the tenth interaction event includes at least one of a double-click operation event and a long press operation event.
[0287] In some embodiments, a synchronization mechanism is set between the main music playback thread and the background sound playback thread, and the device also includes: in response to a change in the playback state of the main music played by the main music playback thread, synchronizing the changed main music playback state to the background sound playback thread through the synchronization mechanism; the playback state of the main music includes any one of a playback state and a pause state; and using the background sound playback thread, setting the playback state of the background music to be consistent with the changed main music playback state.
[0288] In some embodiments, the device further includes: displaying a main music playback interface; the interface display module is specifically used to: control the display of the background music control interface superimposed on the layer of the main music playback interface.
[0289] In some embodiments, for each preset background music, the resource library of the music playback program stores a theme image and a control style that match the background music; when the background music playback module is used to update the background music control interface, it includes: obtaining a theme image and a control style that match the background music being played by the background music playback thread; controlling the display of the theme image on the background music control interface, and applying the obtained control style to each control on the background music control interface.
[0290] In some embodiments, the device also includes: a switching module, which is used to switch the background music played by the background music playback thread in response to a sliding operation event on the background music control interface; and a dynamic display module, which is used to display the animation effect of transitioning from the theme picture of the currently playing background music to the theme picture of the next background music.
[0291] In some embodiments, the dynamic display module is specifically used to: detect the sliding position of the sliding operation event on the background music control interface in real time; calculate the display ratio of the theme pictures of the two background music according to the sliding position, and synthesize the corresponding transition image; render the transition image to the theme picture display area on the background music control interface.
[0292] Exemplary Media
[0293] After introducing the method and apparatus of the exemplary embodiment of the present invention, next, reference is made to Fig.11 A readable storage medium according to an exemplary embodiment of the present invention is described.
[0294] In this exemplary embodiment, the above method can be implemented by a program product, such as a portable compact disk read-only memory (CD-ROM) and including program code, and can be run on a device, such as a personal computer. However, the program product of the present invention is not limited to this. In this document, a readable storage medium can be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, an apparatus or a device.
[0295] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or 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.
[0296] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a 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.
[0297] The program code contained on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RE, etc., or any suitable combination of the foregoing.
[0298] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as C or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user computing device, partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).
[0299] Exemplary Computing Devices
[0300] After introducing the method, apparatus and medium of the exemplary embodiments of the present invention, next, reference is made to Fig.12 A computing device according to an exemplary embodiment of the present invention is described.
[0301] Fig.12 The computing device 1200 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0302] like Fig.12 As shown, the computing device 1200 is in the form of a general computing device. The components of the computing device 1200 may include but are not limited to: at least one processing unit 1201, at least one storage unit 1202, and a bus 1203 connecting different system components (including the processing unit 1201 and the storage unit 1202).
[0303] The bus 1203 includes a data bus, a control bus, and an address bus.
[0304] The storage unit 1202 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 12021 and / or a cache memory 12022 , and may further include a readable medium in the form of a non-volatile memory, such as a read-only memory (ROM) 12023 .
[0305] The storage unit 1202 may also include a program / utility 12025 having a set (at least one) of program modules 12024, such program modules 12024 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0306] The computing device 1200 may also communicate with one or more external devices 1204 (eg, a keyboard, pointing device, etc.).
[0307] Such communication may be performed via input / output (I / O) interface 1205. In addition, computing device 1200 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via network adapter 1206. Fig.12 As shown, the network adapter 1206 communicates with other modules of the computing device 1200 via the bus 1203. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the computing device 1200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0308] Although the spirit and principle of the present invention have been described with reference to several specific embodiments, it should be understood that the present invention is not limited to the disclosed specific embodiments, and the division of various aspects does not mean that the features in these aspects cannot be combined to benefit, and such division is only for the convenience of expression. The present invention is intended to cover various modifications and equivalent arrangements included in the spirit and scope of the attached claims.
Claims
1. A music playing method, characterized in that: Applied to a music playing program, the method comprises: In response to the music playing program entering a set playing mode, displaying a background music control interface; In response to the background music playback trigger event, maintain the life cycle state of the main music playback thread and create a background music playback thread; The background music playing thread is used to play the background music, and the background music control interface is updated.
2. The method according to claim 1, characterized in that Before playing the background music, the method further includes: Obtaining a global system volume; the global system volume refers to the audio output volume of the user terminal running the music player program; The playback volumes of the main music and the background music are determined according to the preset initial volume balance ratio and the global system volume.
3. The method according to claim 1, characterized in that The method further comprises: In response to a volume adjustment request event, obtaining a current volume balance ratio currently applied by the music player program, and displaying a volume balance adjustment interface; In response to a second interaction event for the volume adjustment area in the volume balance adjustment interface, calculating a new volume balance ratio according to an operation position of the second interaction event; In response to a confirmation trigger event of the volume adjustment, the playback volumes of the main music and the background music are re-determined according to the new volume balance ratio.
4. The method according to claim 3, characterized in that The volume adjustment area is provided with a volume ratio adjustment component, including a sliding portion and a sliding area; the first boundary and the second boundary of the volume ratio are correspondingly provided on both sides of the sliding area; the sliding portion is slidably provided between the first boundary and the second boundary; In response to the sliding portion sliding toward the side close to the first boundary, reducing the volume balance ratio of the background music and increasing the volume balance ratio of the main music; In response to the sliding portion sliding toward the side close to the second boundary, the volume balance ratio of the background music is increased and the volume balance ratio of the main music is decreased.
5. The method according to claim 1, characterized in that A synchronization mechanism is provided between the main music playing thread and the background sound playing thread, and the method further comprises: In response to a change in the playing state of the main music played by the main music playing thread, the changed playing state of the main music is synchronized to the background music playing thread through the synchronization mechanism; the playing state of the main music includes any one of a playing state and a paused state; The background music playing thread is utilized to set the playing state of the background music to be consistent with the changed main music playing state.
6. The method according to claim 1, characterized in that For each preset background music, the resource library of the music playing program stores a theme image and a control style matching the background music; The updating of the background music control interface includes: Get the theme image and control style that matches the background music being played by the background music playing thread; The theme image is displayed on the background music control interface, and the acquired control style is applied to each control on the background music control interface.
7. The method according to claim 6, characterized in that The method further comprises: In response to a sliding operation event on the background music control interface, switching the background music played by the background music playing thread; Displays the animation effect of transitioning from the theme image of the currently playing background music to the theme image of the next background music.
8. A music playing device, characterized in that: Applied to a music playing program, the device comprises: An interface display module, for displaying a background music control interface in response to the music playing program entering a set playing mode; The background music playing module is used to respond to the background music playing trigger event, maintain the life cycle state of the main music playing thread and create a background music playing thread; use the background music playing thread to play background music and update the background music control interface.
9. A readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. A computing device, characterized in that include: Processor, memory; The memory is used to store computer programs; The processor is configured to execute the method according to any one of claims 1 to 7 by calling the computer program.
