#include <AmAudio.h>
Inheritance diagram for AmAudio:

Public Member Functions | |
| virtual void | close () |
| virtual int | get (unsigned int user_ts, unsigned char *buffer, unsigned int nb_samples) |
| virtual int | put (unsigned int user_ts, unsigned char *buffer, unsigned int size) |
| unsigned int | getFrameSize () |
| void | setRecordTime (unsigned int ms) |
| int | incRecordTime (unsigned int samples) |
Protected Member Functions | |
| AmAudio (AmAudioFormat *) | |
| virtual int | read (unsigned int user_ts, unsigned int size)=0 |
| virtual int | write (unsigned int user_ts, unsigned int size)=0 |
| void | stereo2mono (unsigned char *out_buf, unsigned char *in_buf, unsigned int &size) |
| int | decode (unsigned int size) |
| int | encode (unsigned int size) |
| unsigned int | downMix (unsigned int size) |
| unsigned int | samples2bytes (unsigned int nb_samples) |
| unsigned int | bytes2samples (unsigned int bytes) |
Protected Attributes | |
| DblBuffer | samples |
| auto_ptr< AmAudioFormat > | fmt |
AmAudio binds a format and converts the samples if needed.
Internal Format: PCM signed 16 bit (mono | stereo).
| unsigned int AmAudio::bytes2samples | ( | unsigned int | bytes | ) | [protected] |
Convert the size from bytes to samples, depending on the format.
| void AmAudio::close | ( | ) | [virtual] |
Closes the audio pipe.
Reimplemented in AmAudioFile, and AmPlaylist.
| int AmAudio::decode | ( | unsigned int | size | ) | [protected] |
Converts from the input format to the internal format.
| size | [in] size in bytes |
| unsigned int AmAudio::downMix | ( | unsigned int | size | ) | [protected] |
Converts to mono depending on the format.
| int AmAudio::encode | ( | unsigned int | size | ) | [protected] |
Converts from the internal format to the output format.
| size | [in] size in bytes |
| int AmAudio::get | ( | unsigned int | user_ts, | |
| unsigned char * | buffer, | |||
| unsigned int | nb_samples | |||
| ) | [virtual] |
Get some samples from input stream.
nb_sample = input buffer size / sample size of the reference formatwhereby the format with/from which the codec works is the reference one.
Reimplemented in AmConferenceChannel, AmPlaylist, and AmRtpAudio.
| int AmAudio::put | ( | unsigned int | user_ts, | |
| unsigned char * | buffer, | |||
| unsigned int | size | |||
| ) | [virtual] |
Put some samples to the output stream.
nb_sample = input buffer size / sample size of the reference formatwhereby the format with/from which the codec works is the reference one.
Reimplemented in AmConferenceChannel, and AmPlaylist.
| virtual int AmAudio::read | ( | unsigned int | user_ts, | |
| unsigned int | size | |||
| ) | [protected, pure virtual] |
Gets 'size' bytes directly from stream (Read,Pull).
Implemented in AmAudioQueue, AmAudioBridge, AmAudioDelay, AmAudioFile, AmConferenceChannel, AmPlaylist, and AmRtpAudio.
| unsigned int AmAudio::samples2bytes | ( | unsigned int | nb_samples | ) | [protected] |
Convert the size from samples to bytes, depending on the format.
| void AmAudio::stereo2mono | ( | unsigned char * | out_buf, | |
| unsigned char * | in_buf, | |||
| unsigned int & | size | |||
| ) | [protected] |
Converts a buffer from stereo to mono.
| size | [in,out] size in bytes
|
| virtual int AmAudio::write | ( | unsigned int | user_ts, | |
| unsigned int | size | |||
| ) | [protected, pure virtual] |
Puts 'size' bytes directly from stream (Write,Push).
Implemented in AmAudioQueue, AmAudioBridge, AmAudioDelay, AmAudioFile, AmConferenceChannel, AmPlaylist, and AmRtpAudio.
auto_ptr<AmAudioFormat> AmAudio::fmt [protected] |
Audio format.
DblBuffer AmAudio::samples [protected] |
Sample buffer.
1.4.7