MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / open

Method open

source/core/StarAudio.cpp:248–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

246 #endif
247
248 bool open() {
249 #ifdef STAR_STREAM_AUDIO
250 int result = ov_open_callbacks(&m_deviceCallbacks, &m_vorbisFile, NULL, 0, m_callbacks);
251 if (result < 0) {
252 Logger::error("Failed to open ogg stream: error code {}", result);
253 return false;
254 }
255 #else
256 m_callbacks.read_func = readFunc;
257 m_callbacks.seek_func = seekFunc;
258 m_callbacks.tell_func = tellFunc;
259 m_callbacks.close_func = NULL;
260
261 if (ov_open_callbacks(&m_memoryFile, &m_vorbisFile, NULL, 0, m_callbacks) < 0)
262 return false;
263 #endif
264
265 m_vorbisInfo = ov_info(&m_vorbisFile, -1);
266 return true;
267 }
268
269 unsigned channels() {
270 return m_vorbisInfo->channels;

Callers 4

CompressedAudioImplMethod · 0.45
UncompressedAudioImplMethod · 0.45
AudioMethod · 0.45
StarAudio.cppFile · 0.45

Calls 1

errorFunction · 0.85

Tested by

no test coverage detected