MCPcopy Create free account
hub / github.com/axmolengine/axmol / open

Method open

core/audio/AudioDecoderOpus.cpp:84–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84bool AudioDecoderOpus::open(IFileStream* stream)
85{
86 static OpusFileCallbacks OP_CALLBACKS_POSIX = {op_fread_r, op_fseek_r, op_ftell_r, op_fclose_r};
87 _of = op_open_callbacks(stream, &OP_CALLBACKS_POSIX, 0, 0, nullptr);
88 if (_of)
89 {
90 auto vi = op_head(_of, -1);
91 _sampleRate = 48000; // opus always 48K hz
92 _channelCount = vi->channel_count;
93 _bytesPerBlock = vi->channel_count * sizeof(short);
94 _totalFrames = static_cast<uint32_t>(op_pcm_total(_of, -1));
95 _isOpened = true;
96 }
97
98 return _isOpened;
99}
100
101bool AudioDecoderOpus::open(std::string_view fullPath)
102{

Callers

nothing calls this directly

Calls 6

op_open_callbacksFunction · 0.85
op_headFunction · 0.85
op_pcm_totalFunction · 0.85
getInstanceFunction · 0.85
openFileStreamMethod · 0.80
releaseMethod · 0.45

Tested by

no test coverage detected