• sdrdab-decoder logo
  • Department of Telecommunications
  • Faculty of Computer Science, Electronics and Telecommunications
  • AGH University of Science and Technology
  • Search on site:

  • Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Private Attributes | List of all members
AudioDecoder Class Reference

Facade class for audio playing. More...

#include <audio_decoder.h>

Public Member Functions

 AudioDecoder (float threshold, size_t length, int type=PLAYER_AAC)
 Constructor of AudioDecoder. More...
 
virtual ~AudioDecoder ()
 
void RemoveSink (AbstractSink *sink)
 Removes sink. More...
 
AbstractSink * AddSink (AbstractSink *sink)
 Adds new sink. More...
 
size_t Write (uint8_t *buffer, size_t length)
 Writes into internal ring buffer, could override oldest data when full. More...
 
void LastFrame ()
 Should be called when current portion of data is last one. More...
 
void RegisterTagsMapCallback (TagsMapCallback cb_func, void *cb_data)
 Registers tags map callback. More...
 
void RegisterReadCallback (ReadCallback cb_func, void *cb_data)
 Registers read callback. More...
 
void Process ()
 Starts audio processing. More...
 
int PlayerType () const
 Gets Player current type. More...
 
void Flush ()
 Flushes Player state. More...
 

Private Attributes

RingSrc * src_
 Pointer to RingSrc feeder object. More...
 
NullSink * sink_
 Pointer to NullSink consumer object. More...
 
Player * player_
 Pointer to Player object. More...
 

Detailed Description

Facade class for audio playing.

Author
Jaroslaw Bulat kwant.nosp@m.@agh.nosp@m..edu..nosp@m.pl (AudioDecoder)
Kacper Patro patro.nosp@m..kac.nosp@m.per@g.nosp@m.mail.nosp@m..com (AudioDecoder)
Date
7 July 2015 - version 1.0 beta
7 July 2016 - version 2.0 beta
1 November 2016 - version 2.0
Version
2.0
Copyright
Copyright (c) 2015 Jaroslaw Bulat, Kacper Patro
License

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Definition at line 38 of file audio_decoder.h.

Constructor & Destructor Documentation

AudioDecoder::AudioDecoder ( float  threshold,
size_t  length,
int  type = PLAYER_AAC 
)

Constructor of AudioDecoder.

Parameters
[in]thresholdRelative to 0.5, indicates values for which audio time-stretching will take place
[in]lengthLength of internal blocking ring buffer
[in]typePlayer type: mpeg or aac

Definition at line 31 of file audio_decoder.cc.

Here is the call graph for this function:

AudioDecoder::~AudioDecoder ( )
virtual

Definition at line 39 of file audio_decoder.cc.

Member Function Documentation

AbstractSink * AudioDecoder::AddSink ( AbstractSink *  sink)

Adds new sink.

Parameters
[in,out]sinkPointer to sink object
Returns
Added sink, NULL if already present

Definition at line 49 of file audio_decoder.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

void AudioDecoder::Flush ( )

Flushes Player state.

Definition at line 73 of file audio_decoder.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

void AudioDecoder::LastFrame ( )

Should be called when current portion of data is last one.

Definition at line 57 of file audio_decoder.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int AudioDecoder::PlayerType ( ) const

Gets Player current type.

Returns
Player type

Definition at line 69 of file audio_decoder.cc.

Here is the call graph for this function:

void AudioDecoder::Process ( )

Starts audio processing.

Definition at line 65 of file audio_decoder.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

void AudioDecoder::RegisterReadCallback ( ReadCallback  cb_func,
void *  cb_data 
)

Registers read callback.

cb_func will be called with cb_data passed when reading from internal buffer

Parameters
[in]cb_funcFunction to be called. Must match ReadCallback signature
[in,out]cb_dataData which will be passed to cb_func when called

Definition at line 77 of file audio_decoder.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

void AudioDecoder::RegisterTagsMapCallback ( TagsMapCallback  cb_func,
void *  cb_data 
)

Registers tags map callback.

cb_func will be called with cb_data passed when tags received

Parameters
[in]cb_funcFunction to be called. Must match TagsMapCallback signature
[in,out]cb_dataData which will be passed to cb_func when called

Definition at line 61 of file audio_decoder.cc.

Here is the call graph for this function:

void AudioDecoder::RemoveSink ( AbstractSink *  sink)

Removes sink.

Parameters
[in]sinkPointer to sink object

Definition at line 45 of file audio_decoder.cc.

Here is the call graph for this function:

size_t AudioDecoder::Write ( uint8_t *  buffer,
size_t  length 
)

Writes into internal ring buffer, could override oldest data when full.

Parameters
[in]bufferPointer to source buffer
[in]lengthLength of source buffer to read from
Returns
Number of elements written into internal buffer

Definition at line 53 of file audio_decoder.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

Player* AudioDecoder::player_
private

Pointer to Player object.

Definition at line 108 of file audio_decoder.h.

NullSink* AudioDecoder::sink_
private

Pointer to NullSink consumer object.

Definition at line 107 of file audio_decoder.h.

RingSrc* AudioDecoder::src_
private

Pointer to RingSrc feeder object.

Definition at line 106 of file audio_decoder.h.


The documentation for this class was generated from the following files:
  • audio_decoder.h
  • audio_decoder.cc
  • Download
  • Library documentation
    • Apple OS Compatibility
  • Example CLI
  • Example GUI
  • Reference
  • About us
  • Acknowledgements
  • Achievements
  • © 2015
  • Other SDR projects
  • Contact
For best browsing experience please turn on JavaScript.
Your browser doesn't support some HTML5 features and may incorrectly render the website. Please consider upgrading your browser.
X
This website uses cookies for anonymous traffic monitoring. If you disagree, disable cookies in your internet browser.
X