AudioOutputInitialize
From TrillWiki
The audioOutputInitialize function sets up an audio output session (to speakers) in preparation for playing remote data.
Compatibility: 3.0 and higher
Contents |
Syntax
plugin_send(MYGUID,"audioOutputInitialize",audio_t *);
Note that all Trillian functions and notifications begin with a lower-case letter, despite the Wiki requirement that all pages start with a capital letter.
Parameters
AudioOutputInitialize utilitizes the audio_t structure.
struct audio_t
{
unsigned int struct_size;
int connection_id;
int window_id;
char *medium;
char *name;
char *location;
char *section;
int initiated;
int ask_confirmation;
/* Audio Information
*/
int codec;
int audio_sample_size;
int audio_sample_rate;
int audio_block_size;
int audio_quality;
int audio_data_length;
unsigned char *audio_data;
ttkCallback callback;
void *data;
};
- medium
- The medium this audio stream is being hosted over.
- connection_id
- The connection with which this is associated.
- name
- The contact with which this chat is associated.
- window_id
- Optionally, the window ID with which this chat is associated. (If provided, you don't need the above things for looking it up.)
- initiated
- Should be 1 if the local user started this chat, 0 if the remote did.
- ask_confirmation
- Should the user be asked whether or not to accept this chat?
- codec
- What audio codec will be used to decode incoming data. As of 3.0, only AUDIO_CODEC_UNCOMPRESSED and AUDIO_CODEC_TRUESPEECH are supported.
- audio_sample_size
- Size of each sample, in bits.
- audio_sample_rate
- Number of samples per second.
- audio_block_size
- How many samples Trillian should collect before notifying the callback below.
- callback
- The callback all audio notifications for this session should go to.
- data
- The user data for this audio session.
Return Value
This function returns a negative value on failure, or the ID of the audio session on success. It is worth noting that the ID of the audio session will be the same as the window_id, as only one session can be associated with each window.
Remarks
This is only one half of the stream; you will also need audioInputInitialize to generate a local audio stream. In addition, you will also need to audioOutputStart this audio session when actually using it. And remember to use audioOutputUninitialize when you are done with the audio input session.
