

Public Member Functions | |
| WAVImport () | |
| virtual | ~WAVImport () |
| bool | Open (char *input) |
| int | GetChannels () |
| int | GetFrequency () |
| int | GetBytesPerSample () |
| long | GetNumberOfSamples () |
| bool | Seek (off_t offset) |
| bool | Get (int16_t *data, int length) |
| bool | Close () |
Private Attributes | |
| WAVStructType | wav |
| long | start |
| int | channels |
| int | frequency |
| int | bytespersample |
| long | length |
|
|
Definition at line 204 of file kino_av_pipe.cc. References WAVStructType::file, and wav.
|
|
|
Definition at line 209 of file kino_av_pipe.cc. References Close(). 00210 {
00211 Close( );
00212 }
|
|
|
Implements KinoAudioInput. Definition at line 263 of file kino_av_pipe.cc. References WAVStructType::data, WAVStructType::file, WAVStructType::format, WAVStructType::riff, and wav. Referenced by ~WAVImport(). 00264 {
00265 if ( wav.file != NULL )
00266 {
00267 fclose( wav.file );
00268 free( wav.riff );
00269 free( wav.format );
00270 free( wav.data );
00271 wav.file = NULL;
00272 }
00273 return true;
00274 }
|
|
||||||||||||
|
Implements KinoAudioInput. Definition at line 258 of file kino_av_pipe.cc. References WAVStructType::file, and wav.
|
|
|
Implements KinoAudioInput. Definition at line 191 of file kino_av_pipe.cc. References bytespersample. 00192 {
00193 return bytespersample;
00194 }
|
|
|
Implements KinoAudioInput. Definition at line 183 of file kino_av_pipe.cc. References channels. 00184 {
00185 return channels;
00186 }
|
|
|
Implements KinoAudioInput. Definition at line 187 of file kino_av_pipe.cc. References frequency. 00188 {
00189 return frequency;
00190 }
|
|
|
Implements KinoAudioInput. Definition at line 195 of file kino_av_pipe.cc. References bytespersample, channels, and length. 00196 {
00197 return length / channels / bytespersample;
00198 }
|
|
|
Implements KinoAudioInput. Definition at line 214 of file kino_av_pipe.cc. References bytespersample, channels, WAVStructType::data, WAVStructType::file, WAVStructType::format, frequency, length, WAVStructType::riff, start, and wav. 00215 {
00216 bool iswav = false;
00217
00218 wav.file = fopen( input, "r" );
00219
00220 if ( wav.file != NULL )
00221 {
00222 wav.riff = ( RIFFChunk ) malloc( sizeof( RIFFChunkType ) );
00223 wav.format = ( FORMATChunk ) malloc( sizeof( FORMATChunkType ) );
00224 wav.data = ( DATAChunk ) malloc( sizeof( DATAChunkType ) );
00225
00226 // Bad... temporary code
00227 fread( wav.riff, sizeof( RIFFChunkType ), 1, wav.file );
00228 fread( wav.format, sizeof( FORMATChunkType ), 1, wav.file );
00229 int remainder = wav.format->length - sizeof( FORMATChunkType );
00230 if ( remainder > 0 )
00231 fseek( wav.file, remainder, SEEK_CUR );
00232 fread( wav.data, sizeof( DATAChunkType ), 1, wav.file );
00233 if ( strncasecmp( wav.data->data, "JUNK", 4 ) == 0 )
00234 {
00235 fseek( wav.file, wav.data->length, SEEK_CUR );
00236 fread( wav.data, sizeof( DATAChunkType ), 1, wav.file );
00237 }
00238
00239 if ( !strncmp( wav.riff->riff, "RIFF", 4 ) && !strncmp( wav.riff->type, "WAVE", 4 ) )
00240 {
00241 iswav = true;
00242 channels = wav.format->channels;
00243 frequency = wav.format->rate;
00244 bytespersample = wav.format->bytespersample / channels;
00245 start = ftell( wav.file );
00246 length = wav.data->length;
00247 }
00248 }
00249
00250 return iswav;
00251 }
|
|
|
Implements KinoAudioInput. Definition at line 253 of file kino_av_pipe.cc. References WAVStructType::file, start, and wav.
|
|
|
Definition at line 177 of file kino_av_pipe.cc. Referenced by GetBytesPerSample(), GetNumberOfSamples(), and Open(). |
|
|
Definition at line 175 of file kino_av_pipe.cc. Referenced by GetChannels(), GetNumberOfSamples(), and Open(). |
|
|
Definition at line 176 of file kino_av_pipe.cc. Referenced by GetFrequency(), and Open(). |
|
|
Definition at line 178 of file kino_av_pipe.cc. Referenced by GetNumberOfSamples(), and Open(). |
|
|
Definition at line 174 of file kino_av_pipe.cc. |
|
|
Definition at line 173 of file kino_av_pipe.cc. Referenced by Close(), Get(), Open(), Seek(), and WAVImport(). |
1.4.2