MCPcopy Create free account
hub / github.com/SFML/SFML / openFromMemory

Method openFromMemory

src/SFML/Audio/Music.cpp:135–154  ·  view source on GitHub ↗

///////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

133
134////////////////////////////////////////////////////////////
135bool Music::openFromMemory(const void* data, std::size_t sizeInBytes)
136{
137 // First stop the music if it was already running
138 stop();
139
140 // Open the underlying sound file
141 if (!m_impl->file.openFromMemory(data, sizeInBytes))
142 {
143 err() << "Failed to open music from memory" << std::endl;
144 return false;
145 }
146
147 // Perform common initializations
148 m_impl->initialize();
149
150 // Initialize the stream
151 SoundStream::initialize(m_impl->file.getChannelCount(), m_impl->file.getSampleRate(), m_impl->file.getChannelMap());
152
153 return true;
154}
155
156
157////////////////////////////////////////////////////////////

Callers 4

Font.test.cppFile · 0.45
Music.test.cppFile · 0.45
loadFromMemoryMethod · 0.45

Calls 4

initializeFunction · 0.85
initializeMethod · 0.45
getChannelCountMethod · 0.45
getSampleRateMethod · 0.45

Tested by

no test coverage detected