Role-based song generation and playback control method, apparatus, device and medium
By receiving instructions and matching and mapping them with audio and character status data, characterized broadcast content or AI songs are generated. This solves the problem of low flexibility and character adaptability of music output content in smart devices, realizes unified control over character setting, music playback and generation, and enhances the interactive immersion.
Patent Information
- Application Number
- CN202611294991.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-25
- Publication Date
- 2026-11-10
AI Technical Summary
The music output content of existing smart devices has low flexibility and role adaptability. AI-generated songs are difficult to deeply integrate with role-based interaction scenarios, which affects the flexibility and role adaptability of song generation and playback functions in smart devices.
By receiving playback or creation instructions from users, identifying request events and assigning priority parameters, and combining the current audio playback status and character status data for matching and mapping, characterized broadcast content or AI songs are generated, achieving unified control over character setting, music playback and generation.
It improves the consistency between music playback and generated content and character design, enhances the flexibility and character adaptability of music output, and strengthens the interactive immersion.
Smart Images

Figure CN123067719A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method, apparatus, device, and medium for character-based song generation and playback control. Background Technology
[0002] Currently, devices with music playback and voice interaction functions, such as smart voice terminals and companion smart toys, are rapidly becoming more widespread. At the same time, role-based companion interaction is gradually becoming an important development direction for smart terminals. That is, users' demand for audio content is no longer limited to general on-demand playback, but they expect to obtain a more immersive role-based audio experience.
[0003] Most existing smart terminals still use a general resource library on-demand mode for music functions. Some devices with character IPs only bind the character to a fixed resource, which cannot adapt to dynamic changes during the interaction process. With the rise of generative AI, although music generation can be achieved based on user commands, AI-generated songs are often independent of the current interactive character and are difficult to deeply integrate with the character-based interaction scenario, affecting the flexibility and character adaptability of song generation and playback functions in smart devices. Summary of the Invention
[0004] The main objective of this invention is to provide a method, apparatus, device, and medium for song generation and playback control based on roles, aiming to solve the problem that the flexibility and role adaptability of music output content of smart devices are both low in the prior art.
[0005] The technical solution of the present invention is as follows: The first aspect of this invention provides a role-based song generation and playback control method, comprising: Receive playback or creation instructions input by the user, identify the request event of the playback or creation instructions, and assign corresponding priority parameters; Obtain the current audio playback status, and determine whether to interrupt playback based on the current audio playback status and the priority parameter of the current request event. If yes, execute the playback command or creation command; otherwise, add the command to the waiting queue. Obtain the character status data of the current interactive character, and match and map the character status data with candidate music resources to obtain the target music resource set and the singing style parameter set; If the playback command is executed, the target song is located in the target music resource set and the character-specific broadcast content is generated by combining the character status data. The character-specific broadcast content and the target song are played in sequence. If the creation instruction is executed, song control parameters are generated based on the creation information input by the user, the character status data, and the singing style parameter set. Based on the song control parameters, a corresponding AI song is generated and played.
[0006] A second aspect of the present invention provides a role-based song generation and playback control device, comprising: The instruction receiving module is used to receive playback instructions or creation instructions input by the user, identify the request events of the playback instructions or creation instructions, and assign corresponding priority parameters. The interruption control module is used to obtain the current audio playback status, and determine whether to interrupt playback based on the current audio playback status and the priority parameter of the current request event. If so, the playback instruction or creation instruction is executed; otherwise, the instruction is added to the waiting queue. The status music mapping module is used to obtain the character status data of the current interactive character, and match and map the character status data with candidate music resources to obtain the target music resource set and the singing style parameter set; The first execution module is used to, if the playback instruction is executed, locate the target song in the target music resource set and generate character-based broadcast content in combination with the character status data, and play the character-based broadcast content and the target song in sequence; The second execution module is used to generate song control parameters based on the creation information input by the user, the character status data, and the singing style parameter set if the creation instruction is executed, and to generate and play the corresponding AI song based on the song control parameters.
[0007] A third aspect of the present invention provides a computer device including at least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, which enables the at least one processor to perform the above-described role-based song generation and playback control method.
[0008] A fourth aspect of the present invention provides a computer-readable storage medium storing computer-executable instructions that, when executed by one or more processors, cause the one or more processors to perform the above-described role-based song generation and playback control method.
[0009] Beneficial Effects: This invention discloses a method, apparatus, device, and medium for character-based song generation and playback control. Compared to existing technologies, this invention receives playback or creation commands, identifies request events, and assigns priority parameters. It then combines the current audio playback status with the priority parameters to determine whether playback should be interrupted; if so, the command is executed; otherwise, the command is added to the playback queue. Character status data is acquired and matched with candidate music resources to obtain a set of target music resources and a set of singing style parameters. When executing a playback command, the target song is located and character-specific announcement content is generated, followed by sequential playback of the character-specific announcement content and the target song. When executing a creation command, song control parameters are generated, and the corresponding AI song is generated and played. This invention achieves unified control over character settings, music playback, and generation, improving the consistency between music playback and generated content and character settings, enhancing the flexibility and adaptability of music output, and strengthening interactive immersion. Attached Figure Description
[0010] To more clearly illustrate the solutions in this invention, the accompanying drawings used in the description of the embodiments of this invention will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0011] Figure 1 A schematic diagram of an application environment for the role-based song generation and playback control method provided in an embodiment of the present invention; Figure 2 A flowchart of a role-based song generation and playback control method provided in an embodiment of the present invention; Figure 3 A schematic diagram of the functional modules of the role-based song generation and playback control device provided in an embodiment of the present invention; Figure 4 A schematic diagram of the hardware structure of a computer device provided in an embodiment of the present invention. Detailed Implementation
[0012] To make the objectives, technical solutions, and effects of this invention clearer and more explicit, the invention is further described in detail below. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. The embodiments of the invention are described below in conjunction with the accompanying drawings.
[0013] The role-based song generation and playback control method provided in this embodiment of the invention can be applied to, for example... Figure 1The illustrated intelligent agent interaction scenario with a hardware carrier includes a terminal device 101, an intelligent terminal 102 bound to the target intelligent agent, a network 103, and a server 104. The network 103 serves as a medium to provide a communication link between the terminal device 101, the intelligent terminal 102, and the server 104. The network 103 can include various connection types, such as wired and / or wireless communication links (e.g., Bluetooth, Wi-Fi, NFC, etc.).
[0014] Users can use terminal device 101 and smart terminal 102 to interact with server 104 via network 103 to receive or send messages, etc. Terminal device 101 may have a client installed that supports virtual scenarios. For example, when the virtual scenario is pet companionship, the client could be a virtual pet application. Users can log in to the client to view, edit, or control the interactions of the bound target intelligent agent in the virtual scenario (this is just an example). Terminal device 101 can be various electronic devices with a display screen and web browsing support, including but not limited to smartphones, tablets, and desktop computers.
[0015] The smart terminal 102, bound to the target intelligent agent, serves as a real-world interaction medium between the user and the target intelligent agent. It can sense the user's close-range touch, shaking, and movement in real time and associate them with corresponding interactive events. The smart terminal 102 can be a desktop smart ornament, smart speaker, etc., integrating motion sensing and near-field communication recognition functions. It can also work with different toy carriers, such as plush toys, desktop ornaments, and doll pendants. Character tags are set inside the toy carriers. The smart terminal 102 can read these tags through near-field communication and, based on the reading results, perform seamless switching operations for character recognition, resource switching, and session migration, realizing a convenient multi-character switching interaction process. Furthermore, the smart terminal 102 can also come into contact with physical plot triggering media, such as plot badges, plot base modules, plot keychains, or any automatically recognizable plot triggering items, to read plot-related information stored in the physical medium. This allows the interaction mode with the intelligent agent to switch from ordinary chat mode to plot mode, realizing an immersive plot interaction scenario.
[0016] Server 104 can be a server that provides various services, such as a backend server that supports the content browsed by users using terminal device 101 and smart terminal 102 (this is just an example). The backend server can analyze and process data such as received user requests, and feed the processing results back to the user through terminal device 101 and smart terminal 102. Server 104 can be a cloud server, a server of a distributed system, or a server combined with blockchain.
[0017] It should be understood that the number of terminal devices 101, smart terminals 102, networks 103, and servers 104 mentioned above is merely illustrative. Depending on the implementation needs, there can be any number of terminal devices 101, smart terminals 102, networks 103, and servers 104. For example, a single user can correspond to one terminal device 101 and one smart terminal 102, and multiple users can achieve interactive linkage between target intelligent agents through the network.
[0018] like Figure 2 As shown, the role-based song generation and playback control method provided in this embodiment of the invention specifically includes the following steps: S201. Receive playback or creation instructions input by the user, identify the request event of the playback or creation instructions, and assign corresponding priority parameters.
[0019] In this embodiment, the smart terminal can receive user interaction commands, including playback commands and creation commands, through local voice acquisition, mobile APP distribution, built-in story program linkage, and other methods. Among them, playback commands are audio playback commands triggered by the user, such as requesting existing songs, switching tracks, and resuming song playback, while creation commands are custom creation commands triggered by the user, such as generating AI-customized songs, creating exclusive musical styles, and composing theme songs.
[0020] Upon receiving an instruction, the system first identifies the request event type, accurately distinguishing the current request's event type, such as an immediate stop / pause event, a plot tracking event, or an explicit on-demand event. Then, it assigns corresponding priority parameters to different types of request events based on preset multi-level priority rules. These priority parameters can be quantified values, with the magnitude corresponding to the request response priority, used for scheduling and determining response times in scenarios involving multiple concurrent requests or playback conflicts. For example, if a user voice inputs "play a goodnight song," it is identified as a playback request event and assigned the corresponding priority parameter; if a user voice inputs "help me write a children's song related to spring," it is identified as a creation request event and assigned the corresponding priority parameter.
[0021] This embodiment standardizes and quantifies the priority of instructions, providing quantitative data for subsequent playback interruption determination and multi-instruction scheduling, thus avoiding response chaos caused by the mixing of multiple types of instructions.
[0022] S202. Obtain the current audio playback status, and determine whether to interrupt playback based on the current audio playback status and the priority parameter of the current request event. If yes, execute the playback command or creation command; otherwise, add the command to the waiting queue.
[0023] In this embodiment, the current audio playback status includes core status information such as whether there is audio being played on the terminal, whether the audio playback process is locked, and whether the current playback scenario supports interruption. The current audio playback status is obtained by reading local audio playback process data in real time.
[0024] After obtaining the playback status and current request priority parameters, the playback interruption logic is executed. If there is no audio playback task on the current terminal, the received playback command or creation command is directly responded to and executed. If there is audio playing on the current terminal, the playback status attribute and request priority parameter are combined to determine whether to trigger an interruption operation.
[0025] If the determination result is that it can be interrupted, the currently ongoing audio playback task will be immediately paused or terminated, the temporary playback context will be cleared, and the current high-priority playback command or creation command will be executed first. If the determination result is that it cannot be interrupted, the currently received commands will be added to the preset waiting queue in order according to the receiving time sequence, priority order, etc., and the commands in the queue will be retrieved and executed in turn after the current audio playback is completed and the playback process is released.
[0026] Specifically, when determining whether playback can be interrupted, a fixed threshold method can be used. This involves setting a fixed priority threshold and comparing the current requested priority parameter with the fixed threshold, while also considering whether the current playback status is interruptible. Alternatively, a segmented progress determination method can be used. For example, the audio playback duration can be divided into three fixed intervals: the beginning, middle, and end. Different priority standards can be configured for different intervals. The interruption threshold is increased during the middle of the audio playback, and decreased during the beginning and end. This, combined with the priority parameter, allows for a comprehensive determination.
[0027] This embodiment determines whether playback can be interrupted by combining the current playback status and priority parameters. This effectively avoids the problem of high-priority requests being blocked for a long time and low-priority requests frequently interrupting normal playback, thereby ensuring the orderliness and rationality of command responses in multiple scenarios.
[0028] S203. Obtain the character status data of the current interactive character, and perform matching and mapping between the character status data and candidate music resources to obtain the target music resource set and the singing style parameter set.
[0029] In this embodiment, the current interactive role is a virtual IP role bound to the smart terminal, and the role status data is a multi-dimensional data set representing the role's current interactive attributes, personality traits, scene adaptability, etc. The candidate music resources are a collection of all callable songs, broadcast templates, and singing style templates in the terminal's local cache or cloud resource library.
[0030] Before responding to commands, the system first acquires the latest status data of the currently active interactive character in real time. This ensures that the status data is synchronized with the current interaction scenario, plot progress, and user interaction behavior, avoiding adaptation discrepancies caused by using outdated historical status data. Then, the character's status data is comprehensively matched and mapped with all candidate music resources to filter out content highly compatible with the current character's persona and interaction scenario. For example, all status tags of the current character can be integrated into a unique character tag cluster, while all candidate music resources are clustered and categorized by tag. By matching the overlap of tag clusters, the system quickly locates the appropriate resource cluster set, thus completing the resource matching and mapping.
[0031] After the matching and mapping are completed, two types of core data are output: a target music resource set and a singing style parameter set. The target music resource set includes exclusive playlists, single songs, and scene broadcast templates adapted to the current character; the singing style parameter set includes style control parameters such as timbre, speech rate, emotional intensity, and singing rhythm adapted to the character's personality. The target music resource set and the singing style parameter set support the output of personalized music content such as subsequent song playback, broadcast generation, and AI song creation, improving the flexibility and character adaptability of music output.
[0032] For example, if the current interactive character is a gentle and healing child companion, after matching and mapping, soothing and gentle nursery rhyme resources and mild and friendly broadcast templates will be selected, while outputting singing style parameters with low speech speed and soft tone; if the current character is a lively and energetic interactive character, then light and dynamic music resources and lively tone broadcast templates will be matched to better adapt to the current character's state.
[0033] This embodiment solves the technical problem of the disconnect between traditional general music resources and virtual character settings and poor scene adaptability by accurately mapping the character state to music resources, thus ensuring the consistency of the role in audio interaction.
[0034] S204. If the playback command is executed, the target song is located in the target music resource set and the character-specific broadcast content is generated by combining the character status data. The character-specific broadcast content and the target song are played in sequence.
[0035] In this embodiment, when the currently executed instruction is a playback instruction, the song identification information carried by the instruction is read first. This song identification information can be the song name, song type, scene tag, etc., entered by the user, or it can be a preset track number or playlist identifier. Based on the target music resource set obtained by matching mapping, all audio resources in the resource set are traversed and searched through the song identification information, thereby accurately locating the target song resource corresponding to the user's needs.
[0036] After locating the target song, the system doesn't play it directly. Instead, it combines the latest character status data, including key information such as the character's identity, tone, suitable scenarios, and plot progress, with the target song's style, applicable scenarios, and content theme to generate personalized character-specific announcements. These announcements include introductory remarks and scene transitions that fit the character's identity and tone, distinguishing them from generic, fixed announcements. By showcasing the virtual character's characteristics, the system facilitates scene transitions.
[0037] The system generates character-based announcements and executes playback logic in a sequential order: the announcements are played first, followed by the music. This means the generated character-based announcements are played first, followed by the automatically and seamlessly played target song after setting the scene and guiding interaction. This achieves a smooth and continuous connection between the announcements, interaction, and music playback. For example, when a user triggers a bedtime song playback command, after matching the current character's healing personality and locating the target song, a gentle bedtime announcement is generated first, followed by the automatic playback of a soothing bedtime song, creating an immersive character-based audio experience.
[0038] This embodiment breaks through the single mode of no broadcast or fixed script broadcast by linking the personalized broadcast with the target song in a time sequence, allowing the music playback function to be deeply integrated with the character companionship scenario, effectively improving the integrity and immersion of smart terminal interaction.
[0039] S205. If the creation instruction is executed, then song control parameters are generated based on the creation information input by the user, the character status data, and the singing style parameter set, and a corresponding AI song is generated and played based on the song control parameters.
[0040] In this embodiment, when the currently executed instruction is a creation instruction, the user-input creation information is first parsed and extracted to obtain personalized creation requirement data such as the user-defined creation theme, scene, and core elements. Simultaneously, based on the current character state data and the matched singing style parameter set, the user's personalized creation requirements are deeply integrated with the character's personality traits and style attributes. Thus, using the user's creation requirements as a benchmark and the character state data and singing style parameter set as constraints, corresponding song control parameters are generated. These song control parameters include multi-dimensional control information such as song theme, lyrical style, overall mood, playback rhythm, vocal timbre, and tempo.
[0041] The generated complete song control parameters are input into the preset generative music model. The model completes the processing of lyrics generation, melody arrangement, timbre matching, rhythm adjustment and other processes in sequence according to the constraints corresponding to the parameters. Finally, it generates an AI song that is suitable for the current character and meets the user's creative needs. After the generation is completed, the audio resources are automatically loaded and the playback operation is performed.
[0042] For example, when a user inputs the creation instruction "Write a happy children's song about the seaside," the core creation information of "seaside, happy, children's song" is extracted. Combined with the current lively child character's emotional state, age, and upbeat singing style parameters, corresponding full-dimensional song control parameters are generated. The generative model generates an exclusive AI children's song with a cheerful style, a theme that fits the seaside scene, and is suitable for the child's persona based on the parameters. After generation, the terminal automatically plays the song.
[0043] This embodiment generates AI songs by combining user creative needs, interactive character states, and singing style parameters. This solves the problems of traditional AI song generation, such as the lack of character constraints and the disconnect between generated content and character settings. It allows AI-generated songs to have unique character recognition, thereby improving the character adaptability of music output content.
[0044] In the above embodiments, this invention discloses a role-based song generation and playback control method. It receives playback or creation commands, identifies request events, and assigns priority parameters. It then combines the current audio playback status with the priority parameters to determine whether playback should be interrupted; if so, the command is executed; otherwise, the command is added to the playback queue. It acquires role status data and matches it with candidate music resources to obtain a target music resource set and a singing style parameter set. When executing a playback command, it locates the target song and generates role-based announcement content, playing the role-based announcement content and the target song sequentially. When executing a creation command, it generates song control parameters, generates and plays the corresponding AI song. This invention achieves unified control over role setting, music playback, and generation, improving the consistency between music playback and generated content and role character design, increasing the flexibility and role adaptability of music output, and enhancing interactive immersion.
[0045] In one embodiment, step S202 includes: Read the preset basic interrupt threshold, duration weighting coefficient, and priority weighting coefficient; Get the current audio playback status and parse it to get the current audio playback duration; The duration-weighted increment is obtained based on the already played duration and duration weight coefficient, and the priority-weighted decrement is obtained based on the priority parameter and priority weight coefficient; Based on the basic interruption threshold, the duration-weighted increment is added and the priority-weighted decrement is subtracted to calculate the interruptible threshold of the current audio. The priority parameter is compared with the interruptible threshold. If the priority parameter is greater than or equal to the interruptible threshold, the current playback is confirmed to be interrupted; otherwise, the current playback is not interrupted.
[0046] In this embodiment, a basic interruption threshold, duration weight coefficient, and priority weight coefficient with fixed parameters are pre-stored. Specifically, the configuration can be adapted in advance according to the device interaction scenario and user group attributes to quantify the interruptible conditions of audio playback.
[0047] When determining if an interruption is needed, the real-time playback status of the audio is obtained, including the total audio duration, played duration, remaining duration, and playback lock status. This playback status data is parsed to extract the played duration from the start of playback to the current moment. This duration data is dynamically updated in real time and accurately reflects the current playback progress. Then, a preset duration weighting coefficient is used to weight the played duration value, resulting in a weighted duration increment. This increment quantifies the impact of playback progress on interruption permissions; the longer the audio has been played, the larger the weighted duration increment, indicating a higher threshold for interruption and making it less likely to be interrupted by new requests. This ensures that audio that is more than halfway through playback can be played completely. Furthermore, a preset priority weighting coefficient is used to weight the priority parameter of the current request event, resulting in a priority weighting decrement. This decrement quantifies the effect of request priority on interruption permissions; the higher the request priority, the larger the decrement, and the lower the interruption threshold, making high-priority requests easier to respond to.
[0048] Using a preset basic interruption threshold as a baseline value, first add the calculated duration-weighted increment, then subtract the calculated priority-weighted decrement, i.e., through the formula... The dynamic interruptible threshold Th is calculated in real time for the current audio playback state, where The basic interrupt threshold is defined by α, which is the duration weighting coefficient, and β, which is the priority weighting coefficient. This represents the total playback time. This is the priority parameter for the current request event. The calculated interruptible threshold is not a fixed value, but rather it can adaptively change in real time based on the playback progress and request priority of each incoming request, thus adapting to different playback scenarios.
[0049] Finally, the priority parameter of the current request event is compared with the real-time calculated interruptibility threshold, and standardized interruption judgment logic is executed. If the priority parameter is greater than or equal to the current interruptibility threshold, the current playback task is determined to be interruptible. In this case, the current playback task is immediately paused, the playback progress context is saved, and a new playback instruction or creation instruction is executed. If the priority parameter is less than the current interruptibility threshold, the current playback task is determined to be interruptible, and the new request cannot preempt playback resources. In this case, the instruction is stored in the waiting queue in order, and will be executed sequentially after the current audio playback is completed.
[0050] This embodiment uses a dynamically adaptive interruptibility threshold to determine whether playback can be interrupted, balancing playback integrity with request response priority. This avoids arbitrary interruptions during song playback while ensuring timely responses to high-priority emergency commands, thereby improving the rationality of playback scheduling and the consistency of user experience in scenarios with multiple concurrent requests.
[0051] In one embodiment, step S203 includes: Obtain the character status data of the currently interacting character from several matching dimensions; Assign corresponding dynamic weight coefficients to each matching dimension based on the identified current request event; Based on the character state data and candidate music resources, feature mapping is performed on several matching dimensions to obtain similarity scores under each matching dimension. The overall matching degree of the candidate music resources is obtained by weighting and summing the similarity scores under each matching dimension and the dynamic weight coefficients of the corresponding matching dimensions. Sort all candidate music resources in descending order of overall matching degree, and select the candidate resources with a preset proportion before sorting and an overall matching degree higher than a preset threshold as the target music resource set and singing style parameter set.
[0052] In this embodiment, the mapping and filtering of character status and music resources is achieved through multi-dimensional dynamic weighted matching. Specifically, multiple matching dimensions for character and music resource adaptation are pre-configured, including fixed dimensions such as emotion adaptation, plot adaptation, age adaptation, and style adaptation. Complete character status data of the currently interacting character is collected in real time from each matching dimension to ensure that the collected status data covers core attributes such as character design, scene adaptation, and emotional style, providing complete data support for subsequent resource matching.
[0053] Then, based on the currently identified request event type, a corresponding dynamic weight coefficient is assigned to each preset matching dimension. That is, different types of request events correspond to different weight allocation strategies. The weight coefficient is used to characterize the importance of each matching dimension in the resource adaptation process. For example, plot linkage requests will focus on the plot dimension weight, user on-demand requests will focus on the emotion and style dimension weight, AI creation requests will focus on the singing style dimension weight, etc., thereby achieving precise scenario-based adaptation and ensuring the standardization and rationality of weight allocation.
[0054] During music resource mapping, all candidate music resources in the resource library are traversed. For each candidate resource, the collected character status data and the attribute data of the candidate music resource are matched one by one to complete the feature mapping and comparison processing for each matching dimension. That is, for each independent dimension, the adaptation similarity between the character and the candidate music resource is calculated separately to obtain the independent similarity score corresponding to each matching dimension. The higher the score, the better the adaptation effect under that dimension. The dynamic weight coefficients corresponding to each matching dimension are obtained, and the similarity score of each dimension is weighted and summed with the corresponding weight coefficient to obtain the comprehensive matching degree between a single candidate music resource and the current character status. The comprehensive matching degree is used as a quantitative indicator to measure the overall adaptation effect between the character and the music resource, thereby intuitively and quantitatively distinguishing resource adaptability.
[0055] After calculating the overall matching degree of all candidate resources, all resources are sorted in descending order of their overall matching degree values. According to the preset filtering rules, candidate resources with a preset proportion of the highest ranking and an overall matching degree value higher than the system's preset adaptation threshold are extracted. Finally, the qualified resources are integrated and summarized to form a set of target music resources that are suitable for the current role. At the same time, the corresponding singing style parameters are extracted to construct a complete singing style parameter set, thereby completing the accurate matching and mapping of resources.
[0056] This embodiment uses a multi-dimensional dynamic weighted quantization matching mechanism to adaptively adjust the matching focus according to different interaction scenarios, thereby accurately matching the character's personality and the music resources of the scene, effectively improving the matching accuracy between the character and the audio resources.
[0057] In one embodiment, the step of sequentially performing feature mapping across several matching dimensions based on the character state data and candidate music resources to obtain similarity scores for each matching dimension includes: The current character's emotion tag, plot stage tag, character age tag, and tone style tag are obtained from the character status data. The current character's emotion tag and the emotion attributes of the candidate music resources are mapped to multi-dimensional emotion vectors, and the first cosine similarity is calculated as the similarity score of the emotion matching dimension. The current plot stage tag is hierarchically matched with the plot attributes of the candidate music resources, and a similarity score for the plot matching dimension is obtained according to the preset matching level. The character's age tag is matched with the appropriate age range of the candidate music resources by difference, and the similarity score of the age matching dimension is obtained by mapping according to the preset difference level. The tone style tags and the style attributes of the candidate music resources are mapped to multi-dimensional style vectors, and the second cosine similarity is calculated as the similarity score of the style matching dimension.
[0058] In this embodiment, the collected current character status data is structured and parsed to accurately extract the character's core attribute tags, including the current character's real-time emotion tags, the plot stage tags of the interaction scene, the character's preset age tags, and tone style tags, etc., for subsequent multi-dimensional quantitative matching calculations.
[0059] Specifically, for the emotion matching dimension, the current character's emotion tag and the candidate music resource's emotion attributes are mapped to multi-dimensional emotion vectors of the same dimension through a preset unified emotion vector dimension standard. The first cosine similarity is calculated through a vector similarity algorithm, and this value is used as the similarity score for the emotion matching dimension, accurately quantifying the degree of compatibility between the character's emotion and the music emotion.
[0060] For the plot matching dimension, a multi-level plot matching grade and corresponding score mapping relationship are preset. The plot stage tag of the character's current stage is compared and matched hierarchically with the plot adaptation attributes of the candidate music resources. If the resource is adapted to the current plot stage, it is judged as a complete match; if the resource is adapted to an adjacent plot stage, it is judged as a partial match; if the resource has no plot adaptation attribute, it is judged as a general adaptation; if the resource is adapted to a completely unrelated plot, it is judged as a mismatch. A standardized score is mapped according to the matching grade, which serves as the similarity score for the plot matching dimension, realizing hierarchical adaptation judgment of plot scenes.
[0061] For the age matching dimension, a pre-defined rule is established that maps age range difference levels to scores. The pre-defined age tags for a character are compared with the target age range of candidate music resources, and the difference level between the two age ranges is calculated. If the two age ranges completely overlap, it is a perfect match; if they differ by one age range, it is a partial match; if they differ by two or more age ranges, it is a low match. The corresponding score value is obtained based on the difference level and used as the similarity score for the age matching dimension to ensure that the music resources are matched to the age positioning of the user and the character.
[0062] For the style matching dimension, a preset style vector dimension standard is obtained, and the tone style tag of the character is mapped to a fixed-dimensional multi-dimensional style vector. The style attributes of the candidate music resources, such as the style of music, broadcasting style, and singing style, are mapped to style vectors of the same dimension. The similarity between the two sets of style vectors is calculated by the cosine similarity algorithm to obtain the second cosine similarity value. This value is used as the similarity score of the style matching dimension, thereby quantifying the degree of fit between the character style and the audio resource style.
[0063] This embodiment achieves refined matching determination of character status and music resources by quantitatively calculating multi-dimensional similarity scores, avoiding the problem of traditional fuzzy matching or experience-based matching without quantitative standards. It allows each matching dimension to be quantitatively determined, improving the accuracy and stability of resource matching.
[0064] In one embodiment, after obtaining the comprehensive matching degree of the candidate music resources by weighted summation based on the similarity scores under each matching dimension and the dynamic weight coefficients of the corresponding matching dimensions, the method further includes: If the overall matching degree of all candidate music resources is lower than the preset threshold, the default playlist, default broadcast template and general singing style template corresponding to the current character will be retrieved as the target music resource set and singing style parameter set. If the current character does not have a corresponding default resource, a message indicating limited functionality will be output and the execution of the current command will be terminated.
[0065] In this embodiment, if the overall matching degree of all candidate music resources is lower than a preset threshold, it is determined that there are currently no highly compatible exclusive music resources, and a downgrade adaptation mechanism is triggered. During the downgrade adaptation process, the default resources pre-bound and stored by the current interactive role are retrieved first, including default playlists, default scene broadcast templates, and general singing style templates. These default resources are directly used as the current target music resource set and singing style parameter set to ensure the normal operation of playback and creation functions and avoid function failure.
[0066] If the current interactive character is not pre-bound to any default resources and there are no available downgraded resources to support the function's operation, it is determined that the current scene cannot complete the character-based audio interaction. At this time, a standardized function limitation prompt message is generated and the user is informed through voice broadcast, screen text display, etc., and the subsequent execution process of the currently received playback command or creation command is directly terminated to avoid program lag, errors, or invalid operation.
[0067] In one embodiment, step S204 includes: The target song is located in the target music resource set according to the song identifier in the playback instruction; Extract the current character's title rules, plot stage tags, and tone style tags from the character status data; Fill the corresponding fields of the preset broadcast template with the title rules, the plot stage tag, and the basic information of the target song to generate the initial broadcast text; The initial broadcast text is rewritten and stylized according to the tone style tags to obtain character-specific broadcast content that conforms to the tone characteristics of the current character.
[0068] In this embodiment, the playback command triggered by the user is first parsed to extract unique identification information such as song name, track type, and scene tag carried in the command. Based on the song identifier, a precise search is performed in the matched target music resource set to quickly locate the target song resource required by the user.
[0069] Next, the character status data was structured and three types of data were extracted: character-specific title rules, character current plot stage tags, and character fixed tone style tags. The title rules are used to define the character's self-reference and the way they address users in the broadcast. The plot stage tags are used to adapt to the current interaction scenario, and the tone style tags are used to constrain the overall tone of the broadcast text.
[0070] When generating character-based broadcast content, the system first retrieves a preset standardized broadcast template and fills in the corresponding blank fields of the broadcast template with the extracted character title rules, plot stage tags, target song name, music style, applicable scene, and other basic information. The system then automatically splices the information to generate the initial broadcast text, achieving basic adaptation between the broadcast content and the song and scene.
[0071] Since the initial broadcast text can provide a basic introduction to the song and scene, but does not match the character's unique tone, the initial broadcast text is further rewritten and optimized in a targeted style based on the current character's tone and style tags. This includes adjusting the tone, sentence style, and word characteristics of the text, as well as removing generic phrases, to ultimately generate character-specific broadcast content that perfectly matches the current character's persona and is suitable for the current interactive scenario.
[0072] This embodiment generates characterized broadcast content through template filling and stylized rewriting, which not only ensures the efficiency of broadcast content generation, but also realizes the characterized customization of broadcast scripts, so that the pre-broadcast of each music playback has exclusive character characteristics, effectively improving the naturalness and immersion of human-computer interaction.
[0073] In one embodiment, step S205 includes: Extract theme words, object words, and scene words from the creation information input by the user to generate lyric theme parameters; Based on the user-specified emotion parameters, the current character's emotion tag and the current story stage tag in the character status data, the song's emotion parameters are generated by fusing them together. Based on the scene type of the scene words and the current character's age tag in the character status data, the song rhythm parameters are mapped to obtain the parameters. Based on the timbre template, speech rate template, and emotional intensity in the singing style parameter set, the singing style parameters are determined; The corresponding song control data is obtained by combining the lyric theme parameters, song emotion parameters, song rhythm parameters and singing style parameters. The song control data is input into a preset generative music model for processing, generating and playing the corresponding AI song.
[0074] In this embodiment, when executing the creation instruction, the semantic analysis and keyword extraction of the creation text information input by the user are performed first to filter out the core theme words, descriptive object words and scene limiting words. Based on the integration of the three types of keywords, standardized lyrics theme parameters are generated to determine the core creation theme and content direction of the AI song.
[0075] Then, the system reads the emotional requirement parameters manually specified by the user in the creation instructions, and retrieves the real-time emotional tags of the character recorded in the character status data and the plot stage tags of the current interaction scene. The three types of emotional data are fused and verified, and uniformly calibrated to adapt to the overall emotional tone of the current scene and character, generating unique song emotional parameters, thereby determining the overall emotional tone of the AI song.
[0076] In addition, the current creation scene type is confirmed based on the scene qualifiers in the user's creation information. Combined with the preset character age adaptation tags in the character status data, the preset scene and age rhythm mapping rules are retrieved. That is, different scenes and different age positions correspond to different song beats, playback speeds and other rhythms. The song rhythm parameters that are adapted to the current scene atmosphere and character age position are automatically matched and generated through the mapping rules, thereby determining the rhythm attributes such as beat, speech rate and rhythm density of the AI song.
[0077] When determining the singing style parameters, the singing style parameter set obtained from the previous matching and mapping is used to extract the character-specific timbre template, speech rate template and emotional intensity range data contained therein, and splice them together to obtain the complete character-specific singing style parameters. The singing style parameters are used to constrain the singing timbre, speech rate and emotional tension of the AI song.
[0078] The generated lyric theme parameters, song emotion parameters, song rhythm parameters, and singing style parameters are structured, encapsulated, and formatted in a unified manner to obtain standardized song control data that can be recognized by generative music models, thus completing the unified encapsulation of creative parameters.
[0079] Finally, the encapsulated song control data is input into a preset generative music model. The model, following the full-dimensional constraints of the control data, automatically completes the generation process, including lyric writing, melody arrangement, timbre adaptation, rhythm adjustment, and mood optimization, ultimately outputting a complete AI song audio file. The generated audio file undergoes integrity verification, and upon successful verification, the audio resources are automatically loaded and the AI song is played.
[0080] This embodiment deeply integrates users' personalized creative needs, character status characteristics, and scene environment attributes through a multi-dimensional parameter constraint mechanism, avoiding problems such as random AI song generation style, mismatch with the interactive character's personality, and poor scene adaptability, effectively improving the character adaptability and interactive experience of the AI creation function of smart terminals.
[0081] It should be noted that there is no necessary order between the above steps. Those skilled in the art will understand from the description of the embodiments of the present invention that the above steps may have different execution orders in different embodiments, that is, they may be executed in parallel or in turn, etc.
[0082] Further reference Figure 3 As a response to the above Figure 2 The present invention provides an embodiment of a role-based song generation and playback control device, which, in accordance with the method shown, provides an implementation of a role-based song generation and playback control device. Figure 2 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.
[0083] like Figure 3 As shown, the role-based song generation and playback control device 30 described in this embodiment includes: The instruction receiving module 301 is used to receive playback instructions or creation instructions input by the user, identify request events for the playback instructions or creation instructions, and assign corresponding priority parameters. Interruption control module 302 is used to obtain the current audio playback status, and determine whether to interrupt playback based on the current audio playback status and the priority parameter of the current request event. If so, the playback instruction or creation instruction is executed; otherwise, the instruction is added to the waiting queue. The state music mapping module 303 is used to obtain the character state data of the current interactive character, and to match and map the character state data with candidate music resources to obtain a target music resource set and a singing style parameter set. The first execution module 304 is used to, if the playback instruction is executed, locate the target song in the target music resource set and generate character-based broadcast content in combination with the character status data, and play the character-based broadcast content and the target song in sequence; The second execution module 305 is used to generate song control parameters based on the creation information input by the user, the character status data, and the singing style parameter set if the creation instruction is executed, and to generate and play the corresponding AI song based on the song control parameters.
[0084] The module referred to in this invention is a series of computer program instruction segments capable of performing specific functions. It is more suitable than a program for describing the execution process of role-based song generation and playback control. For specific implementation methods of each module, please refer to the corresponding method embodiments described above, which will not be repeated here.
[0085] In one embodiment, the interrupt control module 302 includes: The coefficient reading unit is used to read the preset basic interrupt threshold, duration weight coefficient, and priority weight coefficient. The playback parsing unit is used to obtain the current audio playback status and parse the current audio playback duration; The priority variable calculation unit is used to obtain the duration-weighted increment based on the already played duration and duration weight coefficient, and to obtain the priority-weighted decrement based on the priority parameter and priority weight coefficient; An interruption threshold calculation unit is used to calculate the interruptible threshold of the current audio by adding the duration-weighted increment and subtracting the priority-weighted decrement based on the basic interruption threshold. An interruption determination unit is used to compare the priority parameter with the interruptible threshold. If the priority parameter is greater than or equal to the interruptible threshold, the current playback is confirmed to be interrupted; otherwise, the current playback is not interrupted.
[0086] In one embodiment, the state music mapping module 303 includes: The character status acquisition unit is used to obtain the character status data of the currently interacting character from several matching dimensions; The weight allocation unit is used to assign corresponding dynamic weight coefficients to each matching dimension based on the identified current request event. The feature mapping unit is used to perform feature mapping on several matching dimensions based on the character state data and candidate music resources in sequence, and obtain the similarity score under each matching dimension. The fusion unit is used to perform a weighted summation based on the similarity scores under each matching dimension and the dynamic weight coefficients of the corresponding matching dimensions to obtain the comprehensive matching degree of the candidate music resources. The resource mapping unit is used to sort all candidate music resources in descending order of comprehensive matching degree, select candidate resources with a preset proportion before sorting and a comprehensive matching degree higher than a preset threshold, and use them as the target music resource set and singing style parameter set.
[0087] In one embodiment, the feature mapping unit includes: The tag parsing unit is used to parse the current character's emotion tag, plot stage tag, character age tag, and tone style tag from the character state data. The emotion mapping unit is used to map the emotion tag of the current character and the emotion attribute of the candidate music resource into a multi-dimensional emotion vector and calculate the first cosine similarity as the similarity score of the emotion matching dimension. The plot mapping unit is used to hierarchically match the current plot stage tag with the plot attributes of the candidate music resources, and obtain the similarity score of the plot matching dimension according to the preset matching level. The age mapping unit is used to perform difference matching between the character's age tag and the suitable age layer of the candidate music resource, and obtain the similarity score of the age matching dimension according to the preset difference level. The tone mapping unit is used to map tone style tags and style attributes of the candidate music resources into multi-dimensional style vectors and calculate the second cosine similarity as the similarity score of the style matching dimension.
[0088] In one embodiment, the state music mapping module 303 further includes: The default resource call unit is used to retrieve the default playlist, default broadcast template and general singing style template corresponding to the current role as the target music resource set and singing style parameter set if the overall matching degree of all candidate music resources is lower than the preset threshold. The prompt output unit is used to output a limited function prompt message and terminate the execution of the current command if the current character does not have a corresponding preset default resource.
[0089] In one embodiment, the first execution module 304 includes: A song positioning unit is used to locate a target song in the target music resource set according to the song identifier in the playback instruction; The data extraction unit is used to extract the current character's title rules, plot stage tags, and tone style tags from the character status data. The template filling unit is used to fill the title rules, the plot stage tags, and the basic information of the target song into the corresponding fields of the preset broadcast template to generate the initial broadcast text; The stylization rewriting unit is used to rewrite the initial broadcast text in a stylized manner according to the tone style tag, so as to obtain a characterized broadcast content that conforms to the tone characteristics of the current character.
[0090] In one embodiment, the second execution module 305 includes: The creative information extraction unit is used to extract theme words, object words, and scene words from the creative information input by the user, and generate lyrics theme parameters; The emotion parameter generation unit is used to generate song emotion parameters by fusing the emotion parameters specified by the user, the emotion tag of the current character in the character status data, and the tag of the current plot stage. The rhythm parameter generation unit is used to map the song rhythm parameters based on the scene type of the scene words and the current character's age tag in the character status data. The style parameter determination unit is used to determine the singing style parameters based on the timbre template, speech rate template and emotional intensity in the singing style parameter set; The parameter fusion unit is used to combine the lyric theme parameters, song emotion parameters, song rhythm parameters and singing style parameters to obtain corresponding song control data; The song generation unit is used to input the song control data into a preset generative music model for processing, and generate and play the corresponding AI song.
[0091] In the above embodiments, this invention discloses a role-based song generation and playback control device. It receives playback or creation commands, identifies request events, and assigns priority parameters. It then combines the current audio playback status with the priority parameters to determine whether playback should be interrupted; if so, the command is executed; otherwise, the command is added to the playback queue. It acquires role status data and matches it with candidate music resources to obtain a set of target music resources and a set of singing style parameters. When executing a playback command, it locates the target song and generates role-based announcement content, playing the role-based announcement content and the target song sequentially. When executing a creation command, it generates song control parameters, generates and plays the corresponding AI song. This invention achieves unified control over role setting, music playback, and generation, improving the consistency between music playback and generated content and role character design, increasing the flexibility and adaptability of music output, and enhancing interactive immersion.
[0092] Specific limitations regarding the role-based song generation and playback control device can be found in the limitations of the role-based song generation and playback control method described above, and will not be repeated here. Each module in the aforementioned role-based song generation and playback control device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0093] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0094] Another embodiment of the present invention provides a computer device, such as... Figure 4 As shown, the computer device 40 includes: One or more processors 401 and memory 402, Figure 4 The following section uses a processor 401 as an example. The processor 401 and the memory 402 can be connected via a bus or other means. Figure 4 Taking the example of a connection between China and Israel via a bus.
[0095] The processor 401 is used to perform various control logics of the computer device 40. It can be any conventional processor, microprocessor, state machine, general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), microcontroller, ARM (Acorn RISC Machine) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination of these components.
[0096] The memory 402, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions corresponding to the role-based song generation and playback control method in the embodiments of the present invention. The processor 401 executes various functional applications and data processing of the computer device 40 by running the non-volatile software programs, instructions, and units stored in the memory 402, thereby implementing the role-based song generation and playback control method in the above method embodiments.
[0097] Another embodiment of the present invention provides a computer-readable storage medium storing computer-executable instructions, which, when executed by one or more processors, perform the steps of the role-based song generation and playback control method in any of the above method embodiments.
[0098] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.
[0099] Based on the above description of the embodiments, those skilled in the art will understand that the methods described in the embodiments can be implemented using software plus necessary general-purpose hardware platforms. Of course, they can also be implemented using hardware, but in many cases, the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0100] Of course, those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware (such as a processor, controller, etc.). The computer program can be stored in a non-volatile, computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The storage medium can be a memory, magnetic disk, floppy disk, flash memory, optical storage, etc.
[0101] It should be noted that any AI models, software tools, or components not belonging to this company appearing in the embodiments of this application are merely illustrative examples and do not represent actual use. All user personal information involved in the embodiments of this application has been authorized (with the knowledge and consent) by the relevant parties or has been fully authorized by all parties, and the executing entity may obtain it through various legal and compliant means. The collection, storage, use, processing, transmission, provision, and disclosure of the information, data, and signals involved all comply with relevant laws and regulations and do not violate public order and good morals.
[0102] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A role-based song generation and playback control method, characterized in that, include: Receive playback or creation instructions input by the user, identify the request event of the playback or creation instructions, and assign corresponding priority parameters; Obtain the current audio playback status, and determine whether to interrupt playback based on the current audio playback status and the priority parameter of the current request event. If yes, execute the playback command or creation command; otherwise, add the command to the waiting queue. Obtain the character status data of the current interactive character, and match and map the character status data with candidate music resources to obtain the target music resource set and the singing style parameter set; If the playback command is executed, the target song is located in the target music resource set and the character-specific broadcast content is generated by combining the character status data. The character-specific broadcast content and the target song are played in sequence. If the creation instruction is executed, song control parameters are generated based on the creation information input by the user, the character status data, and the singing style parameter set. Based on the song control parameters, a corresponding AI song is generated and played.
2. The role-based song generation and playback control method according to claim 1, characterized in that, The step of obtaining the current audio playback status and determining whether to interrupt playback based on the current audio playback status and the priority parameter of the current request event includes: Read the preset basic interrupt threshold, duration weighting coefficient, and priority weighting coefficient; Get the current audio playback status and parse it to get the current audio playback duration; The duration-weighted increment is obtained based on the already played duration and duration weight coefficient, and the priority-weighted decrement is obtained based on the priority parameter and priority weight coefficient; Based on the basic interruption threshold, the duration-weighted increment is added and the priority-weighted decrement is subtracted to calculate the interruptible threshold of the current audio. The priority parameter is compared with the interruptible threshold. If the priority parameter is greater than or equal to the interruptible threshold, the current playback is confirmed to be interrupted; otherwise, the current playback is not interrupted.
3. The role-based song generation and playback control method according to claim 1, characterized in that, The process involves obtaining the character state data of the currently interacting character, matching and mapping the character state data with candidate music resources to obtain a target music resource set and a singing style parameter set, including: Obtain the character status data of the currently interacting character from several matching dimensions; Assign corresponding dynamic weight coefficients to each matching dimension based on the identified current request event; Based on the character state data and candidate music resources, feature mapping is performed on several matching dimensions to obtain similarity scores under each matching dimension. The overall matching degree of the candidate music resources is obtained by weighting and summing the similarity scores under each matching dimension and the dynamic weight coefficients of the corresponding matching dimensions. Sort all candidate music resources in descending order of overall matching degree, and select the candidate resources with a preset proportion before sorting and an overall matching degree higher than a preset threshold as the target music resource set and singing style parameter set.
4. The role-based song generation and playback control method according to claim 3, characterized in that, The feature mapping based on the character state data and candidate music resources across several matching dimensions is performed sequentially to obtain similarity scores for each matching dimension, including: The current character's emotion tag, plot stage tag, character age tag, and tone style tag are obtained from the character status data. The current character's emotion tag and the emotion attributes of the candidate music resources are mapped to multi-dimensional emotion vectors, and the first cosine similarity is calculated as the similarity score of the emotion matching dimension. The current plot stage tag is hierarchically matched with the plot attributes of the candidate music resources, and a similarity score for the plot matching dimension is obtained according to the preset matching level. The character's age tag is matched with the appropriate age range of the candidate music resources by difference, and the similarity score of the age matching dimension is obtained by mapping according to the preset difference level. The tone style tags and the style attributes of the candidate music resources are mapped to multi-dimensional style vectors, and the second cosine similarity is calculated as the similarity score of the style matching dimension.
5. The role-based song generation and playback control method according to claim 3, characterized in that, After obtaining the comprehensive matching degree of the candidate music resources by weighted summation based on the similarity scores under each matching dimension and the dynamic weight coefficients of the corresponding matching dimensions, the method further includes: If the overall matching degree of all candidate music resources is lower than the preset threshold, the default playlist, default broadcast template and general singing style template corresponding to the current character will be retrieved as the target music resource set and singing style parameter set. If the current character does not have a corresponding default resource, a message indicating limited functionality will be output and the execution of the current command will be terminated.
6. The role-based song generation and playback control method according to claim 1, characterized in that, The step of locating the target song in the target music resource set and generating character-based broadcast content in conjunction with the character status data includes: The target song is located in the target music resource set according to the song identifier in the playback instruction; Extract the current character's title rules, plot stage tags, and tone style tags from the character status data; Fill the corresponding fields of the preset broadcast template with the title rules, the plot stage tag, and the basic information of the target song to generate the initial broadcast text; The initial broadcast text is rewritten and stylized according to the tone style tags to obtain character-specific broadcast content that conforms to the tone characteristics of the current character.
7. The role-based song generation and playback control method according to claim 1, characterized in that, The process of generating song control parameters based on user-inputted creation information, character status data, and the singing style parameter set, and generating and playing corresponding AI songs based on the song control parameters, includes: Extract theme words, object words, and scene words from the creation information input by the user to generate lyric theme parameters; Based on the user-specified emotion parameters, the current character's emotion tag and the current story stage tag in the character status data, the song's emotion parameters are generated by fusing them together. Based on the scene type of the scene words and the current character's age tag in the character status data, the song rhythm parameters are mapped to obtain the parameters. Based on the timbre template, speech rate template, and emotional intensity in the singing style parameter set, the singing style parameters are determined; The corresponding song control data is obtained by combining the lyric theme parameters, song emotion parameters, song rhythm parameters and singing style parameters. The song control data is input into a preset generative music model for processing, generating and playing the corresponding AI song.
8. A role-based song generation and playback control device, characterized in that, include: The instruction receiving module is used to receive playback instructions or creation instructions input by the user, identify the request events of the playback instructions or creation instructions, and assign corresponding priority parameters. The interruption control module is used to obtain the current audio playback status, and determine whether to interrupt playback based on the current audio playback status and the priority parameter of the current request event. If so, the playback instruction or creation instruction is executed; otherwise, the instruction is added to the waiting queue. The status music mapping module is used to obtain the character status data of the current interactive character, and match and map the character status data with candidate music resources to obtain the target music resource set and the singing style parameter set; The first execution module is used to, if the playback instruction is executed, locate the target song in the target music resource set and generate character-based broadcast content in combination with the character status data, and play the character-based broadcast content and the target song in sequence; The second execution module is used to generate song control parameters based on the creation information input by the user, the character status data, and the singing style parameter set if the creation instruction is executed, and to generate and play the corresponding AI song based on the song control parameters.
9. A computer device, characterized in that, Includes at least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the role-based song generation and playback control method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when executed by one or more processors, cause the one or more processors to perform the role-based song generation and playback control method according to any one of claims 1-7.
