diff options
Diffstat (limited to 'toxav/toxav.h')
-rw-r--r-- | toxav/toxav.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/toxav/toxav.h b/toxav/toxav.h index d558991f..b36debb1 100644 --- a/toxav/toxav.h +++ b/toxav/toxav.h | |||
@@ -683,6 +683,51 @@ typedef void toxav_video_receive_frame_cb(ToxAV *toxAV, uint32_t friend_number, | |||
683 | */ | 683 | */ |
684 | void toxav_callback_video_receive_frame(ToxAV *toxAV, toxav_video_receive_frame_cb *callback, void *user_data); | 684 | void toxav_callback_video_receive_frame(ToxAV *toxAV, toxav_video_receive_frame_cb *callback, void *user_data); |
685 | 685 | ||
686 | /** | ||
687 | * NOTE Compatibility with old toxav group calls TODO remove | ||
688 | */ | ||
689 | /* Create a new toxav group. | ||
690 | * | ||
691 | * return group number on success. | ||
692 | * return -1 on failure. | ||
693 | * | ||
694 | * Audio data callback format: | ||
695 | * audio_callback(Tox *tox, int groupnumber, int peernumber, const int16_t *pcm, unsigned int samples, uint8_t channels, unsigned int sample_rate, void *userdata) | ||
696 | * | ||
697 | * Note that total size of pcm in bytes is equal to (samples * channels * sizeof(int16_t)). | ||
698 | */ | ||
699 | int toxav_add_av_groupchat(Tox *tox, void (*audio_callback)(void*, int, int, const int16_t *, unsigned int, uint8_t, | ||
700 | unsigned int, void *), void *userdata); | ||
701 | |||
702 | /* Join a AV group (you need to have been invited first.) | ||
703 | * | ||
704 | * returns group number on success | ||
705 | * returns -1 on failure. | ||
706 | * | ||
707 | * Audio data callback format (same as the one for toxav_add_av_groupchat()): | ||
708 | * audio_callback(Tox *tox, int groupnumber, int peernumber, const int16_t *pcm, unsigned int samples, uint8_t channels, unsigned int sample_rate, void *userdata) | ||
709 | * | ||
710 | * Note that total size of pcm in bytes is equal to (samples * channels * sizeof(int16_t)). | ||
711 | */ | ||
712 | int toxav_join_av_groupchat(Tox *tox, int32_t friendnumber, const uint8_t *data, uint16_t length, | ||
713 | void (*audio_callback)(void*, int, int, const int16_t *, unsigned int, uint8_t, unsigned int, void *), void *userdata); | ||
714 | |||
715 | /* Send audio to the group chat. | ||
716 | * | ||
717 | * return 0 on success. | ||
718 | * return -1 on failure. | ||
719 | * | ||
720 | * Note that total size of pcm in bytes is equal to (samples * channels * sizeof(int16_t)). | ||
721 | * | ||
722 | * Valid number of samples are ((sample rate) * (audio length (Valid ones are: 2.5, 5, 10, 20, 40 or 60 ms)) / 1000) | ||
723 | * Valid number of channels are 1 or 2. | ||
724 | * Valid sample rates are 8000, 12000, 16000, 24000, or 48000. | ||
725 | * | ||
726 | * Recommended values are: samples = 960, channels = 1, sample_rate = 48000 | ||
727 | */ | ||
728 | int toxav_group_send_audio(Tox *tox, int groupnumber, const int16_t *pcm, unsigned int samples, uint8_t channels, | ||
729 | unsigned int sample_rate); | ||
730 | |||
686 | #ifdef __cplusplus | 731 | #ifdef __cplusplus |
687 | } | 732 | } |
688 | #endif | 733 | #endif |