| 393 | //----------------------------------------------------------------------------- |
| 394 | |
| 395 | void TheoraTexture::_initAudio( const ThreadSafeRef< SFXStream >& stream ) |
| 396 | { |
| 397 | // Create an SFXDescription if we don't have one. |
| 398 | |
| 399 | if( !mSFXDescription ) |
| 400 | { |
| 401 | SFXDescription* description = new SFXDescription; |
| 402 | description->mIsStreaming = true; |
| 403 | description->registerObject(); |
| 404 | description->setAutoDelete( true ); |
| 405 | |
| 406 | mSFXDescription = description; |
| 407 | } |
| 408 | |
| 409 | // Create an SFX memory stream that consumes the output |
| 410 | // of the Vorbis decoder. |
| 411 | |
| 412 | ThreadSafeRef< SFXStream > sfxStream = stream; |
| 413 | if( !sfxStream ) |
| 414 | { |
| 415 | OggVorbisDecoder* vorbis = _getVorbis(); |
| 416 | SFXFormat sfxFormat( vorbis->getNumChannels(), |
| 417 | vorbis->getNumChannels() * 16, |
| 418 | vorbis->getSamplesPerSecond() ); |
| 419 | |
| 420 | sfxStream = new SFXMemoryStream( sfxFormat, vorbis ); |
| 421 | } |
| 422 | |
| 423 | // Create the SFXSource. |
| 424 | |
| 425 | mSFXSource = SFX->createSourceFromStream( sfxStream, mSFXDescription ); |
| 426 | } |
| 427 | |
| 428 | //----------------------------------------------------------------------------- |
| 429 |
nothing calls this directly
no test coverage detected