MCPcopy Create free account
hub / github.com/cinder/Cinder / create

Method create

src/cinder/audio/Source.cpp:47–67  ·  view source on GitHub ↗

static

Source from the content-addressed store, hash-verified

45
46// static
47unique_ptr<SourceFile> SourceFile::create( const DataSourceRef &dataSource, size_t sampleRate )
48{
49 unique_ptr<SourceFile> result;
50
51 if( dataSource->getFilePathHint().extension().string() == ".ogg" )
52 result.reset( new SourceFileOggVorbis( dataSource, sampleRate ) );
53 else {
54#if defined( CINDER_COCOA )
55 result.reset( new cocoa::SourceFileCoreAudio( dataSource, sampleRate ) );
56#elif defined( CINDER_MSW )
57 result.reset( new msw::SourceFileMediaFoundation( dataSource, sampleRate ) );
58#elif defined( CINDER_LINUX )
59 result.reset( new linux::SourceFileAudioLoader( dataSource, sampleRate ) );
60#endif
61 }
62
63 if( result )
64 result->setupSampleRateConversion();
65
66 return result;
67}
68
69// static
70vector<std::string> SourceFile::getSupportedExtensions()

Callers

nothing calls this directly

Calls 4

extensionMethod · 0.80
stringMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected