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

Method openFromStream

src/SFML/Audio/Music.cpp:158–177  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

156
157////////////////////////////////////////////////////////////
158bool Music::openFromStream(InputStream& stream)
159{
160 // First stop the music if it was already running
161 stop();
162
163 // Open the underlying sound file
164 if (!m_impl->file.openFromStream(stream))
165 {
166 err() << "Failed to open music from stream" << std::endl;
167 return false;
168 }
169
170 // Perform common initializations
171 m_impl->initialize();
172
173 // Initialize the stream
174 SoundStream::initialize(m_impl->file.getChannelCount(), m_impl->file.getSampleRate(), m_impl->file.getChannelMap());
175
176 return true;
177}
178
179
180////////////////////////////////////////////////////////////

Callers 4

Font.test.cppFile · 0.45
Music.test.cppFile · 0.45
loadFromStreamMethod · 0.45

Calls 4

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

Tested by

no test coverage detected