| 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; |
no test coverage detected