MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / _initAudio

Method _initAudio

Engine/source/gfx/video/theoraTexture.cpp:395–426  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

393//-----------------------------------------------------------------------------
394
395void 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

Callers

nothing calls this directly

Calls 5

setAutoDeleteMethod · 0.80
getNumChannelsMethod · 0.80
registerObjectMethod · 0.45
getSamplesPerSecondMethod · 0.45

Tested by

no test coverage detected