ZMVideoSDKAudioSendRawdata.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. //
  2. #import <Foundation/Foundation.h>
  3. @class ZMVideoSDKAudioRawData;
  4. @class ZMVideoSDKUser;
  5. NS_ASSUME_NONNULL_BEGIN
  6. /**
  7. @brief Audio raw data sender interface.
  8. */
  9. @interface ZMVideoSDKAudioSender : NSObject
  10. /**
  11. @brief Send audio raw data, channel number must be mono, and sampling bits must be 16.
  12. @param data The address of audio data.
  13. @param length The length of audio data (it must be even numbers).
  14. @param rate Sample rate of audio data(8000/11025/32000/44100/48000/50000/50400/96000/192000/2822400).
  15. */
  16. -(ZMVideoSDKErrors)send:(char*)data dataLength:(unsigned int)length sampleRate:(int)rate DEPRECATED_MSG_ATTRIBUTE("Use -send: dataLength: sampleRate: channel: instead");
  17. /**
  18. @brief Send audio raw data, and sampling bits must be 16.
  19. @param data The address of audio data.
  20. @param length The length of audio data (it must be even numbers).
  21. @param rate The sampling rate of audio data. When the channel is mono, supported sample rates is 8000/11025/16000/32000/44100/48000/50000/50400/96000/192000/2822400. When the channel is stereo, supported sample rates is 8000/16000/32000/44100/48000/50000/50400/96000/192000.
  22. @param channel Identifies the audio data channel type. default is ZMVideoSDKAudioChannel_Mono.
  23. @return If the function succeeds, it will return ZMVideoSDKErrors_Success.
  24. */
  25. -(ZMVideoSDKErrors)send:(char*)data dataLength:(unsigned int)length sampleRate:(int)rate channel:(ZMVideoSDKAudioChannel)channel;
  26. @end
  27. /**
  28. * An interface that handles a virtual audio microphone.
  29. */
  30. @protocol ZMVideoSDKVirtualAudioMic <NSObject>
  31. /**
  32. @brief Callback for virtual audio microphone initialization.
  33. @param rawdataSender It is a pointer of audio sender object.
  34. */
  35. -(void)onMicInitialize:(ZMVideoSDKAudioSender*)rawdataSender;
  36. /**
  37. @brief Callback for microphone to start sending raw data. For example, this could be sent if the user unmuted audio.
  38. */
  39. -(void)onMicStartSend;
  40. /**
  41. @brief Callback for microphone to stop sending raw data. For example, this could be sent if the user muted audio.
  42. */
  43. -(void)onMicStopSend;
  44. /**
  45. @brief Callback sent when the microphone is uninitialized. For example, if the user left the session.
  46. */
  47. -(void)onMicUninitialized;
  48. @end
  49. /**
  50. @brief Virtual audio speaker interface.
  51. */
  52. @protocol ZMVideoSDKVirtualAudioSpeaker <NSObject>
  53. /**
  54. @brief Callback event for receiving the mixed audio raw data from the virtual speaker.
  55. @param rawdata It is a pointer of audio raw data object.
  56. */
  57. -(void)onVirtualSpeakerMixedAudioReceived:(ZMVideoSDKAudioRawData*)rawdata;
  58. /**
  59. @brief Callback event for receiving the one way audio raw data of a selected user from the virtual speaker.
  60. @param rawdata The one way audio raw data. A pointer of audio raw data object.
  61. @param user The related user of the audio raw data.
  62. */
  63. -(void)onVirtualSpeakerOneWayAudioReceived:(ZMVideoSDKAudioRawData*)rawdata user:(ZMVideoSDKUser*)user;
  64. /**
  65. @brief Callback event for receiving the share audio raw data such as buffer, sampleRate, etc.
  66. @param rawdata The one way audio raw data. A pointer of audio raw data object.
  67. */
  68. -(void)onVirtualSpeakerSharedAudioReceived:(ZMVideoSDKAudioRawData*)rawdata;
  69. @end
  70. NS_ASSUME_NONNULL_END