Exemple #1
0
 public async Task PlaySampleVoice(string username, string instance, MisskeyVoiceProfileType type,
                                   string sampleText, CancellationToken cancellationToken)
 {
     var ty = type switch
     {
         MisskeyVoiceProfileType.Note => VoiceProfileType.MisskeyNote,
         MisskeyVoiceProfileType.SensitiveNote => VoiceProfileType.MisskeySensitiveNote,
         MisskeyVoiceProfileType.Renote => VoiceProfileType.MisskeyRenote,
         MisskeyVoiceProfileType.SensitiveRenote => VoiceProfileType.MisskeySensitiveRenote,
         MisskeyVoiceProfileType.ReactionNotification => VoiceProfileType.MisskeyReactionNotification,
         MisskeyVoiceProfileType.SensitiveReactionNotification => VoiceProfileType.MisskeySensitiveReactionNotification,
         MisskeyVoiceProfileType.ReplyNotification => VoiceProfileType.MisskeyReplyNotification,
         MisskeyVoiceProfileType.SensitiveReplyNotification => VoiceProfileType.MisskeySensitiveReplyNotification,
         MisskeyVoiceProfileType.RenoteNotification => VoiceProfileType.MisskeyRenoteNotification,
         MisskeyVoiceProfileType.SensitiveRenoteNotification => VoiceProfileType.MisskeySensitiveRenoteNotification,
         MisskeyVoiceProfileType.QuoteNotification => VoiceProfileType.MisskeyQuoteNotification,
         MisskeyVoiceProfileType.SensitiveQuoteNotification => VoiceProfileType.MisskeySensitiveQuoteNotification,
         MisskeyVoiceProfileType.MentionNotification => VoiceProfileType.MisskeyMentionNotification,
         MisskeyVoiceProfileType.SensitiveMentionNotification => VoiceProfileType.MisskeySensitiveMentionNotification,
         MisskeyVoiceProfileType.FollowNotification => VoiceProfileType.MisskeyFollowNotification,
         MisskeyVoiceProfileType.FollowRequestAcceptedNotification => VoiceProfileType.MisskeyFollowRequestAcceptedNotification,
         MisskeyVoiceProfileType.ReceiveFollowRequestNotification => VoiceProfileType.MisskeyReceiveFollowRequestNotification,
         _ => throw new InvalidProgramException(),
     };
     await _updater.PlaySampleVoice(username, instance, ty, sampleText, cancellationToken);
 }
Exemple #2
0
        public async Task <MisskeyVoiceProfileData> GetVoiceProfile(string username, string instance,
                                                                    MisskeyVoiceProfileType type, CancellationToken cancellationToken)
        {
            var ty = type switch
            {
                MisskeyVoiceProfileType.Note => VoiceProfileType.MisskeyNote,
                MisskeyVoiceProfileType.SensitiveNote => VoiceProfileType.MisskeySensitiveNote,
                MisskeyVoiceProfileType.Renote => VoiceProfileType.MisskeyRenote,
                MisskeyVoiceProfileType.SensitiveRenote => VoiceProfileType.MisskeySensitiveRenote,
                MisskeyVoiceProfileType.ReactionNotification => VoiceProfileType.MisskeyReactionNotification,
                MisskeyVoiceProfileType.SensitiveReactionNotification => VoiceProfileType.MisskeySensitiveReactionNotification,
                MisskeyVoiceProfileType.ReplyNotification => VoiceProfileType.MisskeyReplyNotification,
                MisskeyVoiceProfileType.SensitiveReplyNotification => VoiceProfileType.MisskeySensitiveReplyNotification,
                MisskeyVoiceProfileType.RenoteNotification => VoiceProfileType.MisskeyRenoteNotification,
                MisskeyVoiceProfileType.SensitiveRenoteNotification => VoiceProfileType.MisskeySensitiveRenoteNotification,
                MisskeyVoiceProfileType.QuoteNotification => VoiceProfileType.MisskeyQuoteNotification,
                MisskeyVoiceProfileType.SensitiveQuoteNotification => VoiceProfileType.MisskeySensitiveQuoteNotification,
                MisskeyVoiceProfileType.MentionNotification => VoiceProfileType.MisskeyMentionNotification,
                MisskeyVoiceProfileType.SensitiveMentionNotification => VoiceProfileType.MisskeySensitiveMentionNotification,
                MisskeyVoiceProfileType.FollowNotification => VoiceProfileType.MisskeyFollowNotification,
                MisskeyVoiceProfileType.FollowRequestAcceptedNotification => VoiceProfileType.MisskeyFollowRequestAcceptedNotification,
                MisskeyVoiceProfileType.ReceiveFollowRequestNotification => VoiceProfileType.MisskeyReceiveFollowRequestNotification,
                _ => throw new InvalidProgramException(),
            };
            var data = await _updater.GetVoiceProfile(username, instance, ty, cancellationToken);

            return(new MisskeyVoiceProfileData(data.Volume, data.Speed, data.Tone, data.Alpha, data.ToneScale,
                                               data.ComponentNormal, data.ComponentHappy, data.ComponentAnger, data.ComponentSorrow,
                                               data.ComponentCalmness));
        }