#include <frame.h>
Collaboration diagram for AsyncAudioResample< input_t, output_t >:

Public Member Functions | |
| AsyncAudioResample (AudioResampleType type, PlayList *playlist, double rate, int begin, int end, int every) | |
| ~AsyncAudioResample () | |
| bool | IsError () const |
| std::string | GetError () const |
| long | ReadAudio (float **data) |
| int | Process (double rate, int samples) |
| output_t * | GetOutput (void) |
Static Public Member Functions | |
| static long | callback (void *cb_data, float **data) |
Private Attributes | |
| SRC_STATE * | m_state |
| PlayList * | m_playlist |
| int | m_position |
| int | m_every |
| input_t | m_input [BUFFER_LEN] |
| float | m_internalInput [BUFFER_LEN] |
| float | m_internalConformed [BUFFER_LEN] |
| float | m_internalOutput [BUFFER_LEN] |
| output_t | m_output [BUFFER_LEN] |
| int | m_error |
| Frame & | m_frame |
| double | m_rate |
| SRC_STATE * | m_conformer |
| SRC_DATA | m_srcdata |
| AudioInfo | m_info |
| int | m_channels |
| int | m_end |
| int | m_silentFrameCount |
The reading of frames is asynchronous with the reading of audio samples from the resampler. Therefore, the reading of the samples out of the resampler can follow a locked audio sequence. It conforms the incoming audio to a designated frequency, and it applies another resampling ratio on the output side. The idea with the output resampling is that you can request a sample rate with some differential applied in order to coerce it into producing an intended number of samples--i.e., locked audio.
Definition at line 416 of file frame.h.
|
||||||||||||||||||||||||||||||||
|
|||||||||
|
Definition at line 481 of file frame.h. References GetFramePool(), AsyncAudioResample< input_t, output_t >::m_conformer, AsyncAudioResample< input_t, output_t >::m_frame, and AsyncAudioResample< input_t, output_t >::m_state. 00482 {
00483 GetFramePool()->DoneWithFrame( &m_frame );
00484 if ( m_state )
00485 src_delete( m_state );
00486 if ( m_conformer )
00487 src_delete( m_conformer );
00488 }
|
|
||||||||||||||||
|
Definition at line 548 of file frame.h. References AsyncAudioResample< input_t, output_t >::ReadAudio(). Referenced by AsyncAudioResample< input_t, output_t >::AsyncAudioResample(). 00549 {
00550 AsyncAudioResample<input_t,output_t>* p = static_cast< AsyncAudioResample<input_t,output_t>* >( cb_data );
00551 return p->ReadAudio( data );
00552 }
|
|
|||||||||
|
Definition at line 495 of file frame.h. References AsyncAudioResample< input_t, output_t >::m_conformer, AsyncAudioResample< input_t, output_t >::m_error, and AsyncAudioResample< input_t, output_t >::m_state. Referenced by ExportPipe::doExport(), ExportMJPEG::doExport(), ExportAVI::doExport(), ExportAudio::doExport(), Export1394::doExport(), and kino2raw(). 00496 {
00497 if ( src_error( m_state ) )
00498 return src_strerror( src_error( m_state ) );
00499 else if ( src_error( m_conformer ) )
00500 return src_strerror( src_error( m_conformer ) );
00501 else
00502 return src_strerror( m_error );
00503 }
|
|
||||||||||
|
Definition at line 573 of file frame.h. References AsyncAudioResample< input_t, output_t >::m_output. Referenced by ExportPipe::doExport(), ExportMJPEG::doExport(), ExportAVI::doExport(), ExportAudio::doExport(), Export1394::doExport(), and kino2raw(). 00574 {
00575 return m_output;
00576 }
|
|
|||||||||
|
Definition at line 490 of file frame.h. References AsyncAudioResample< input_t, output_t >::m_conformer, AsyncAudioResample< input_t, output_t >::m_error, and AsyncAudioResample< input_t, output_t >::m_state. Referenced by ExportPipe::doExport(), ExportMJPEG::doExport(), ExportAVI::doExport(), ExportAudio::doExport(), Export1394::doExport(), and kino2raw(). 00491 {
00492 return m_error || (m_state && src_error( m_state )) || (m_conformer && src_error( m_conformer ));
00493 }
|
|
||||||||||||||||
|
Definition at line 554 of file frame.h. References AsyncAudioResample< input_t, output_t >::m_channels, AsyncAudioResample< input_t, output_t >::m_internalOutput, AsyncAudioResample< input_t, output_t >::m_output, AsyncAudioResample< input_t, output_t >::m_rate, and AsyncAudioResample< input_t, output_t >::m_state. Referenced by Export::calculateAdjustedRate(), ExportPipe::doExport(), ExportMJPEG::doExport(), ExportAVI::doExport(), ExportAudio::doExport(), Export1394::doExport(), and kino2raw(). 00555 {
00556 int out_samples = src_callback_read( m_state, rate / m_rate, samples, m_internalOutput );
00557 // cerr << "AsyncAudioResample::Process rate " << rate << " req samples " << samples << " out samples " << out_samples << endl;
00558 for ( int i = 0; i < out_samples * m_channels; ++i )
00559 {
00560 float sample = m_internalOutput[ i ];
00561 if ( sample > 1.0 )
00562 sample = 1.0;
00563 if ( sample < -1.0 )
00564 sample = -1.0;
00565 if ( sample >= 0 )
00566 m_output[ i ] = ( long int )( 32767.0 * sample );
00567 else
00568 m_output[ i ] = ( long int )( 32768.0 * sample );
00569 }
00570 return out_samples;
00571 }
|
|
||||||||||
|
|||||
|
Definition at line 434 of file frame.h. Referenced by AsyncAudioResample< input_t, output_t >::AsyncAudioResample(), AsyncAudioResample< input_t, output_t >::Process(), and AsyncAudioResample< input_t, output_t >::ReadAudio(). |
|
|||||
|
|||||
|
Definition at line 435 of file frame.h. Referenced by AsyncAudioResample< input_t, output_t >::ReadAudio(). |
|
|||||
|
Definition at line 428 of file frame.h. Referenced by AsyncAudioResample< input_t, output_t >::AsyncAudioResample(), AsyncAudioResample< input_t, output_t >::GetError(), and AsyncAudioResample< input_t, output_t >::IsError(). |
|
|||||
|
Definition at line 422 of file frame.h. Referenced by AsyncAudioResample< input_t, output_t >::ReadAudio(). |
|
|||||
|
Definition at line 429 of file frame.h. Referenced by AsyncAudioResample< input_t, output_t >::ReadAudio(), and AsyncAudioResample< input_t, output_t >::~AsyncAudioResample(). |
|
|||||
|
Definition at line 433 of file frame.h. Referenced by AsyncAudioResample< input_t, output_t >::ReadAudio(). |
|
|||||
|
Definition at line 423 of file frame.h. Referenced by AsyncAudioResample< input_t, output_t >::ReadAudio(). |
|
|||||
|
Definition at line 425 of file frame.h. Referenced by AsyncAudioResample< input_t, output_t >::AsyncAudioResample(), and AsyncAudioResample< input_t, output_t >::ReadAudio(). |
|
|||||
|
Definition at line 424 of file frame.h. Referenced by AsyncAudioResample< input_t, output_t >::AsyncAudioResample(), and AsyncAudioResample< input_t, output_t >::ReadAudio(). |
|
|||||
|
Definition at line 426 of file frame.h. Referenced by AsyncAudioResample< input_t, output_t >::Process(). |
|
|||||
|
Definition at line 427 of file frame.h. Referenced by AsyncAudioResample< input_t, output_t >::GetOutput(), and AsyncAudioResample< input_t, output_t >::Process(). |
|
|||||
|
Definition at line 420 of file frame.h. Referenced by AsyncAudioResample< input_t, output_t >::ReadAudio(). |
|
|||||
|
Definition at line 421 of file frame.h. Referenced by AsyncAudioResample< input_t, output_t >::ReadAudio(). |
|
|||||
|
Definition at line 430 of file frame.h. Referenced by AsyncAudioResample< input_t, output_t >::Process(), and AsyncAudioResample< input_t, output_t >::ReadAudio(). |
|
|||||
|
Definition at line 436 of file frame.h. Referenced by AsyncAudioResample< input_t, output_t >::ReadAudio(). |
|
|||||
|
Definition at line 432 of file frame.h. Referenced by AsyncAudioResample< input_t, output_t >::AsyncAudioResample(), and AsyncAudioResample< input_t, output_t >::ReadAudio(). |
|
|||||
1.4.2