ITranscriptionProvider.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Copyright (c) Meta Platforms, Inc. and affiliates.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under the license found in the
  6. * LICENSE file in the root directory of this source tree.
  7. */
  8. using Meta.WitAi.Events;
  9. using UnityEngine.Events;
  10. namespace Meta.WitAi.Interfaces
  11. {
  12. public interface ITranscriptionProvider
  13. {
  14. /// <summary>
  15. /// Provides the last transcription value (could be a partial transcription)
  16. /// </summary>
  17. string LastTranscription { get; }
  18. /// <summary>
  19. /// Callback used to notify Wit subscribers of a partial transcription.
  20. /// </summary>
  21. WitTranscriptionEvent OnPartialTranscription { get; }
  22. /// <summary>
  23. /// Callback used to notify Wit subscribers of a full transcription
  24. /// </summary>
  25. WitTranscriptionEvent OnFullTranscription { get; }
  26. /// <summary>
  27. /// Callback used to notify Wit subscribers when the mic is active and transcription has begun
  28. /// </summary>
  29. UnityEvent OnStoppedListening { get; }
  30. /// <summary>
  31. /// Callback used to notify Wit subscribers when the mic is inactive and transcription has stopped
  32. /// </summary>
  33. UnityEvent OnStartListening { get; }
  34. /// <summary>
  35. /// Callback used to notify Wit subscribers on mic volume level changes
  36. /// </summary>
  37. WitMicLevelChangedEvent OnMicLevelChanged { get; }
  38. /// <summary>
  39. /// Tells Wit if the mic input levels from the transcription service should be used directly
  40. /// </summary>
  41. bool OverrideMicLevel { get; }
  42. /// <summary>
  43. /// Called when wit is activated
  44. /// </summary>
  45. void Activate();
  46. /// <summary>
  47. /// Called when
  48. /// </summary>
  49. void Deactivate();
  50. }
  51. }